FLTK logo

[master] eeb3e92 - Fix fullscreen window level corner cases on macOS - cont'd

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] eeb3e92 - Fix fullscreen window level corner cases on macOS - cont'd "ManoloFLTK" Dec 29, 2021  
 
commit eeb3e92eb29c4fdbcdc0b0276753c1d32210a8e5
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Wed Dec 29 17:18:12 2021 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Wed Dec 29 17:18:47 2021 +0100

     Fix fullscreen window level corner cases on macOS - cont'd
    
    See long discussion in PR#277 at
    https://github.com/fltk/fltk/pull/277

 src/Fl_cocoa.mm | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git src/Fl_cocoa.mm src/Fl_cocoa.mm
index f2df29a..ad4e21c 100644
--- src/Fl_cocoa.mm
+++ 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();
   }
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.