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

Add logic for CursorEntered/CursorLeft on x11 #151

Merged

Conversation

Fredemus
Copy link
Contributor

@Fredemus Fredemus commented Oct 3, 2023

Necessary to fix vizia/vizia#407, which is a bug that locks up the GUI when you press down on a mouse button inside the window and release the button outside the window.

Copy link
Member

@robbert-vdh robbert-vdh left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up!

src/x11/window.rs Outdated Show resolved Hide resolved
Comment on lines +617 to +620
handler.on_event(
&mut crate::Window::new(self),
Event::Mouse(MouseEvent::CursorEntered),
);
Copy link
Member

Choose a reason for hiding this comment

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

This should also generate CursorMoved event. From the spec:

If pointer motion or window hierarchy change causes the pointer to be in a different window than before, EnterNotify and LeaveNotify events are generated instead of a MotionNotify event.

Copy link
Contributor Author

@Fredemus Fredemus Oct 7, 2023

Choose a reason for hiding this comment

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

Good catch! Added. As far as I can tell, EnterNotifyEvent's detail or mode shouldn't matter for that, so it should be right.
edit: I don't currently have a Linux machine so I can't test if the change is working as it should. I can test on tuesday if you can't

Copy link
Member

@robbert-vdh robbert-vdh left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR!

@robbert-vdh robbert-vdh merged commit f0639b7 into RustAudio:master Oct 8, 2023
3 checks passed
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.

Mouse locks up when releasing mouse capture outside the window in vizia_baseview
2 participants