summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2012-11-13 09:34:54 +0000
committerManolo Gouy <Manolo>2012-11-13 09:34:54 +0000
commit82878a722527b129f78b148965b05b124351bd80 (patch)
tree20edc74e685fb861feb3e5c7f10fbe70a40b1073
parente8f8434054b70557527f802b86ebba17bf95bc1e (diff)
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
-rw-r--r--src/Fl_cocoa.mm4
1 files changed, 3 insertions, 1 deletions
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 *)) {
<NSWindowDelegate, NSApplicationDelegate>
#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