diff options
| author | Manolo Gouy <Manolo> | 2017-10-15 17:04:53 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-10-15 17:04:53 +0000 |
| commit | a8dbc90d992e13ee26f85effd21bfe8b9ba44e1a (patch) | |
| tree | e4659bedf3395b0d2661efc21be17d933b0970bf /src | |
| parent | 06ca7993a59b7b9fbcc2ce79eef8c1ca0a4c2735 (diff) | |
MacOS 10.13: fix problem with window made fullscreen by clicking on green window button.
With MacOS 10.13 "High Sierra", when a window is made fullscreen by clicking on the green window button,
the window hides the system menubar, but it's not possible to show the menubar by moving the pointer
to the very top of the window. This new way of starting apps fixes this problem.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12502 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 32193655e..5511ae167 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1460,6 +1460,7 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; @public TSMDocumentID currentDoc; } +- (void)applicationDidFinishLaunching:(NSNotification *)notification; - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender; - (void)applicationDidBecomeActive:(NSNotification *)notify; - (void)applicationDidChangeScreenParameters:(NSNotification *)aNotification; @@ -1471,6 +1472,10 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; - (void)open_cb:(void (*)(const char*))cb; @end @implementation FLAppDelegate +- (void)applicationDidFinishLaunching:(NSNotification *)notification +{ + if (fl_mac_os_version >= 101300) [NSApp stop:nil]; +} - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender { fl_lock_function(); @@ -1716,7 +1721,7 @@ void Fl_Cocoa_Screen_Driver::open_display_platform() { localPool = [[NSAutoreleasePool alloc] init]; // never released FLAppDelegate *delegate = (fl_mac_os_version < 100500 ? [FLAppDelegateBefore10_5 alloc] : [FLAppDelegate alloc]); [(NSApplication*)NSApp setDelegate:[delegate init]]; - if (need_new_nsapp) [NSApp finishLaunching]; + if (need_new_nsapp) (fl_mac_os_version >= 101300 ? [NSApp run] : [NSApp finishLaunching]); // empty the event queue but keep system events for drag&drop of files at launch NSEvent *ign_event; |
