From 7df34cc70988fcdf3bbc35e3eee795605d9fd09d Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Wed, 13 Mar 2013 15:09:02 -0400 Subject: [PATCH] Fixed: windows with sheets were filtering mouse move events. Previously, if a window had a sheet, a mouse move event was passed to the sheet and then filtered. This disabled resize cursors for the parent window of a sheet. This commit allows mouse move events to continue to the parent window so that resize cursors will work on the parent window as well. --- AppKit/CPWindow/CPWindow.j | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 9ea26222c..ebbf3024d 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -1657,13 +1657,12 @@ CPTexturedBackgroundWindowMask - (void)sendEvent:(CPEvent)anEvent { var type = [anEvent type], - point = [anEvent locationInWindow]; + sheet = [self attachedSheet]; // If a sheet is attached events get filtered here. // It is not clear what events should be passed to the view, perhaps all? // CPLeftMouseDown is needed for window moving and resizing to work. // CPMouseMoved is needed for rollover effects on title bar buttons. - var sheet = [self attachedSheet]; if (sheet) { @@ -1675,15 +1674,20 @@ CPTexturedBackgroundWindowMask // -dw- if the window is clicked, the sheet should come to front, and become key, // and the window should be immediately behind [sheet makeKeyAndOrderFront:self]; - break; - case CPMouseMoved: - [_windowView mouseMoved:anEvent]; - break; - } + return; - return; + case CPMouseMoved: + // Allow these through to the parent + break; + + default: + // Everything else is filtered + return; + } } + var point = [anEvent locationInWindow]; + switch (type) { case CPFlagsChanged: @@ -1804,7 +1808,8 @@ CPTexturedBackgroundWindowMask case CPMouseMoved: [_windowView setCursorForLocation:point resizing:NO]; - if (!_acceptsMouseMovedEvents) + // Ignore mouse moves for parents of sheets + if (!_acceptsMouseMovedEvents || sheet) return; if (!_mouseEnteredStack)