mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-17 04:00:42 +00:00
refactured front detection logic to own method _isFrontmostWindow
fixes travis error
This commit is contained in:
1 parent
f55fa789c4
commit
df462774aa
1 file changed
+15
-1
@@ -1983,7 +1983,7 @@ CPTexturedBackgroundWindowMask
|
||||
var theWindow = [anEvent window],
|
||||
selector = type == CPRightMouseDown ? @selector(rightMouseDown:) : @selector(mouseDown:);
|
||||
|
||||
if (([[CPApp orderedWindows] objectAtIndex:0] === self && [theWindow isKeyWindow]) || ([theWindow becomesKeyOnlyIfNeeded] && ![_leftMouseDownView needsPanelToBecomeKey]))
|
||||
if (([theWindow _isFrontmostWindow] && [theWindow isKeyWindow]) || ([theWindow becomesKeyOnlyIfNeeded] && ![_leftMouseDownView needsPanelToBecomeKey]))
|
||||
return [_leftMouseDownView performSelector:selector withObject:anEvent];
|
||||
else
|
||||
{
|
||||
@@ -2114,6 +2114,20 @@ CPTexturedBackgroundWindowMask
|
||||
return [CPApp keyWindow] == self;
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
- (BOOL)_isFrontmostWindow
|
||||
{
|
||||
var orderedWindows = [CPApp orderedWindows];
|
||||
|
||||
if ([orderedWindows count] == 0)
|
||||
return YES;
|
||||
|
||||
if ([orderedWindows objectAtIndex:0] === self)
|
||||
return YES;
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
/*!
|
||||
Makes the window the key window and brings it to the front of the screen list.
|
||||
@param aSender the object requesting this
|
||||
|
||||
Reference in new issue
Block a user