From 82878a722527b129f78b148965b05b124351bd80 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 13 Nov 2012 09:34:54 +0000 Subject: Fix a Mac OS bug appeared with OS X 10.8: when a file is dragged on the application icon, a delay of several seconds occur until the first application window opens (cont'd). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9716 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index f1f3100a6..9255340f1 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -982,6 +982,7 @@ void fl_open_callback(void (*cb)(const char *)) { #endif { + BOOL seen_open_file; } - (void)windowDidMove:(NSNotification *)notif; - (void)windowDidResize:(NSNotification *)notif; @@ -1256,6 +1257,7 @@ void fl_open_callback(void (*cb)(const char *)) { } - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename { + seen_open_file = YES; if (open_cb) { fl_lock_function(); (*open_cb)([filename UTF8String]); @@ -1268,7 +1270,7 @@ void fl_open_callback(void (*cb)(const char *)) { { // without this, the opening of the 1st window is delayed by several seconds // under Mac OS 10.8 when a file is dragged on the application icon - if (fl_mac_os_version >= 100800) [[NSApp mainWindow] orderFront:nil]; + if (fl_mac_os_version >= 100800 && seen_open_file) [[NSApp mainWindow] orderFront:self]; } @end -- cgit v1.2.3