diff options
author | ulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-30 00:03:01 +0000 |
---|---|---|
committer | ulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-30 00:03:01 +0000 |
commit | c772daeb0475808ee5c56fd3a789650425d92452 (patch) | |
tree | 6a4599f6f7cbd08b2d62b2f958531644f09d5ab3 /libvo/vo_macosx.m | |
parent | 58a471c45e3a4fa1693406cd6148c317881cf880 (diff) | |
download | mpv-c772daeb0475808ee5c56fd3a789650425d92452.tar.bz2 mpv-c772daeb0475808ee5c56fd3a789650425d92452.tar.xz |
Fix play window not get actived problem on Leopard.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25207 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_macosx.m')
-rw-r--r-- | libvo/vo_macosx.m | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m index 53cf6e233d..0062576241 100644 --- a/libvo/vo_macosx.m +++ b/libvo/vo_macosx.m @@ -63,6 +63,8 @@ static float old_movie_aspect; static float winAlpha = 1; static int int_pause = 0; +static BOOL isLeopardOrLater; + static vo_info_t info = { "Mac OSX Core Video", @@ -301,6 +303,7 @@ static int preinit(const char *arg) NSApplicationLoad(); autoreleasepool = [[NSAutoreleasePool alloc] init]; NSApp = [NSApplication sharedApplication]; + isLeopardOrLater = floor(NSAppKitVersionNumber) > 824; if(!shared_buffer) { @@ -878,6 +881,16 @@ static int control(uint32_t request, void *data, ...) if (event == nil) return; [NSApp sendEvent:event]; + // Without SDL's bootstrap code (include SDL.h in mplayer.c), + // on Leopard, we got trouble to get the play window auto focused + // when app is actived. Following code fix this problem. +#ifndef HAVE_SDL + if (isLeopardOrLater && [event type] == NSAppKitDefined + && [event subtype] == NSApplicationActivatedEventType) { + [window makeMainWindow]; + [window makeKeyAndOrderFront:mpGLView]; + } +#endif } /* |