FLTK logo

[master] b4b98c5 - macOS: Avoid possible crash in makeMainWindow when another win is modal

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] b4b98c5 - macOS: Avoid possible crash in makeMainWindow when another win is modal "ManoloFLTK" 10:32 Mar 28  
 
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 ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.