summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-03-28 18:20:38 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-03-28 18:20:38 +0100
commitb4b98c5d57d5608178dfc63a6e56911d22fcfb24 (patch)
treefc908901bec71921be7256fde5c0efd7ac980b80 /src
parent5666ec0ff06bb339923a8b39d771886935bca9a1 (diff)
macOS: Avoid possible crash in makeMainWindow when another win is modal
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 718d04742..3829188a9 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -4544,7 +4544,7 @@ int Fl_Cocoa_Window_Driver::decorated_h()
void Fl_Cocoa_Window_Driver::draw_titlebar_to_context(CGContextRef gc, int w, int h)
{
FLWindow *nswin = fl_xid(pWindow);
- [nswin makeMainWindow];
+ if ([nswin canBecomeMainWindow]) [nswin makeMainWindow];
[NSApp nextEventMatchingMask:NSEventMaskAny untilDate:nil inMode:NSDefaultRunLoopMode dequeue:NO];
CGImageRef img;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5