FLTK logo

[master] 429d71b - macOS: add Kludge to avoid delayed opening of the 1st window with fl_open_callback() .

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

[master] 429d71b - macOS: add Kludge to avoid delayed opening of the 1st window with fl_open_callback() . "ManoloFLTK" 09:17 Sep 25  
 
commit 429d71b0a885375987e0eb5779d12c7997d35e31
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Fri Sep 25 11:03:36 2026 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Fri Sep 25 11:03:36 2026 +0200

    macOS: add Kludge to avoid delayed opening of the 1st window with fl_open_callback() .

 src/Fl_cocoa.mm | 2 ++
 1 file changed, 2 insertions(+)

diff --git src/Fl_cocoa.mm src/Fl_cocoa.mm
index f0226ad..b40cece 100644
--- src/Fl_cocoa.mm
+++ src/Fl_cocoa.mm
@@ -1653,6 +1653,8 @@ static void attempt_close_all_windows() {
   if (open_cb) {
     fl_lock_function();
     (*open_cb)([filename UTF8String]);
+    // Kludge to avoid opening of the 1st window being delayed by several seconds
+    [[NSApp keyWindow] makeKeyAndOrderFront:self];
     Fl::flush(); // useful for AppleScript that does not break the event loop
     fl_unlock_function();
     return YES;
[ Direct Link to Message ]
 
     
[ Previous Message ] [ Next Message ]
 
 

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