]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/cocoa/cocoawindow.m
Remove an unused global variable
[libs/gui.git] / source / graphics / cocoa / cocoawindow.m
index 9ed5133162d3c6ff791a62521b67624f38eb3550..5b63e8c678e10daed993f181f82207dfd3a3186b 100644 (file)
@@ -5,7 +5,7 @@
 
 @interface WindowDelegate: NSObject <NSWindowDelegate>
 
-- (void)windowWillClose:(NSNotification *)notification;
+- (BOOL)windowShouldClose:(id)sender;
 
 @end
 
@@ -18,7 +18,6 @@ struct _CocoaWindow
 };
 
 CFMutableDictionaryRef windows = NULL;
-CFMutableArrayRef event_queue = NULL;
 
 CocoaWindow *create_window(CocoaDisplay *display, unsigned width, unsigned height, bool fullscreen, bool resizable)
 {
@@ -96,16 +95,18 @@ void hide_window(CocoaWindow *window)
 
 @implementation WindowDelegate
 
-- (void)windowWillClose:(NSNotification *)notification
+- (BOOL)windowShouldClose:(id)sender
 {
-       CocoaWindow *window = lookup_window((NSWindow *)[notification object]);
+       CocoaWindow *window = lookup_window((NSWindow *)sender);
        if(window)
        {
                CocoaEvent event;
                event.any.type = WINDOW_CLOSED;
                event.any.window = window;
                queue_event(window->display, &event);
+               return NO;
        }
+       return YES;
 }
 
 @end