Spurious mouseout event with overlapped divs on Mac OS X. Patch by Matthew Gregan. b=411597 r=josh sr=roc

This commit is contained in:
joshmoz@gmail.com 2008-01-29 13:12:00 -08:00
Родитель 31b04a892e
Коммит 66e301bea1
1 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -2645,7 +2645,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted,
return;
NSPoint windowEventLocation = nsCocoaUtils::EventLocationForWindow(theEvent, mWindow);
NSPoint screenEventLocation = [mWindow convertBaseToScreen:windowEventLocation];
NSPoint viewEventLocation = [self convertPoint:windowEventLocation fromView:nil];
// Installing a mouseMoved handler on the EventMonitor target (in
@ -2663,7 +2662,8 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted,
if (![NSApp isActive] && !mouseEventIsOverRollupWidget) {
if (sLastViewEntered) {
nsIWidget* lastViewEnteredWidget = [(NSView<mozView>*)sLastViewEntered widget];
SendGeckoMouseEnterOrExitEvent(PR_TRUE, NS_MOUSE_EXIT, lastViewEnteredWidget, nsMouseEvent::eReal, &viewEventLocation);
NSPoint exitEventLocation = [sLastViewEntered convertPoint:windowEventLocation fromView:nil];
SendGeckoMouseEnterOrExitEvent(PR_TRUE, NS_MOUSE_EXIT, lastViewEnteredWidget, nsMouseEvent::eReal, &exitEventLocation);
sLastViewEntered = nil;
}
return;
@ -2684,9 +2684,10 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted,
// If the hit test returned nil then the mouse isn't over the window. If thse mouse
// exited the window then send mouse exit to the last view in the window it was over.
if (sLastViewEntered) {
// NSLog(@"sending NS_MOUSE_EXIT event with point %f,%f\n", viewEventLocation.x, viewEventLocation.y);
NSPoint exitEventLocation = [sLastViewEntered convertPoint:windowEventLocation fromView:nil];
// NSLog(@"sending NS_MOUSE_EXIT event with point %f,%f\n", exitEventLocation.x, exitEventLocation.y);
nsIWidget* lastViewEnteredWidget = [(NSView<mozView>*)sLastViewEntered widget];
SendGeckoMouseEnterOrExitEvent(PR_TRUE, NS_MOUSE_EXIT, lastViewEnteredWidget, nsMouseEvent::eReal, &viewEventLocation);
SendGeckoMouseEnterOrExitEvent(PR_TRUE, NS_MOUSE_EXIT, lastViewEnteredWidget, nsMouseEvent::eReal, &exitEventLocation);
sLastViewEntered = nil;
}
return;
@ -2700,9 +2701,10 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted,
nsAutoRetainView kungFuDeathGrip(self);
if (sLastViewEntered != self) {
if (sLastViewEntered) {
// NSLog(@"sending NS_MOUSE_EXIT event with point %f,%f\n", viewEventLocation.x, viewEventLocation.y);
NSPoint exitEventLocation = [sLastViewEntered convertPoint:windowEventLocation fromView:nil];
// NSLog(@"sending NS_MOUSE_EXIT event with point %f,%f\n", exitEventLocation.x, exitEventLocation.y);
nsIWidget* lastViewEnteredWidget = [(NSView<mozView>*)sLastViewEntered widget];
SendGeckoMouseEnterOrExitEvent(PR_TRUE, NS_MOUSE_EXIT, lastViewEnteredWidget, nsMouseEvent::eReal, &viewEventLocation);
SendGeckoMouseEnterOrExitEvent(PR_TRUE, NS_MOUSE_EXIT, lastViewEnteredWidget, nsMouseEvent::eReal, &exitEventLocation);
// The mouse exit event we just sent may have destroyed this widget, bail if that happened.
if (!mGeckoChild)