diff options
| -rw-r--r-- | src/Fl_Native_File_Chooser_MAC.mm | 2 | ||||
| -rw-r--r-- | src/Fl_cocoa.mm | 18 |
2 files changed, 2 insertions, 18 deletions
diff --git a/src/Fl_Native_File_Chooser_MAC.mm b/src/Fl_Native_File_Chooser_MAC.mm index 2aa48c2bf..764e4261c 100644 --- a/src/Fl_Native_File_Chooser_MAC.mm +++ b/src/Fl_Native_File_Chooser_MAC.mm @@ -532,6 +532,7 @@ int Fl_Native_File_Chooser::post() { } // SHOW THE DIALOG + NSWindow *key = [NSApp keyWindow]; if ( [(NSSavePanel*)_panel isKindOfClass:[NSOpenPanel class]] ) { NSPopUpButton *popup = nil; if (_filt_total) { @@ -609,6 +610,7 @@ int Fl_Native_File_Chooser::post() { [preset release]; if ( retval == NSOKButton ) get_saveas_basename(); } + [key makeKeyWindow]; [localPool release]; return (retval == NSOKButton ? 0 : 1); } diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 8a14eaf8e..cf4902a0d 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -932,7 +932,6 @@ void fl_open_callback(void (*cb)(const char *)) { - (void)windowDidDeminiaturize:(NSNotification *)notif; - (void)windowDidMiniaturize:(NSNotification *)notif; - (void)windowWillClose:(NSNotification *)notif; -- (void)anywindowwillclosenotif:(NSNotification *)notif; - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender; - (void)applicationDidBecomeActive:(NSNotification *)notify; - (void)applicationDidChangeScreenParameters:(NSNotification *)aNotification; @@ -1036,18 +1035,6 @@ void fl_open_callback(void (*cb)(const char *)) { } fl_unlock_function(); } -- (void)anywindowwillclosenotif:(NSNotification *)notif -{ - // necessary so that after closing a non-FLTK window (e.g., Fl_Native_File_Chooser) - // the front window turns key again - NSWindow *closing = (NSWindow*)[notif object]; - if ([closing isMemberOfClass:[FLWindow class]]) return; - NSWindow *nsk = [NSApp keyWindow]; - NSWindow *nsm = [NSApp mainWindow]; - if ([nsm isMemberOfClass:[FLWindow class]] && nsk == nil) { - [nsm makeKeyAndOrderFront:nil]; - } -} - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender { fl_lock_function(); @@ -1304,11 +1291,6 @@ void fl_open_display() { } if (![NSApp servicesMenu]) createAppleMenu(); fl_system_menu = [NSApp mainMenu]; - - [[NSNotificationCenter defaultCenter] addObserver:[NSApp delegate] - selector:@selector(anywindowwillclosenotif:) - name:NSWindowWillCloseNotification - object:nil]; main_screen_height = [[[NSScreen screens] objectAtIndex:0] frame].size.height; } } |
