-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework DnD redux #4079
Merged
madsmtm
merged 24 commits into
rust-windowing:master
from
valadaptive:dnd-cursor-location-rebase
Jan 28, 2025
+327
−121
Merged
Rework DnD redux #4079
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
2594b83
feat: DnD changes so far (rebased)
amrbashir 1069dd8
fix: translate xdnd coordinates to root window
valadaptive b3510c2
feat: DnD example/test
valadaptive d100b86
fix: make DnD compile and function on macOS
valadaptive 9bf7a4e
fix: make DnD compile and function on Windows
valadaptive 7c293f5
chore: format according to nightly rules
valadaptive 35a972f
docs: expand drag event documentation
valadaptive 36438b1
docs(changelog): better document DnD changes
valadaptive c5e3575
x11: store dnd.position as pair of i16
valadaptive a2b150b
appkit: use ProtocolObject<dyn NSDraggingInfo>
valadaptive 5bbbedd
windows: only emit DragEnter if enter_is_valid
valadaptive 3d3f6fb
x11: store translated DnD coords
valadaptive bafb090
x11: don't emit DragLeave without DragEnter
valadaptive 2873e88
refactor: reword drag events to match pointer ones
valadaptive 991b4c8
feat: add position to DragLeft
valadaptive dcfb62d
macos: implement position on DragLeft
valadaptive 6b4b84b
refactor: DragDrop -> DragDropped
valadaptive a4be71e
docs: clarify drag events
valadaptive df8e5ce
examples/dnd: handle RedrawRequested event
valadaptive f55a534
x11: DnD code style tweaks
valadaptive 2f589b5
windows: import DnD events at top of file
valadaptive 59dd7ed
windows: drop_handler.enter_is_valid -> valid
valadaptive 2153865
windows: in DnD, always set pdwEffect
valadaptive 731a0ce
Don't rename protocol parameter
madsmtm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
macos: implement position on DragLeft
The Swift docs say the dragging info may be nullable here specifically: https://developer.apple.com/documentation/appkit/nsdraggingdestination/draggingexited(_:)
commit dcfb62d2999b5a28b2877516a4e908db7aefbac7
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For @madsmtm: is this the right way to represent a sender param that may be null? The Swift docs note that for this specific callback, this parameter is nullable.
(As a side node, kinda alarming how the Objective-C docs just don't mention its nullability at all, as far as I can tell. Any idea what's going on there?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is correct, see also the docs in
objc2-app-kit
. In the future, I plan to make it required to have the same signature as inobjc2-app-kit
, but haven't gotten around to it yet.The docs on Apple's website don't mention it, probably to be less verbose, but the header does contain a nullability attribute:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Please keep the name as
sender
.