summaryrefslogtreecommitdiffstats
path: root/views/widget/root_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/widget/root_view.cc')
-rw-r--r--views/widget/root_view.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc
index 91ba511..a56ec99 100644
--- a/views/widget/root_view.cc
+++ b/views/widget/root_view.cc
@@ -455,8 +455,11 @@ void RootView::OnMouseReleased(const MouseEvent& e, bool canceled) {
void RootView::OnMouseMoved(const MouseEvent& e) {
View* v = GetViewForPoint(e.location());
- // Find the first enabled view.
- while (v && !v->IsEnabled())
+ // Find the first enabled view, or the existing move handler, whichever comes
+ // first. The check for the existing handler is because if a view becomes
+ // disabled while handling moves, it's wrong to suddenly send ET_MOUSE_EXITED
+ // and ET_MOUSE_ENTERED events, because the mouse hasn't actually exited yet.
+ while (v && !v->IsEnabled() && (v != mouse_move_handler_))
v = v->GetParent();
if (v && v != this) {
if (v != mouse_move_handler_) {