summaryrefslogtreecommitdiffstats
path: root/ui/aura/root_window.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-11 14:52:36 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-11 14:52:36 +0000
commit06d0d6595160f0d20a35ec2e66276db878151118 (patch)
tree261f052f6e0fed69bf02daf6d53cdd3991b78e93 /ui/aura/root_window.cc
parente25d39cc8a14eecc1cf186ff9c92da1020cc74b6 (diff)
downloadchromium_src-06d0d6595160f0d20a35ec2e66276db878151118.zip
chromium_src-06d0d6595160f0d20a35ec2e66276db878151118.tar.gz
chromium_src-06d0d6595160f0d20a35ec2e66276db878151118.tar.bz2
Reset mouse_pressed_handler_, mouse_moved_handler_, mouse_event_dispatch_target_ even when moving a window.
They don't have to be kept, and also can become invalid when these windows are destroyed. BUG=157583 TEST=ash_unittests + https://codereview.chromium.org/11691010/ crashes without this CL Review URL: https://chromiumcodereview.appspot.com/11778101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/root_window.cc')
-rw-r--r--ui/aura/root_window.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 2449873..8a14bd2 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -665,10 +665,11 @@ void RootWindow::OnWindowHidden(Window* invisible,
invisible, this, reason == WINDOW_DESTROYED);
}
- // Do not clear the capture, and the dispatch targets if the window is moving
- // across root windows, because the target itself is actually still visible
- // and clearing them stops further event processing, which can cause
- // unexpected behaviors. See crbug.com/157583
+ // Do not clear the capture, and the |event_dispatch_target_| if the
+ // window is moving across root windows, because the target itself
+ // is actually still visible and clearing them stops further event
+ // processing, which can cause unexpected behaviors. See
+ // crbug.com/157583
if (reason != WINDOW_MOVING) {
Window* capture_window = aura::client::GetCaptureWindow(this);
// If the ancestor of the capture window is hidden,
@@ -676,18 +677,19 @@ void RootWindow::OnWindowHidden(Window* invisible,
if (invisible->Contains(capture_window) && invisible != this)
capture_window->ReleaseCapture();
- // If the ancestor of any event handler windows are invisible, release the
- // pointer to those windows.
- if (invisible->Contains(mouse_pressed_handler_))
- mouse_pressed_handler_ = NULL;
- if (invisible->Contains(mouse_moved_handler_))
- mouse_moved_handler_ = NULL;
- if (invisible->Contains(mouse_event_dispatch_target_))
- mouse_event_dispatch_target_ = NULL;
if (invisible->Contains(event_dispatch_target_))
event_dispatch_target_ = NULL;
}
+ // If the ancestor of any event handler windows are invisible, release the
+ // pointer to those windows.
+ if (invisible->Contains(mouse_pressed_handler_))
+ mouse_pressed_handler_ = NULL;
+ if (invisible->Contains(mouse_moved_handler_))
+ mouse_moved_handler_ = NULL;
+ if (invisible->Contains(mouse_event_dispatch_target_))
+ mouse_event_dispatch_target_ = NULL;
+
CleanupGestureRecognizerState(invisible);
}