Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

valadaptive
Copy link

@valadaptive valadaptive commented Jan 8, 2025

This picks up from #2615, rebasing it atop the latest winit version and fixing a couple coordinate-space bugs. Part of #720.

  • Tested on all platforms changed
    • Windows (low- and high-DPI)
    • macOS (low- and high-DPI)
    • Linux X11 (low- and high-DPI)
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

@valadaptive valadaptive mentioned this pull request Jan 8, 2025
8 tasks
amrbashir and others added 2 commits January 8, 2025 14:21
Fixes GTK drag-and-drop coords being offset by (-100, -100). The
relevant spec says:

> data.l[2] contains the coordinates of the mouse position relative
> to the root window.

https://www.freedesktop.org/wiki/Specifications/XDND/#xdndposition
@valadaptive valadaptive force-pushed the dnd-cursor-location-rebase branch from 008f86a to aa18119 Compare January 8, 2025 19:40
@valadaptive valadaptive changed the title DnD changes so far (rebased) Rework DnD redux Jan 8, 2025
@valadaptive valadaptive force-pushed the dnd-cursor-location-rebase branch from aa18119 to 4f0819f Compare January 8, 2025 19:42
@valadaptive valadaptive marked this pull request as ready for review January 8, 2025 19:50
@valadaptive valadaptive force-pushed the dnd-cursor-location-rebase branch 2 times, most recently from 1213c74 to b6eba6b Compare January 9, 2025 19:24
It's what translate_coords takes anyway, so the extra precision is
misleading if we're going to cast it to i16 everywhere it's used.

We can also simplify the "unpacking" from the XdndPosition message--we
can and should use the value of 16 as the shift instead of
size_of::<c_short> * 2 or something like that, because the specification
gives us the constant 16.
ProtocolObject is new in objc2, and lets us use the generated AppKit
bindings instead of roughing it with `msg_send!`.
@valadaptive valadaptive force-pushed the dnd-cursor-location-rebase branch from b6eba6b to fe7132e Compare January 9, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants