Mouse-moved events sent to minimized window (Apple bug, work around it). b=410219 r=joshmoz sr=vladimir

git-svn-id: svn://10.0.0.236/trunk@243160 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
smichaud%pobox.com
2008-01-16 00:45:54 +00:00
parent c4a6851d4c
commit cba81ff52d

View File

@@ -2657,6 +2657,16 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted,
- (void)mouseMoved:(NSEvent*)theEvent
{
// Work around an Apple bug that causes the OS to continue sending
// mouseMoved events to a window for a while after it's been miniaturized.
// This may be related to a similar problem with popup windows (bmo bug
// 378645, popup windows continue to receive mouseMoved events after having
// been "ordered out"), which is worked around in nsCocoaWindow::Show()
// (search on 378645 in nsCocoaWindow.mm). This problem is bmo bug 410219,
// and exists in both OS X 10.4 and 10.5.
if ([[self window] isMiniaturized])
return;
NSPoint windowEventLocation = nsCocoaUtils::EventLocationForWindow(theEvent, mWindow);
NSPoint screenEventLocation = [mWindow convertBaseToScreen:windowEventLocation];
NSPoint viewEventLocation = [self convertPoint:windowEventLocation fromView:nil];