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

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

Issue 110223004: linux-aura: Fix some dragging behaviour. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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
« no previous file with comments | « ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
diff --git a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
index 20c061bd670c2914ab5836afc15edd6c790f8aa2..fd4b214e106f338a987c4ce486368dd5002b50c3 100644
--- a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
+++ b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
@@ -50,6 +50,7 @@ X11WholeScreenMoveLoop::X11WholeScreenMoveLoop(
X11WholeScreenMoveLoopDelegate* delegate)
: delegate_(delegate),
in_move_loop_(false),
+ should_reset_mouse_flags_(false),
grab_input_window_(None) {
}
@@ -113,7 +114,11 @@ bool X11WholeScreenMoveLoop::RunMoveLoop(aura::Window* source,
// We are handling a mouse drag outside of the aura::RootWindow system. We
// must manually make aura think that the mouse button is pressed so that we
// don't draw extraneous tooltips.
- aura::Env::GetInstance()->set_mouse_button_flags(ui::EF_LEFT_MOUSE_BUTTON);
+ aura::Env* env = aura::Env::GetInstance();
+ if (!env->IsMouseButtonDown()) {
+ env->set_mouse_button_flags(ui::EF_LEFT_MOUSE_BUTTON);
+ should_reset_mouse_flags_ = true;
+ }
base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop);
@@ -133,7 +138,10 @@ void X11WholeScreenMoveLoop::EndMoveLoop() {
return;
// We undo our emulated mouse click from RunMoveLoop();
- aura::Env::GetInstance()->set_mouse_button_flags(0);
+ if (should_reset_mouse_flags_) {
+ aura::Env::GetInstance()->set_mouse_button_flags(0);
+ should_reset_mouse_flags_ = false;
+ }
// TODO(erg): Is this ungrab the cause of having to click to give input focus
// on drawn out windows? Not ungrabbing here screws the X server until I kill
« no previous file with comments | « ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698