summaryrefslogtreecommitdiffstats
path: root/libvo/vo_quartz.c
diff options
context:
space:
mode:
authornplourde <nplourde@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-07-09 16:54:57 +0000
committernplourde <nplourde@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-07-09 16:54:57 +0000
commit55bdd70dde50feb8e9af5694c1fb506e7c6ef3e5 (patch)
treee256ada70564dfa61a9fbd2b1857195a949cb1dd /libvo/vo_quartz.c
parent70b6b14e508d128cd5f3a1dca776ecec11ed382d (diff)
downloadmpv-55bdd70dde50feb8e9af5694c1fb506e7c6ef3e5.tar.bz2
mpv-55bdd70dde50feb8e9af5694c1fb506e7c6ef3e5.tar.xz
make mplayer capable of being in the foreground by Dan Christiansen
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12786 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_quartz.c')
-rw-r--r--libvo/vo_quartz.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/libvo/vo_quartz.c b/libvo/vo_quartz.c
index 6a78aeb381..d5f7cd4edf 100644
--- a/libvo/vo_quartz.c
+++ b/libvo/vo_quartz.c
@@ -9,8 +9,7 @@
MPlayer Mac OSX Quartz video out module.
- todo: -'plist' resource
- -RGB32 color space support
+ todo: -RGB32 color space support
-rootwin
-screen overlay output
-while mouse button down event mplayer is locked, fix that
@@ -302,7 +301,7 @@ static void quartz_CreateWindow(uint32_t d_width, uint32_t d_height, WindowAttri
CreateNewWindow(kDocumentWindowClass, windowAttrs, &winRect, &theWindow);
//Set window title
- titleKey = CFSTR("MPlayer");
+ titleKey = CFSTR("MPlayer - The Movie Player");
windowTitle = CFCopyLocalizedString(titleKey, NULL);
result = SetWindowTitleWithCFString(theWindow, windowTitle);
CFRelease(titleKey);
@@ -717,6 +716,26 @@ static uint32_t preinit(const char *arg)
else if (parse_pos[0]) parse_err = 1;
}
}
+
+ //this chunk of code is heavily based off SDL_macosx.m from SDL
+ //it uses an Apple private function to request foreground operation
+
+ void CPSEnableForegroundOperation(ProcessSerialNumber* psn);
+ ProcessSerialNumber myProc, frProc;
+ Boolean sameProc;
+
+ if (GetFrontProcess(&frProc) == noErr)
+ {
+ if (GetCurrentProcess(&myProc) == noErr)
+ {
+ if (SameProcess(&frProc, &myProc, &sameProc) == noErr && !sameProc)
+ {
+ CPSEnableForegroundOperation(&myProc);
+ }
+ SetFrontProcess(&myProc);
+ }
+ }
+
return 0;
}