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 window drag #558

Merged
merged 12 commits into from
Aug 14, 2024
Merged

Fix window drag #558

merged 12 commits into from
Aug 14, 2024

Conversation

leolost2605
Copy link
Member

@leolost2605 leolost2605 commented Aug 12, 2024

Based on #556 with a slightly adjusted method from elementary/gala#2019. Still doesn't do touchscreen on x but on wayland both work

Closes #556
Fixes elementary/gala#2011
Fixes elementary/gala#2009

@leolost2605 leolost2605 requested a review from a team August 12, 2024 17:06
Copy link
Member

@lenemter lenemter left a comment

Choose a reason for hiding this comment

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

Clicking on the panel begins window grab even if you don't hold down the mouse button.

@leolost2605
Copy link
Member Author

Should be fixed now :)

@lenemter
Copy link
Member

This branch has issues with window focus. Sometimes drag doesn't start and wingpanel is focused instead.

Another issue: lets say you have 2 windows: browser (maximized, not focused) and Files (non-maximized, focued). In #556 clicking the panel would focus the browser. In this merge request it works very unpredictably. If you click a bunch of times on the panel focus goes like Files -> Panel -> Browser -> Panel.

I think the way we should fix this is in gala listen to every event (stage.captured_event) and save last device to WindowManager and expose it over libgala, so both gala and wingpanel plugin can always get the latest device. If you have other ideas i'd be happy to hear them out.

@leolost2605
Copy link
Member Author

This branch has issues with window focus. Sometimes drag doesn't start and wingpanel is focused instead.

This is fixed by the latest commit so that wingpanel never takes focus.

Another issue: lets say you have 2 windows: browser (maximized, not focused) and Files (non-maximized, focued). In #556 clicking the panel would focus the browser. In this merge request it works very unpredictably. If you click a bunch of times on the panel focus goes like Files -> Panel -> Browser -> Panel.

Should it focus the browser or should it do nothing? On the latest it (should) do nothing except of course if you drag then the maximized window gets focused and a drag begins.

The issue with the drag sometimes not starting is I think with the Gtk.GestureDrag not triggering if the range you travel is to short so I switched back to button_press_event for now.

@leolost2605
Copy link
Member Author

I think the way we should fix this is in gala listen to every event (stage.captured_event) and save last device to WindowManager and expose it over libgala, so both gala and wingpanel plugin can always get the latest device. If you have other ideas i'd be happy to hear them out.

The reason why I decided against that at least in the window menu case is that the last device doesn't have to be the device you want to move with, i.e. you can have something like:

open window menu -> with the touchscreen tap move -> move the pointer via touchpad

This wouldn't work if the grab op is started with the last device (the touchscreen used to click the menu item).

Besides hopefully everything should work now here since it mostly was issues on the wingpanel client side 🤞

Copy link
Member

@lenemter lenemter left a comment

Choose a reason for hiding this comment

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

Works flawlessly now. Good job!

@lenemter lenemter merged commit 812c188 into master Aug 14, 2024
2 of 4 checks passed
@lenemter lenemter deleted the leolost/fix-drag branch August 14, 2024 15:00
@danirabbit danirabbit mentioned this pull request Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
2 participants