summaryrefslogtreecommitdiffstats
path: root/libvo/osx_common.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-26 17:42:20 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-26 17:42:20 +0300
commit4785c2617ee9ac186464a55c1bfb13a5781ef041 (patch)
tree2424f18b68b2037bd4e290471821e9adae28b876 /libvo/osx_common.c
parent2732d5efbae3e0ee28bc6b70ceab1eb77e593216 (diff)
parent38abe6ff7a3810f8e01b6296570e92df1b12b09c (diff)
downloadmpv-4785c2617ee9ac186464a55c1bfb13a5781ef041.tar.bz2
mpv-4785c2617ee9ac186464a55c1bfb13a5781ef041.tar.xz
Merge svn changes up to r30967
Diffstat (limited to 'libvo/osx_common.c')
-rw-r--r--libvo/osx_common.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libvo/osx_common.c b/libvo/osx_common.c
index e82bc7aa6e..b3e39a62aa 100644
--- a/libvo/osx_common.c
+++ b/libvo/osx_common.c
@@ -19,6 +19,7 @@
// only to get keycode definitions from HIToolbox/Events.h
#include <Carbon/Carbon.h>
+#include "config.h"
#include "osx_common.h"
#include "old_vo_defines.h"
#include "video_out.h"
@@ -141,3 +142,25 @@ void config_movie_aspect(float config_aspect)
old_movie_aspect = config_aspect;
our_aspect_change = 0;
}
+
+/** This chunk of code is heavily based off SDL_macosx.m from SDL.
+ * The CPSEnableForegroundOperation that was here before is private
+ * and should not be used.
+ * Replaced by a call to the 10.3+ TransformProcessType.
+ */
+void osx_foreground_hack(void)
+{
+#if !defined (CONFIG_MACOSX_FINDER) || !defined (CONFIG_SDL)
+ ProcessSerialNumber myProc, frProc;
+ Boolean sameProc;
+
+ if (GetFrontProcess(&frProc) == noErr &&
+ GetCurrentProcess(&myProc) == noErr) {
+ if (SameProcess(&frProc, &myProc, &sameProc) == noErr && !sameProc) {
+ TransformProcessType(&myProc,
+ kProcessTransformToForegroundApplication);
+ }
+ SetFrontProcess(&myProc);
+ }
+#endif
+}