[Mplayer-cvslog] CVS: main/libvo vo_quartz.c,1.15,1.16

Nicolas Plourde CVS syncmail at mplayerhq.hu
Thu Jul 15 19:36:06 CEST 2004


CVS change done by Nicolas Plourde CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv15916/libvo

Modified Files:
	vo_quartz.c 
Log Message:
Add Window Level Key, Can switch mode with T key

Index: vo_quartz.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_quartz.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- vo_quartz.c	9 Jul 2004 16:54:57 -0000	1.15
+++ vo_quartz.c	15 Jul 2004 17:36:01 -0000	1.16
@@ -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);
 			




More information about the MPlayer-cvslog mailing list