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

Unified Diff: ui/aura/root_window.cc

Issue 8892013: Properly cleans up state when mouse capture changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Spelling Created 9 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 | « no previous file | ui/aura/window_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 48d2798693f08439b1bbd2de22737fcfa6cab4f4..79eab4ebc249bbe711f9f7a66b2226a83fb283a3 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -361,15 +361,16 @@ void RootWindow::SetCapture(Window* window) {
// Make all subsequent mouse events and touch go to the capture window. We
// shouldn't need to send an event here as OnCaptureLost should take care of
// that.
- if (mouse_pressed_handler_)
- mouse_pressed_handler_ = capture_window_;
if (touch_event_handler_)
touch_event_handler_ = capture_window_;
+ if (mouse_moved_handler_ || mouse_button_flags_ != 0)
+ mouse_moved_handler_ = capture_window_;
} else {
// When capture is lost, we must reset the event handlers.
- mouse_pressed_handler_ = NULL;
touch_event_handler_ = NULL;
+ mouse_moved_handler_ = NULL;
}
+ mouse_pressed_handler_ = NULL;
}
void RootWindow::ReleaseCapture(Window* window) {
« no previous file with comments | « no previous file | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698