the quick look window shouldn't zoom onto a missing window when quitting

This commit is contained in:
Mitchell Livingston 2009-09-11 03:15:04 +00:00
parent 149f8c90d8
commit 6faa821dac
2 changed files with 13 additions and 2 deletions

View File

@ -661,7 +661,18 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
//remember window states and close all windows
[fDefaults setBool: [[fInfoController window] isVisible] forKey: @"InfoVisible"];
[[NSApp windows] makeObjectsPerformSelector: @selector(close)];
const BOOL quickLookOpen = [NSApp isOnSnowLeopardOrBetter] && [QLPreviewPanel sharedPreviewPanelExists]
&& [[QLPreviewPanel sharedPreviewPanel] isVisible];
for (NSWindow * window in [NSApp windows])
{
if (!quickLookOpen || window != [QLPreviewPanel sharedPreviewPanel]) //hide quicklook window last to avoid animation
[window orderOut: nil];
}
[[QLPreviewPanel sharedPreviewPanel] updateController];
[[QLPreviewPanel sharedPreviewPanel] orderOut: nil];
[self showStatusBar: NO animate: NO];
[self showFilterBar: NO animate: NO];

View File

@ -501,7 +501,7 @@
if (firstChar == 'f' && [event modifierFlags] & NSAlternateKeyMask && [event modifierFlags] & NSCommandKeyMask)
[fController focusFilterField];
else if (firstChar == ' ')
[fController toggleQuickLook: self];
[fController toggleQuickLook: nil];
else
[super keyDown: event];
}