ozone/wayland: use capture requests to reroute events.
We used to be using complicated logic how to reroute and process events based on the assumption that it must be the toplevel menu window receiving located events, etc. However, there is an easier way to determine what window should receive the events, etc. 1) Remove unnecessary bits in CanDispatchEvent and return true iff the window has focus. 2) Add Grab/UnGrabEvents methods to WaylandWindowManager - it is going to tell WaylandWindows what window should finally get the event. 3) Fix the DispatchEvent so that: - It reroutes all keyboard events to root parent wayland window. - It reroutes events to the event grabber (and fixes the location of the events as it used to be doing) iff it belongs to the same "family" aka the event grabber and original event dispatcher has the same root parent window. 4) Fix the tests verifying that: - WaylandWindows process the events based on the state of the focus. - The dispatcher honors the event grabber and reroutes the events the same way as it used to be before (PlatformWindowDelegate doesn't see any changes in the logic and continues to operate as it used to operate before). - The event grabber doesn't receive events if they were initially sent to another window that doesn't belong to its family. 5) Do not set implicit capture on mouse press events. Also remove the bits related to that. Bug: 1079221 Change-Id: Iaf2fd175f6ede6779d58863832245dca87178d60 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2187313 Commit-Queue: Maksim Sisov <msisov@igalia.com> Reviewed-by:Nick Yamane <nickdiego@igalia.com> Reviewed-by:
Robert Kroeger <rjkroege@chromium.org> Cr-Commit-Position: refs/heads/master@{#768728}
Showing
This diff is collapsed.
Please register or sign in to comment