diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-03-11 15:18:59 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-03-11 15:18:59 +0100 |
| commit | 483729f4f8f00b099611b1513e3c37da19da9bee (patch) | |
| tree | 098490fb905d423df0fc4e45be690e0c8e8947e5 | |
| parent | 20e8da9dfd9bd10a6531369b1f675a2f7de0a2e5 (diff) | |
macOS: Fullscreen window loses sys menu bar if 2nd window is opened (#924)
| -rw-r--r-- | src/Fl_MacOS_Sys_Menu_Bar.mm | 2 | ||||
| -rw-r--r-- | src/Fl_cocoa.mm | 11 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/Fl_MacOS_Sys_Menu_Bar.mm b/src/Fl_MacOS_Sys_Menu_Bar.mm index 1caabcaaa..1240dc837 100644 --- a/src/Fl_MacOS_Sys_Menu_Bar.mm +++ b/src/Fl_MacOS_Sys_Menu_Bar.mm @@ -569,8 +569,6 @@ static void minimize_win_cb(Fl_Widget *, void *data) static void window_menu_cb(Fl_Widget *, void *data) { - Fl_Window *top = Fl::first_window(); - if (top && top->fullscreen_active()) return; if (data) ((Fl_Window*)data)->show(); } diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index a469ed49a..718d04742 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1378,7 +1378,7 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; FLWindow *nsw = (FLWindow*)[notif object]; Fl_Window *w = [nsw getFl_Window]; /* Restore previous fullscreen level */ - if (w->fullscreen_active()) { + if (w->fullscreen_active() && fl_mac_os_version < 100700) { [nsw setLevel:NSStatusWindowLevel]; fixup_window_levels(); } @@ -3053,7 +3053,7 @@ void Fl_Cocoa_Window_Driver::makeWindow() changed_resolution(false); NSRect crect; - if (w->fullscreen_active()) { + if (w->fullscreen_active() && fl_mac_os_version < 100700) { int top, bottom, left, right; int sx, sy, sw, sh, X, Y, W, H; @@ -3198,6 +3198,9 @@ void Fl_Cocoa_Window_Driver::makeWindow() } else { // a top-level window if ([cw canBecomeKeyWindow]) [cw makeKeyAndOrderFront:nil]; else [cw orderFront:nil]; + if (w->fullscreen_active() && fl_mac_os_version >= 100700) { + [cw toggleFullScreen:nil]; + } } if (fl_sys_menu_bar && Fl_MacOS_Sys_Menu_Bar_Driver::window_menu_style() && !w->parent() && w->border() && !w->modal() && !w->non_modal()) { @@ -3996,8 +3999,6 @@ static PrintWithTitlebarItem *print_with_titlebar_item = NULL; } - (void)showPanel { - Fl_Window *top = Fl::first_window(); - if (top && top->fullscreen_active()) return; NSDictionary *options; options = [NSDictionary dictionaryWithObjectsAndKeys: [[[NSAttributedString alloc] @@ -4008,8 +4009,6 @@ static PrintWithTitlebarItem *print_with_titlebar_item = NULL; } - (void)printPanel { - Fl_Window *top = Fl::first_window(); - if (top && top->fullscreen_active()) return; bool grab_decoration = ([print_with_titlebar_item state] == NSControlStateValueOn); fl_lock_function(); fl_print_or_copy_window(Fl::first_window(), grab_decoration, 1); |
