summaryrefslogtreecommitdiffstats
path: root/ui/aura/window_tree_host_x11.cc
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-19 21:13:16 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-19 21:13:16 +0000
commit77a40452ee7b98c4d6cf62c06055030566903fce (patch)
treee8ec613ca80d89953e69f91d4732890dfd535eda /ui/aura/window_tree_host_x11.cc
parent5700ef4d414ff6d28739bee538c7a97f79e03358 (diff)
downloadchromium_src-77a40452ee7b98c4d6cf62c06055030566903fce.zip
chromium_src-77a40452ee7b98c4d6cf62c06055030566903fce.tar.gz
chromium_src-77a40452ee7b98c4d6cf62c06055030566903fce.tar.bz2
Ignore EnterNotify and LeaveNotify events from NativeViewGlSurfaceGLX's window.
https://codereview.chromium.org/296003010 added a child window to the toplevel X window. As a result of the CL, an EnterNotify event is sent immediately after each mouse press. WindowTreeHostX11:Dispatch() transforms the EnterNotify to a synthetic mouse move. In terms of HTML events, the CL causes an 'onmousemove' event to be fired immediately after the 'onmousedown' event. This differs from the previous behavior where the initial 'onmousemove' event was always fired some indeterminate time after the 'onmousedown'. For the sake of safety, this CL suppresses the extra EnterNotify. BUG=385716 TEST=None Review URL: https://codereview.chromium.org/346673002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/window_tree_host_x11.cc')
-rw-r--r--ui/aura/window_tree_host_x11.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc
index 1db7136..c3dcb19 100644
--- a/ui/aura/window_tree_host_x11.cc
+++ b/ui/aura/window_tree_host_x11.cc
@@ -332,6 +332,13 @@ uint32_t WindowTreeHostX11::DispatchEvent(const ui::PlatformEvent& event) {
switch (xev->type) {
case EnterNotify: {
+ // Ignore EventNotify events from children of |xwindow_|.
+ // NativeViewGLSurfaceGLX adds a child to |xwindow_|.
+ // TODO(pkotwicz|tdanderson): Figure out whether the suppression is
+ // necessary. crbug.com/385716
+ if (xev->xcrossing.detail == NotifyInferior)
+ break;
+
aura::Window* root_window = window();
client::CursorClient* cursor_client =
client::GetCursorClient(root_window);
@@ -348,6 +355,13 @@ uint32_t WindowTreeHostX11::DispatchEvent(const ui::PlatformEvent& event) {
break;
}
case LeaveNotify: {
+ // Ignore LeaveNotify events from children of |xwindow_|.
+ // NativeViewGLSurfaceGLX adds a child to |xwindow_|.
+ // TODO(pkotwicz|tdanderson): Figure out whether the suppression is
+ // necessary. crbug.com/385716
+ if (xev->xcrossing.detail == NotifyInferior)
+ break;
+
ui::MouseEvent mouse_event(xev);
TranslateAndDispatchLocatedEvent(&mouse_event);
break;