| Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| index dd8aa406385bf0b224a860a9b0b48e2c6ce27d15..04b826a94a230d7f12f1a516b9cb097dfc37d086 100644
|
| --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| @@ -952,14 +952,14 @@ void DesktopWindowTreeHostX11::SetCapture() {
|
| // OR
|
| // - The topmost window underneath the mouse is managed by Chrome.
|
| DesktopWindowTreeHostX11* old_capturer = g_current_capture;
|
| +
|
| + // Update |g_current_capture| prior to calling OnHostLostWindowCapture() to
|
| + // avoid releasing pointer grab.
|
| g_current_capture = this;
|
| if (old_capturer)
|
| old_capturer->OnHostLostWindowCapture();
|
|
|
| - unsigned int event_mask = PointerMotionMask | ButtonReleaseMask |
|
| - ButtonPressMask;
|
| - XGrabPointer(xdisplay_, xwindow_, True, event_mask, GrabModeAsync,
|
| - GrabModeAsync, None, None, CurrentTime);
|
| + ui::GrabPointer(xwindow_, true, None);
|
| }
|
|
|
| void DesktopWindowTreeHostX11::ReleaseCapture() {
|
| @@ -968,7 +968,7 @@ void DesktopWindowTreeHostX11::ReleaseCapture() {
|
| // the topmost window underneath the mouse so the capture release being
|
| // asynchronous is likely inconsequential.
|
| g_current_capture = NULL;
|
| - XUngrabPointer(xdisplay_, CurrentTime);
|
| + ui::UngrabPointer();
|
|
|
| OnHostLostWindowCapture();
|
| }
|
|
|