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

Fix for touch window drag-and-drop #736

Merged
merged 5 commits into from
Jan 28, 2024
Merged

Fix for touch window drag-and-drop #736

merged 5 commits into from
Jan 28, 2024

Conversation

Thesola10
Copy link
Collaborator

@Thesola10 Thesola10 commented Dec 10, 2023

This fixes #735

@Thesola10 Thesola10 changed the base branch from release to develop December 10, 2023 21:53
@Thesola10 Thesola10 marked this pull request as draft December 10, 2023 21:53
@Thesola10
Copy link
Collaborator Author

Right now the window dragging works with this PR, but tiling scroll still gets stuck afterwards. Not sure what causes that.

@Thesola10 Thesola10 force-pushed the fix-touch-dnd branch 2 times, most recently from b60442f to acf4b47 Compare December 10, 2023 22:03
@Thesola10 Thesola10 changed the title Partial fix for touch window drag-and-drop Dix for touch window drag-and-drop Dec 10, 2023
@Thesola10 Thesola10 changed the title Dix for touch window drag-and-drop Fix for touch window drag-and-drop Dec 10, 2023
@Thesola10
Copy link
Collaborator Author

Okay, this is weird. In my nested Shell, touch event coordinates match the global pointer exactly, but on my host Wayland session, it doesn't, which breaks everything.

@Thesola10
Copy link
Collaborator Author

Okay, we may need to tell the stage to intercept all touch events to extract a facsimile of global.get_pointer(), and somehow do so right as MoveGrab is instantiated, even though it's an inherently async opeartion.

Most likely this means creating a broker object between global.get_pointer() and our stage-based approach, which is itself involved in (or passed to) the MoveGrab instance.

@Thesola10

This comment was marked as resolved.

This is an incomplete solution, as the drag-and-drop event isn't
properly finished in touch cases, requiring a trackpad swipe to "unlock"
the situation.

Also, while simple, moving the global pointer goes against expected
touch behavior in GNOME, which is that touch events do not move the
mouse. This could be adressed by memorizing and restoring the pointer as
the event starts.
@Thesola10
Copy link
Collaborator Author

Thesola10 commented Jan 28, 2024

Actually, disregard the last commit message, any one event also "unlocks" the drag-and-drop event, so this is a reasonable fix -- at least it removes the softlock situation.

@Thesola10 Thesola10 marked this pull request as ready for review January 28, 2024 11:49
@Thesola10 Thesola10 requested a review from jtaala January 28, 2024 11:49
…using PaperWM's

built-in `warpPointer` method.
Copy link
Collaborator

@jtaala jtaala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Thesola10,

Looks good. I made a couple of small changes - mainly just a little linting/cleanup, and switched to using PaperWM's warpPointer util method (and improved it to made ripple animation showing optional).

Happy to approve this if you're happy with the changes.

Also a quick workaround to circumvent GitHub approval restrictions
@Thesola10
Copy link
Collaborator Author

yep, looks good to me!

@jtaala jtaala merged commit 429265a into develop Jan 28, 2024
@jtaala jtaala deleted the fix-touch-dnd branch January 28, 2024 13:02
@Thesola10 Thesola10 added the touchscreen Issue is related to touch screen functionality label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
touchscreen Issue is related to touch screen functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window drag-and-drop does not work when started from touchscreen
2 participants