Chromium Code Reviews
Description[Ozone/x11] events can be dispatched to the wrong window
When multiple X11Window/X11WindowOzone instances are created, each
registers itself in PlatformEventSource as a "platform event dispatcher".
Before dispatching an event to a specific window, PlatformEventSource
iterates over the list of registered dispatchers, "asking" each dispatcher
whether the event can be dispatch to it.
In case of non-Ozone X11 windows, X11Window::CanDispatchEvent is called
receiving a XEvent* parameter, and checks whether the xwindow targeted
by the event is the same as the xwindow it wraps (see ::IsEventForXWindow).
If so it dispatches the event to this X11Window instance.
In case of Ozone X11 windows, X11WindowOzone::CanDispatchEvent is called
receiving a ui::Event* parameter, and it is not possible to access its
associated NativeEvent*, because event was manually constructed in
EventSourceLibevent::ProcessXEvent.
Hence, ::CanDispatchEvent does not check if it is the event's target
window, but instead whether the event location is contained in its bounds.
This is fragile: if there are two overlapping X11WindowOzone instances,
the first one that registered itself in PlatformEventSource will be
the one receiving mouse events in the overlapping area, even if it is
not the foreground window.
CL fixes it by making it possible to pass the original ui::PlatformEvent
event alongside with the ui::Event instance created off of it, which allows
X11WindowOzone::CanDispatchEvent to minic the check that both
X11WindowOzone and DesktopWindowTreeHostX11 do.
BUG=707406
Patch Set 1 #
Total comments: 2
Messages
Total messages: 11 (6 generated)
|
|||||||||||||||||||||||||||||||||||||