diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-03-28 18:20:38 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-03-28 18:20:38 +0100 |
| commit | b4b98c5d57d5608178dfc63a6e56911d22fcfb24 (patch) | |
| tree | fc908901bec71921be7256fde5c0efd7ac980b80 /src | |
| parent | 5666ec0ff06bb339923a8b39d771886935bca9a1 (diff) | |
macOS: Avoid possible crash in makeMainWindow when another win is modal
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 2 |
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 |
