|
|
commit b4b98c5d57d5608178dfc63a6e56911d22fcfb24
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Thu Mar 28 18:20:38 2024 +0100
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Thu Mar 28 18:20:38 2024 +0100
macOS: Avoid possible crash in makeMainWindow when another win is modal
src/Fl_cocoa.mm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git src/Fl_cocoa.mm src/Fl_cocoa.mm
index 718d047..3829188 100644
--- src/Fl_cocoa.mm
+++ 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
[ Direct Link to Message ] | |
|
| |