FLTK logo

[branch-1.3] e0626e0 - Attempt to fix issue#287 about fullscreen mode. The fix is to reproduce what is in main branch 1.4

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 ]

[branch-1.3] e0626e0 - Attempt to fix issue#287 about fullscreen mode. The fix is to reproduce what is in main branch 1.4 "ManoloFLTK" Nov 04, 2021  
 
commit e0626e025ef2bc70c29803ecf2a3a4e4b3eb19eb
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Thu Nov 4 15:51:48 2021 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Thu Nov 4 15:51:48 2021 +0100

    Attempt to fix issue#287 about fullscreen mode.
    The fix is to reproduce what is in main branch 1.4

 src/Fl_cocoa.mm | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git src/Fl_cocoa.mm src/Fl_cocoa.mm
index 444486a..42438f1 100644
--- src/Fl_cocoa.mm
+++ src/Fl_cocoa.mm
@@ -3113,22 +3113,25 @@ void Fl_Window::fullscreen_x() {
 
 void Fl_Window::fullscreen_off_x(int X, int Y, int W, int H) {
   _clear_fullscreen();
-  if (fl_mac_os_version < 101000) {
-    hide();
-    resize(X, Y, W, H);
-    show();
-  } else {
-    NSUInteger winstyle = (border() ?
-                           (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask) : NSBorderlessWindowMask);
-    if (!modal()) winstyle |= NSMiniaturizableWindowMask;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+  if (fl_mac_os_version >= 100600) {
     NSInteger level = NSNormalWindowLevel;
     if (modal()) level = modal_window_level();
     else if (non_modal()) level = non_modal_window_level();
+    [i->xid orderOut:nil];
     [i->xid setLevel:level];
-    resize(X, Y, W, H);
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+    NSUInteger winstyle = (border() ?
+                           (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask) : NSBorderlessWindowMask);
+    if (!modal()) winstyle |= NSMiniaturizableWindowMask;
     [i->xid setStyleMask:winstyle]; //10.6
+    resize(X, Y, W, H);
+    [i->xid orderFront:nil];
+  } else
 #endif
+  {
+    hide();
+    resize(X, Y, W, H);
+    show();
   }
   Fl::handle(FL_FULLSCREEN, this);
 }
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'.