Author: manolo
Date: 2012-11-13 01:34:54 -0800 (Tue, 13 Nov 2012)
New Revision: 9716
Log:
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).

Modified:
   branches/branch-1.3/src/Fl_cocoa.mm

Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2012-11-12 15:57:39 UTC (rev 9715)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2012-11-13 09:34:54 UTC (rev 9716)
@@ -982,6 +982,7 @@
 <NSWindowDelegate, NSApplicationDelegate>
 #endif
 {
+  BOOL seen_open_file;
 }
 - (void)windowDidMove:(NSNotification *)notif;
 - (void)windowDidResize:(NSNotification *)notif;
@@ -1256,6 +1257,7 @@
 }
 - (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 @@
 {
   // 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
 

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to