From 02b4fd3198a0665ebfabdf8e2380e4647e3ca8f2 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Mon, 16 May 2011 15:15:43 +0200 Subject: [PATCH] Bug 596600 - Start generating window-level mouse out events at the root EventStateManager. r=smaug --HG-- rename : widget/tests/test_native_mouse_mac.xul => widget/tests/test_bug596600.xul --- layout/base/nsPresShell.cpp | 9 +- widget/tests/Makefile.in | 2 + widget/tests/test_bug596600.xul | 153 ++++++++++++++++++++++++++++++ widget/tests/window_bug596600.xul | 4 + 4 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 widget/tests/test_bug596600.xul create mode 100644 widget/tests/window_bug596600.xul diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 4a57f9ed1bd5..cfb8e33b7ae8 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -6722,10 +6722,15 @@ PresShell::HandleEvent(nsIView *aView, } } + PRBool isWindowLevelMouseExit = (aEvent->message == NS_MOUSE_EXIT) && + (static_cast(aEvent)->exit == nsMouseEvent::eTopLevel); + // Get the frame at the event point. However, don't do this if we're // capturing and retargeting the event because the captured frame will - // be used instead below. - if (!captureRetarget) { + // be used instead below. Also keep using the root frame if we're dealing + // with a window-level mouse exit event since we want to start sending + // mouse out events at the root EventStateManager. + if (!captureRetarget && !isWindowLevelMouseExit) { nsPoint eventPoint = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, frame); { diff --git a/widget/tests/Makefile.in b/widget/tests/Makefile.in index a72a42f76a50..65885df7cf97 100644 --- a/widget/tests/Makefile.in +++ b/widget/tests/Makefile.in @@ -108,6 +108,8 @@ _CHROME_FILES += native_menus_window.xul \ test_bug586713.xul \ bug586713_window.xul \ test_key_event_counts.xul \ + test_bug596600.xul \ + window_bug596600.xul \ $(NULL) endif diff --git a/widget/tests/test_bug596600.xul b/widget/tests/test_bug596600.xul new file mode 100644 index 000000000000..64c8fc03929b --- /dev/null +++ b/widget/tests/test_bug596600.xul @@ -0,0 +1,153 @@ + + + + + + Test for bug 596600 + + + + diff --git a/widget/tests/window_bug596600.xul b/widget/tests/window_bug596600.xul new file mode 100644 index 000000000000..28e96f68e00d --- /dev/null +++ b/widget/tests/window_bug596600.xul @@ -0,0 +1,4 @@ + + +