8000 Fix macOS drag by amolenaar · Pull Request #891 · gaphor/gaphas · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix macOS drag #891

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

Merged
merged 3 commits into from
Apr 5, 2025
Merged

Fix macOS drag #891

merged 3 commits into from
Apr 5, 2025

Conversation

amolenaar
Copy link
Member
@amolenaar amolenaar commented Apr 5, 2025

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes

What is the current behavior?

In Gaphor sometimes, especially on macOS, the moved items jump back to their original place when. This may be because by the time the Gesture::end signal is triggered, the sequence is no longer valid.

The Gtk.Gesture::end handler (which emits Gtk.GestureDrag::drag-end) doesn't check if the sequence is handled by the gesture, while Gtk.GestureDrag.get_start_point() does. Hence, we do get an offset, but we cannot obtain the start position from the sequence anymore.

Issue Number: Fixes gaphor/gaphor#3753

What is the new behavior?

We store the start position ourselves. This way we do no longer need to rely on the event sequence still being active when ending a drag operation.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

It may be nicer to rewrite the move handlers to work with offsets, so the interface is in line with what we have in the controllers. However, that's considerably more work.

Somehow, on macOS, the drag-end signal no longer can query
for things like the starting position. Until this issue is
fixed, we can store the starting position ourselves.
@amolenaar amolenaar changed the title Fix macos drag Fix macOS drag Apr 5, 2025
@amolenaar amolenaar merged commit 30345ed into main Apr 5, 2025
10 checks passed
@amolenaar amolenaar deleted the fix-macos-drag branch April 5, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-Responsive clicks / actions on MacOS
1 participant
0