Skip to content

Commit

Permalink
docs(changelog): better document DnD changes
Browse files Browse the repository at this point in the history
  • Loading branch information
valadaptive committed Jan 8, 2025
1 parent 6b32f2c commit 4f0819f
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/changelog/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ changelog entry.
- Add ability to make non-activating window on macOS using `NSPanel` with `NSWindowStyleMask::NonactivatingPanel`.
- `ActivationToken::from_raw` and `ActivationToken::into_raw`.
- On X11, add a workaround for disabling IME on GNOME.
- Add `WindowEvent::DragEnter`, `WindowEvent::DragOver`, `WindowEvent::DragDrop` and `WindowEvent::DragLeave` events.

### Changed

Expand Down Expand Up @@ -165,6 +164,25 @@ changelog entry.
- Update `smol_str` to version `0.3`
- Rename `VideoModeHandle` to `VideoMode`, now it only stores plain data.
- Make `Fullscreen::Exclusive` contain `(MonitorHandle, VideoMode)`.
- Reworked the file drag-and-drop API.

The `WindowEvent::DroppedFile`, `WindowEvent::HoveredFile` and `WindowEvent::HoveredFileCancelled`
events have been removed, and replaced with `WindowEvent::DragEnter`, `WindowEvent::DragOver`,
`WindowEvent::DragDrop` and `WindowEvent::DragLeave`.

The old drag-and-drop events were emitted once per file. This occurred when files were *first*
hovered over the window, dropped, or left the window. The new drag-and-drop events are emitted
once per set of files dragged, and include a list of all dragged files. They also include the
pointer position.

The rough correspondence is:
- `WindowEvent::HoveredFile` -> `WindowEvent::DragEnter`
- `WindowEvent::DroppedFile` -> `WindowEvent::DragDrop`
- `WindowEvent::HoveredFileCancelled` -> `WindowEvent::DragLeave`

The `WindowEvent::DragOver` event is entirely new, and is emitted whenever the pointer moves
whilst files are being dragged over the window. It doesn't contain any file paths, just the
pointer position.

### Removed

Expand Down Expand Up @@ -197,7 +215,6 @@ changelog entry.
`ButtonSource` as part of the new pointer event overhaul.
- Remove `Force::altitude_angle`.
- Removed `Window::inner_position`, use the new `Window::surface_position` instead.
- Removed `WindowEvent::DroppedFile`, `WindowEvent::HoveredFile` and `WindowEvent::HoveredFileCancelled` events.

### Fixed

Expand Down

0 comments on commit 4f0819f

Please sign in to comment.