Commit ed13853d authored by kylechar's avatar kylechar Committed by Commit Bot

Fix synthetic mouse moves in Ozone X11.

When a mouse button is pressed an EnterNotify / LeaveNotify XEvent is
generated for the nested XWindow used by the GPU process. The
EnterNotify ends up becoming a ET_MOUSE_DRAGGED event which is wrong. In
general, we want to just ignore the EnterNotify / LeaveNotify events for
nested XWindows.

Bug: 792322
Change-Id: I59af57199c0567001256026332823350b4a45d9e
Reviewed-on: https://chromium-review.googlesource.com/819595Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523118}
parent 523ca6ac
...@@ -97,6 +97,11 @@ std::unique_ptr<ui::Event> TranslateXEventToEvent(const XEvent& xev) { ...@@ -97,6 +97,11 @@ std::unique_ptr<ui::Event> TranslateXEventToEvent(const XEvent& xev) {
switch (xev.type) { switch (xev.type) {
case LeaveNotify: case LeaveNotify:
case EnterNotify: case EnterNotify:
// Don't generate synthetic mouse move events for EnterNotify/LeaveNotify
// from nested XWindows. https://crbug.com/792322
if (xev.xcrossing.detail == NotifyInferior)
return nullptr;
return std::make_unique<MouseEvent>(EventTypeFromXEvent(xev), return std::make_unique<MouseEvent>(EventTypeFromXEvent(xev),
EventLocationFromXEvent(xev), EventLocationFromXEvent(xev),
EventSystemLocationFromXEvent(xev), EventSystemLocationFromXEvent(xev),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment