macOS: Avoid possible crash in makeMainWindow when another win is modal

This commit is contained in:
ManoloFLTK
2024-03-28 18:20:38 +01:00
parent 5666ec0ff0
commit b4b98c5d57
+1 -1
View File
@@ -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