diff options
| author | Manolo Gouy <Manolo> | 2011-10-22 15:12:57 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2011-10-22 15:12:57 +0000 |
| commit | 81fcaed45669ec06a7302b427eacbd550b2ee7b2 (patch) | |
| tree | 23207657e89008c8faba69585dda55feebb9f42a /src | |
| parent | babac0847488e0c63c5c496af92f988f7aadaf00 (diff) | |
Mac OS: the procedure used to restore visible focus to a window after using an Fl_Native_File_Chooser
window failed under OS X 10.7. It's replaced by a simpler, OS version-independent procedure.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9144 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -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; } } |
