Author: manolo
Date: 2011-10-22 08:12:57 -0700 (Sat, 22 Oct 2011)
New Revision: 9144
Log:
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.
Modified:
branches/branch-1.3/src/Fl_Native_File_Chooser_MAC.mm
branches/branch-1.3/src/Fl_cocoa.mm
Modified: branches/branch-1.3/src/Fl_Native_File_Chooser_MAC.mm
===================================================================
--- branches/branch-1.3/src/Fl_Native_File_Chooser_MAC.mm 2011-10-20
11:56:45 UTC (rev 9143)
+++ branches/branch-1.3/src/Fl_Native_File_Chooser_MAC.mm 2011-10-22
15:12:57 UTC (rev 9144)
@@ -532,6 +532,7 @@
}
// SHOW THE DIALOG
+ NSWindow *key = [NSApp keyWindow];
if ( [(NSSavePanel*)_panel isKindOfClass:[NSOpenPanel class]] ) {
NSPopUpButton *popup = nil;
if (_filt_total) {
@@ -609,6 +610,7 @@
[preset release];
if ( retval == NSOKButton ) get_saveas_basename();
}
+ [key makeKeyWindow];
[localPool release];
return (retval == NSOKButton ? 0 : 1);
}
Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2011-10-20 11:56:45 UTC (rev 9143)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-10-22 15:12:57 UTC (rev 9144)
@@ -932,7 +932,6 @@
- (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 @@
}
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 @@
}
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;
}
}
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit