mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-30 22:27:42 +00:00
A few minor bug fixes for key/main window handling.
This commit is contained in:
@@ -860,12 +860,11 @@ CPRunContinuesResponse = -1002;
|
||||
|
||||
if ([windowController respondsToSelector:anAction])
|
||||
return windowController;
|
||||
|
||||
|
||||
var theDocument = [windowController document];
|
||||
|
||||
if (theDocument != delegate && [theDocument respondsToSelector:anAction])
|
||||
if (theDocument !== delegate && [theDocument respondsToSelector:anAction])
|
||||
return theDocument;
|
||||
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -1063,7 +1062,7 @@ CPRunContinuesResponse = -1002;
|
||||
else if ([self mainWindow])
|
||||
[[self mainWindow] makeKeyAndOrderFront:self];
|
||||
else
|
||||
[[[self mainMenu] window] makeKeyWindow]; //FIXME this may not actually work
|
||||
[[self mainMenu]._menuWindow makeKeyWindow]; //FIXME this may not actually work
|
||||
|
||||
_previousKeyWindow = nil;
|
||||
_previousMainWindow = nil;
|
||||
|
||||
@@ -1497,7 +1497,8 @@ CPTexturedBackgroundWindowMask
|
||||
if (_firstResponder != self && [_firstResponder respondsToSelector:@selector(resignKeyWindow)])
|
||||
[_firstResponder resignKeyWindow];
|
||||
|
||||
CPApp._keyWindow = nil;
|
||||
if (CPApp._keyWindow === self)
|
||||
CPApp._keyWindow = nil;
|
||||
|
||||
[[CPNotificationCenter defaultCenter]
|
||||
postNotificationName:CPWindowDidResignKeyNotification
|
||||
@@ -1858,7 +1859,8 @@ CPTexturedBackgroundWindowMask
|
||||
postNotificationName:CPWindowDidResignMainNotification
|
||||
object:self];
|
||||
|
||||
CPApp._mainWindow = nil;
|
||||
if (CPApp._mainWindow === self)
|
||||
CPApp._mainWindow = nil;
|
||||
}
|
||||
|
||||
- (void)_updateMainAndKeyWindows
|
||||
@@ -1866,9 +1868,6 @@ CPTexturedBackgroundWindowMask
|
||||
var allWindows = [CPApp orderedWindows],
|
||||
windowCount = [allWindows count];
|
||||
|
||||
if (!windowCount)
|
||||
return;
|
||||
|
||||
if ([self isKeyWindow])
|
||||
{
|
||||
var keyWindow = [CPApp keyWindow];
|
||||
@@ -1893,11 +1892,10 @@ CPTexturedBackgroundWindowMask
|
||||
}
|
||||
|
||||
if (![CPApp keyWindow])
|
||||
[keyWindow makeKeyWindow];
|
||||
[menuWindow makeKeyWindow];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ([self isMainWindow])
|
||||
{
|
||||
var mainWindow = [CPApp mainWindow];
|
||||
|
||||
Reference in New Issue
Block a user