Fix crash in test/fullscreen under macOS

Operations that produced the crash: 1. press "FullScreen" or green button; 2. press "All Screens"
This commit is contained in:
ManoloFLTK
2025-01-27 18:54:29 +01:00
parent 5c5a12d502
commit bfdae6d151
+12
View File
@@ -3133,6 +3133,18 @@ void Fl_Window::fullscreen_x() {
[i->xid toggleFullScreen:nil];
# endif
} else if (fl_mac_os_version >= 100600) {
# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (fl_mac_os_version >= 100700 && (i->xid.styleMask & NSWindowStyleMaskFullScreen)) {
[i->xid toggleFullScreen:nil];
if (no_fullscreen_w == 0) {
no_fullscreen_x = x();
no_fullscreen_y = y();
no_fullscreen_w = w();
no_fullscreen_h = h();
}
_set_fullscreen();
}
#endif
[i->xid setStyleMask:NSBorderlessWindowMask]; // 10.6
if ([i->xid isKeyWindow]) {
if ([i->xid level] != NSStatusWindowLevel) {