diff options
| -rw-r--r-- | src/Fl_cocoa.mm | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 7e6ac9517..770e2acf7 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -566,7 +566,6 @@ static void do_timer(CFRunLoopTimerRef timer, void* data) contentRect:(NSRect)rect styleMask:(NSUInteger)windowStyle; - (Fl_Window *)getFl_Window; -- (BOOL)windowShouldClose:(FLWindow *)w; - (BOOL)containsGLsubwindow; - (void)setContainsGLsubwindow:(BOOL)contains; @end @@ -587,18 +586,6 @@ static void do_timer(CFRunLoopTimerRef timer, void* data) { return w; } -- (BOOL)windowShouldClose:(FLWindow *)fl -{ - fl_lock_function(); - Fl_Window *to_close = [fl getFl_Window]; - Fl::handle( FL_CLOSE, to_close ); // this might or might not close the window - Fl::do_widget_deletion(); - if (!Fl_X::first) return YES; - Fl_Window *l = Fl::first_window(); - while( l != NULL && l != to_close) l = Fl::next_window(l); - fl_unlock_function(); - return (l == NULL ? YES : NO); -} - (BOOL)containsGLsubwindow { return containsGLsubwindow; @@ -918,6 +905,7 @@ void fl_open_callback(void (*cb)(const char *)) { - (void)windowDidBecomeMain:(NSNotification *)notif; - (void)windowDidDeminiaturize:(NSNotification *)notif; - (void)windowDidMiniaturize:(NSNotification *)notif; +- (BOOL)windowShouldClose:(id)fl; - (void)anyWindowWillClose:(NSNotification *)notif; - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender; - (void)applicationDidBecomeActive:(NSNotification *)notify; @@ -1006,6 +994,14 @@ void fl_open_callback(void (*cb)(const char *)) { Fl::handle(FL_HIDE, window); fl_unlock_function(); } +- (BOOL)windowShouldClose:(id)fl +{ + fl_lock_function(); + Fl::handle( FL_CLOSE, [(FLWindow *)fl getFl_Window] ); // this might or might not close the window + fl_unlock_function(); + // the system doesn't need to send [fl close] because FLTK does it when needed + return NO; +} - (void)anyWindowWillClose:(NSNotification *)notif { fl_lock_function(); |
