linux: Use Event location in WindowEventFilterLinux
WindowEventFilterLinux currently calculates event's screen location (in pixels) using window bounds' origin + event's root_location(), while the correct would be to use Event::location() instead. It currently works because (for some reason) MouseEvent ctor that takes an XEvent as input, which is used atm in Aura/X11 to instantiate such events, sets root_location to the same value as location [1]. This is causing issues in window drag handling after migrating PlatformEvent to ui::Event (CL under review at crrev.com/c/2022280). Such change involves switching to x11_event_translation.{h,cc} to build ui::Events out of XEvents, which was originally based on X11 event source impl used in ozone/x11 (formerly used only for "CrOS on Linux") [2] which correctly sets MouseEvent's root_location [3] using ui::EventSystemLocationFromXEvent function, which is required, for example, to be able to retrieve event's screen point in X11WholeScreeMoveLoop [4]. [1] https://source.chromium.org/chromium/chromium/src/+/master:ui/events/event.cc;l=417-418;drc=948073da23 [2] https://source.chromium.org/chromium/chromium/src/+/d436c8e6a1:ui/events/platform/x11/x11_event_source_default.cc;l=91-94 [3] https://source.chromium.org/chromium/chromium/src/+/master:ui/events/x/x11_event_translation.cc;l=53-56;drc=bb682b7a02 [4] https://crrev.com/c/2022280/15/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc#64 Bug: 965991 Change-Id: I2ad3fbde354ff66885253ccaca0e74391d4a11db Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2032307Reviewed-by:Thomas Anderson <thomasanderson@chromium.org> Commit-Queue: Nick Yamane <nickdiego@igalia.com> Cr-Commit-Position: refs/heads/master@{#737542}
Showing
Please register or sign in to comment