gl/cocoa: Fix for building on Mac OS X 10.10
authorBrion Vibber <brion@pobox.com>
Sat, 18 Oct 2014 04:26:52 +0000 (21:26 -0700)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:48 +0000 (19:31 +0000)
Using NSApp directly seems to confuse something, as the compiler
was expecting an id<NSFileManagerDelegate>. Switched to using
[NSApplication sharedApplication], and specified the delegate
protocol on the window class as well.

https://bugzilla.gnome.org/show_bug.cgi?id=738740

gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m

index 27b9c3ad49e6b3dbbb0a73349b43d7e3d74529b3..b3ac37a501737490e6b769f4f44d83be0854d140 100644 (file)
@@ -33,7 +33,7 @@
 /*                                                              */
 /* =============================================================*/
 
-@interface GstGLNSWindow: NSWindow {
+@interface GstGLNSWindow: NSWindow <NSApplicationDelegate> {
   BOOL m_isClosed;
   GstGLWindowCocoa *window_cocoa;
 }
@@ -138,7 +138,7 @@ gst_gl_window_cocoa_create_window (GstGLWindowCocoa *window_cocoa, NSRect rect)
 
       GST_DEBUG ("NSWindow id: %"G_GUINTPTR_FORMAT, (guintptr) priv->internal_win_id);
 
-      [NSApp setDelegate: priv->internal_win_id];
+      [[NSApplication sharedApplication] setDelegate: priv->internal_win_id];
 
   return TRUE;
 }