From 6ae79cdb91136e12f1d7757dca2299fb9b91cddb Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 11 Oct 2009 02:50:13 +0000 Subject: [PATCH] applicationShouldHandleReopen:hasVisibleWindows: hardcoded a check for the main window and prefs window; now check for a visible main window --- macosx/Controller.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index acd62c854..5ea1601d9 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -621,8 +621,14 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy - (BOOL) applicationShouldHandleReopen: (NSApplication *) app hasVisibleWindows: (BOOL) visibleWindows { - if (![fWindow isVisible] && ![[fPrefsController window] isVisible]) - [fWindow makeKeyAndOrderFront: nil]; + if (visibleWindows) + { + for (NSWindow * window in [NSApp windows]) + if ([window isVisible] && [window canBecomeMainWindow]) + return NO; + } + + [fWindow makeKeyAndOrderFront: nil]; return NO; }