-
Notifications
You must be signed in to change notification settings - Fork 29.7k
engine: report mouse backward and forward buttons on linux #163500
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
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
|
Code change looks good, just needs more information to work out if this button mapping is consistent for all mice and the same on both X11 and Wayland. See #152128 for more discussion. |
|
See #163503 which interprets the main three buttons more clearly. |
robert-ancell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the prior art in https://gitlab.gnome.org/GNOME/epiphany/-/blob/main/embed/ephy-web-view.c I think this is the expected behaviour. I think we just need to add a comment about why 8 and 9 are used - use a constexpr for these at the top of the file with the comment. Also this doesn't completely resolve #152128, as this doesn't support other buttons. So remove the link from the commit message.
|
I adjusted the description about related issues. I'm open to adding more information concerning the "magic" numbers used here (8 & 9). It would certainly help to know all the platforms this patch would affect. My personal aim was just for Linux OS desktop environments, but research from @robert-ancell implies there are other implicated platforms here. @robert-ancell Thank you for the quick responses and deep dives related to this! |
|
The only platform affected here is Linux. If this was a cross-platform GTK app this would be more complicated, but since the Flutter Linux embedder only runs on Linux we don't have to worry about that. The only subplatforms are X11 vs Wayland, but it seems they send the same button value, which is probably expected as they ultimately come from the kernel. |
|
Thanks for all the clarification. I will try to distill the info you've posted into commented context. |
add explanatory context in comments
|
I couldn't find any guideline about naming const expressions. I just went with |
robert-ancell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thanks!
|
I've asked on Discord for a test exemption for this - I looked at writing a test but it was very hard to generate the fake mouse events. In the end the test was just confirming the mapping was the mapping, so I don't think it would add much value anyway. |
Based on flutter#163500 by @2bndy5
|
#164356 is the same change but with restructuring to make it testable. |
|
Excellent work! Should I close this in favor of #164356 ? |
This patch allows a mouse's back and forward buttons to be reported on Linux.
I tested/verified this on x11 using a sample flutter project that employs a custom
RawGestureDetectorto act upon the detected mouse event's buttons (back and forward).This relates to #152128 and its parent issue #115641. Clearly, more discussion needs to be had about other mouse buttons before #152128 can be fully resolved.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.