diff --git a/tests/examples/avsamplesink/main.m b/tests/examples/avsamplesink/main.m index 6bce53b7b5..fbffc04b22 100644 --- a/tests/examples/avsamplesink/main.m +++ b/tests/examples/avsamplesink/main.m @@ -25,6 +25,10 @@ #include #include +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 +#define NSWindowStyleMaskBorderless NSBorderlessWindowMask +#endif + static NSRunLoop *loop; static int quit = 0; @@ -97,7 +101,7 @@ gint main (gint argc, gchar *argv[]) g_object_get (videosink, "layer", &layer, NULL); NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect (0, 0, 320, 240) - styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; + styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]; [window setOpaque:NO]; [window.contentView setWantsLayer:YES]; diff --git a/tests/examples/gl/cocoa/cocoa-videooverlay.m b/tests/examples/gl/cocoa/cocoa-videooverlay.m index cc209d83d8..75814a71f9 100755 --- a/tests/examples/gl/cocoa/cocoa-videooverlay.m +++ b/tests/examples/gl/cocoa/cocoa-videooverlay.m @@ -22,6 +22,14 @@ #include #include +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 +#define NSEventMaskAny NSAnyEventMask +#define NSWindowStyleMaskTitled NSTitledWindowMask +#define NSWindowStyleMaskClosable NSClosableWindowMask +#define NSWindowStyleMaskResizable NSResizableWindowMask +#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask +#endif + /* ============================================================= */ /* */ /* MainWindow */ @@ -48,7 +56,8 @@ m_isClosed = FALSE; self = [super initWithContentRect: contentRect - styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask) + styleMask: (NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | + NSWindowStyleMaskResizable | NSWindowStyleMaskMiniaturizable) backing: NSBackingStoreBuffered defer: NO screen: nil]; [self setReleasedWhenClosed:NO]; @@ -211,7 +220,7 @@ int main(int argc, char **argv) [window orderFront:window]; while (![window isClosed]) { - NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask + NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate dateWithTimeIntervalSinceNow:1] inMode:NSDefaultRunLoopMode dequeue:YES]; if (event)