# HG changeset patch # User nplourde # Date 1089912961 0 # Node ID fb55f94f300186a24423957ac292a50d410f34ce # Parent 388e2fe5107e3beaa877c0a992ecc7d03f9b1e1b Add Window Level Key, Can switch mode with T key diff -r 388e2fe5107e -r fb55f94f3001 libvo/vo_quartz.c --- a/libvo/vo_quartz.c Thu Jul 15 16:37:54 2004 +0000 +++ b/libvo/vo_quartz.c Thu Jul 15 17:36:01 2004 +0000 @@ -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_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_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 @@ 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_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 @@ //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);