mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
cocoa: fix macOS 10.12 deprecation warnings
Add #defines to allow older versions of macOS to use the new constant names.
This commit is contained in:
parent
479b95205f
commit
88a4d06735
2 changed files with 14 additions and 3 deletions
|
@ -34,6 +34,10 @@ G_DEFINE_TYPE (GstGLDisplayCocoa, gst_gl_display_cocoa, GST_TYPE_GL_DISPLAY);
|
||||||
static void gst_gl_display_cocoa_finalize (GObject * object);
|
static void gst_gl_display_cocoa_finalize (GObject * object);
|
||||||
static guintptr gst_gl_display_cocoa_get_handle (GstGLDisplay * display);
|
static guintptr gst_gl_display_cocoa_get_handle (GstGLDisplay * display);
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||||
|
#define NSEventMaskAny NSAnyEventMask
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define this if the GLib patch from
|
/* Define this if the GLib patch from
|
||||||
* https://bugzilla.gnome.org/show_bug.cgi?id=741450
|
* https://bugzilla.gnome.org/show_bug.cgi?id=741450
|
||||||
* is used
|
* is used
|
||||||
|
@ -56,7 +60,7 @@ gst_gl_display_cocoa_nsapp_iteration (gpointer data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while ((event = ([NSApp nextEventMatchingMask:NSAnyEventMask
|
while ((event = ([NSApp nextEventMatchingMask:NSEventMaskAny
|
||||||
untilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]
|
untilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]
|
||||||
inMode:NSDefaultRunLoopMode dequeue:YES])) != nil) {
|
inMode:NSDefaultRunLoopMode dequeue:YES])) != nil) {
|
||||||
[NSApp sendEvent:event];
|
[NSApp sendEvent:event];
|
||||||
|
|
|
@ -28,6 +28,13 @@
|
||||||
|
|
||||||
#include "gstgl_cocoa_private.h"
|
#include "gstgl_cocoa_private.h"
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||||
|
#define NSWindowStyleMaskTitled NSTitledWindowMask
|
||||||
|
#define NSWindowStyleMaskClosable NSClosableWindowMask
|
||||||
|
#define NSWindowStyleMaskResizable NSResizableWindowMask
|
||||||
|
#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
|
||||||
|
#endif
|
||||||
|
|
||||||
/* =============================================================*/
|
/* =============================================================*/
|
||||||
/* */
|
/* */
|
||||||
/* GstGLNSWindow declaration */
|
/* GstGLNSWindow declaration */
|
||||||
|
@ -175,8 +182,8 @@ gst_gl_window_cocoa_create_window (GstGLWindowCocoa *window_cocoa)
|
||||||
gst_object_unref (context);
|
gst_object_unref (context);
|
||||||
|
|
||||||
internal_win_id = [[GstGLNSWindow alloc] initWithContentRect:rect styleMask:
|
internal_win_id = [[GstGLNSWindow alloc] initWithContentRect:rect styleMask:
|
||||||
(NSTitledWindowMask | NSClosableWindowMask |
|
(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
|
||||||
NSResizableWindowMask | NSMiniaturizableWindowMask)
|
NSWindowStyleMaskResizable | NSWindowStyleMaskMiniaturizable)
|
||||||
backing: NSBackingStoreBuffered defer: NO screen: nil gstWin: window_cocoa];
|
backing: NSBackingStoreBuffered defer: NO screen: nil gstWin: window_cocoa];
|
||||||
|
|
||||||
priv->internal_win_id = (__bridge_retained gpointer)internal_win_id;
|
priv->internal_win_id = (__bridge_retained gpointer)internal_win_id;
|
||||||
|
|
Loading…
Reference in a new issue