summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-12-29 17:18:12 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-12-29 17:18:47 +0100
commiteeb3e92eb29c4fdbcdc0b0276753c1d32210a8e5 (patch)
tree4dc8151db8277d813ebcc312970ecdb1800da419 /src
parentc8bb2a35850be7c6eaec5ad5a2936a77f7913de2 (diff)
Fix fullscreen window level corner cases on macOS - cont'd
See long discussion in PR#277 at https://github.com/fltk/fltk/pull/277
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index f2df29a4a..ad4e21c8f 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -831,8 +831,8 @@ static NSInteger modal_window_level(void)
NSInteger level;
level = max_normal_window_level();
- if (level < NSModalPanelWindowLevel)
- return NSModalPanelWindowLevel;
+ if (level < NSStatusWindowLevel)
+ return NSStatusWindowLevel;
// Need some room for non-modal windows
level += 2;
@@ -1285,9 +1285,8 @@ static FLWindowDelegate *flwindowdelegate_instance = nil;
FLWindow *nsw = (FLWindow*)[notif object];
Fl_Window *window = [nsw getFl_Window];
/* Fullscreen windows obscure all other windows so we need to return
- to a "normal" level when the user switches to another window,
- unless this other window is above the fullscreen window */
- if (window->fullscreen_active() && [NSApp keyWindow] && [[NSApp keyWindow] level] <= [nsw level]) {
+ to a "normal" level when the user switches to another window or another app */
+ if (window->fullscreen_active()) {
[nsw setLevel:NSNormalWindowLevel];
fixup_window_levels();
}