summaryrefslogtreecommitdiffstats
path: root/libvo/vo_quartz.c
diff options
context:
space:
mode:
authornplourde <nplourde@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-07-15 17:36:01 +0000
committernplourde <nplourde@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-07-15 17:36:01 +0000
commit645e3bae61bcb0ce13f9fce8b950389a785f6693 (patch)
tree48bb6d2063f141f34efda7999f8671e42c9b2869 /libvo/vo_quartz.c
parentd37aa70a52d194e2eab42631bc01ba4ee3fbeea8 (diff)
downloadmpv-645e3bae61bcb0ce13f9fce8b950389a785f6693.tar.bz2
mpv-645e3bae61bcb0ce13f9fce8b950389a785f6693.tar.xz
Add Window Level Key, Can switch mode with T key
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12827 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_quartz.c')
-rw-r--r--libvo/vo_quartz.c49
1 files changed, 39 insertions, 10 deletions
diff --git a/libvo/vo_quartz.c b/libvo/vo_quartz.c
index d5f7cd4edf..75df7ab9b1 100644
--- a/libvo/vo_quartz.c
+++ b/libvo/vo_quartz.c
@@ -10,7 +10,6 @@
MPlayer Mac OSX Quartz video out module.
todo: -RGB32 color space support
- -rootwin
-screen overlay output
-while mouse button down event mplayer is locked, fix that
-(add sugestion here)
@@ -72,6 +71,14 @@ extern int vo_ontop;
extern int vo_fs; // user want fullscreen
static int vo_quartz_fs; // we are in fullscreen
+static int winLevel = 1;
+int levelList[] =
+{
+ kCGDesktopWindowLevelKey,
+ kCGNormalWindowLevelKey,
+ kCGScreenSaverWindowLevelKey
+};
+
static int int_pause = 0;
static float winAlpha = 1;
@@ -80,6 +87,7 @@ static int device_height;
static int device_id;
static WindowRef theWindow = NULL;
+static WindowGroupRef winGroup = NULL;
static Rect imgRect; // size of the original image (unscaled)
static Rect dstRect; // size of the displayed image (after scaling)
@@ -299,7 +307,10 @@ static void quartz_CreateWindow(uint32_t d_width, uint32_t d_height, WindowAttri
SetRect(&dstRect, 0, 0, d_width, d_height);
CreateNewWindow(kDocumentWindowClass, windowAttrs, &winRect, &theWindow);
-
+
+ CreateWindowGroup(0, &winGroup);
+ SetWindowGroup(theWindow, winGroup);
+
//Set window title
titleKey = CFSTR("MPlayer - The Movie Player");
windowTitle = CFCopyLocalizedString(titleKey, NULL);
@@ -897,10 +908,27 @@ void window_resized()
void window_ontop()
{
- if(vo_ontop)
- SetWindowClass( theWindow, kUtilityWindowClass);
- else
- SetWindowClass( theWindow, kDocumentWindowClass);
+ //Cycle between level
+ winLevel++;
+ if(winLevel>2)
+ winLevel = 0;
+
+ //hide menu bar and mouse cursor if in fullscreen and quiting wallpaper mode
+ if(vo_fs)
+ {
+ if(winLevel != 0)
+ {
+ HideMenuBar();
+ HideCursor();
+ }
+ else
+ {
+ ShowMenuBar();
+ ShowfCursor();
+ }
+ }
+
+ SetWindowGroupLevel(winGroup, CGWindowLevelForKey(levelList[winLevel]));
}
void window_fullscreen()
@@ -908,15 +936,16 @@ void window_fullscreen()
//go fullscreen
if(vo_fs)
{
- HideMenuBar();
+ if(winLevel != 0)
+ {
+ HideMenuBar();
+ HideCursor();
+ }
//save old window size
if (!vo_quartz_fs)
GetWindowPortBounds(theWindow, &oldWinRect);
- //hide mouse cursor
- HideCursor();
-
//go fullscreen
//ChangeWindowAttributes(theWindow, 0, kWindowResizableAttribute);