Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 455553003: Do not release capture when starting a move loop on Desktop Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 03b2cfbc492954eaedbc8c93329d749d40e89f34..1fd497f8b0197acafe82684fec3ffbc2739a1352 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
@@ -928,6 +928,9 @@ gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const {
}
void DesktopWindowTreeHostX11::SetCapture() {
+ if (HasCapture())
+ return;
+
// Grabbing the mouse is asynchronous. However, we synchronously start
// forwarding all mouse events received by Chrome to the
// aura::WindowEventDispatcher which has capture. This makes capture
@@ -935,9 +938,10 @@ void DesktopWindowTreeHostX11::SetCapture() {
// - |g_current_capture|'s X window has capture.
// OR
// - The topmost window underneath the mouse is managed by Chrome.
- if (g_current_capture)
- g_current_capture->OnHostLostWindowCapture();
+ DesktopWindowTreeHostX11* old_capturer = g_current_capture;
g_current_capture = this;
+ if (old_capturer)
+ old_capturer->OnHostLostWindowCapture();
unsigned int event_mask = PointerMotionMask | ButtonReleaseMask |
ButtonPressMask;

Powered by Google App Engine
This is Rietveld 408576698