Commit 77a40452 authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

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
parent 5700ef4d
...@@ -332,6 +332,13 @@ uint32_t WindowTreeHostX11::DispatchEvent(const ui::PlatformEvent& event) { ...@@ -332,6 +332,13 @@ uint32_t WindowTreeHostX11::DispatchEvent(const ui::PlatformEvent& event) {
switch (xev->type) { switch (xev->type) {
case EnterNotify: { 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(); aura::Window* root_window = window();
client::CursorClient* cursor_client = client::CursorClient* cursor_client =
client::GetCursorClient(root_window); client::GetCursorClient(root_window);
...@@ -348,6 +355,13 @@ uint32_t WindowTreeHostX11::DispatchEvent(const ui::PlatformEvent& event) { ...@@ -348,6 +355,13 @@ uint32_t WindowTreeHostX11::DispatchEvent(const ui::PlatformEvent& event) {
break; break;
} }
case LeaveNotify: { 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); ui::MouseEvent mouse_event(xev);
TranslateAndDispatchLocatedEvent(&mouse_event); TranslateAndDispatchLocatedEvent(&mouse_event);
break; break;
......
...@@ -1530,6 +1530,13 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( ...@@ -1530,6 +1530,13 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
switch (xev->type) { switch (xev->type) {
case EnterNotify: case EnterNotify:
case LeaveNotify: { case LeaveNotify: {
// Ignore EventNotify and 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); ui::MouseEvent mouse_event(xev);
DispatchMouseEvent(&mouse_event); DispatchMouseEvent(&mouse_event);
break; break;
......
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