Fix for setIgnoresMouseEvents: in CPWindow.

[#195 state:resolved].

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2009-01-05 01:58:21 -08:00
parent c6529f6bf7
commit 6a5bf822ab
3 changed files with 32 additions and 2 deletions
+11
View File
@@ -260,6 +260,7 @@ var CPWindowSaveImage = nil,
CPString _title;
BOOL _acceptsMouseMovedEvents;
BOOL _ignoresMouseEvents;
CPWindowController _windowController;
@@ -927,6 +928,16 @@ CPTexturedBackgroundWindowMask
_acceptsMouseMovedEvents = shouldAcceptMouseMovedEvents;
}
- (BOOL)ignoresMouseEvents
{
return _ignoresMouseEvents;
}
- (void)setIgnoresMouseEvents:(BOOL)shouldIgnoreMouseEvents
{
_ignoresMouseEvents = shouldIgnoreMouseEvents;
}
// Managing Titles
/*!
+16 -2
View File
@@ -223,6 +223,16 @@ var CPDOMWindowGetFrame,
return CPRectCreateCopy(_contentBounds);
}
- (CPArray)orderedWindowsAtLevel:(int)aLevel
{
var layer = [self layerAtLevel:aLevel create:NO];
if (!layer)
return [];
return [layer orderedWindows];
}
- (CPDOMWindowLayer)layerAtLevel:(int)aLevel create:(BOOL)aFlag
{
var layer = [_windowLayers objectForKey:aLevel];
@@ -326,8 +336,12 @@ var CPDOMWindowGetFrame,
windowCount = windows.length;
while (windowCount-- && !theWindow)
if (CPRectContainsPoint(windows[windowCount]._frame, location))
theWindow = windows[windowCount];
{
var candidateWindow = windows[windowCount];
if (!candidateWindow._ignoresMouseEvents && CGRectContainsPoint(candidateWindow._frame, location))
theWindow = candidateWindow;
}
}
return theWindow;
+5
View File
@@ -116,4 +116,9 @@
}
}
- (CPArray)orderedWindows
{
return _windows;
}
@end