[MPlayer-cvslog] CVS: main/libvo vo_quartz.c,1.49,1.50

Nicolas Plourde CVS syncmail at mplayerhq.hu
Fri Jul 1 19:21:16 CEST 2005


CVS change done by Nicolas Plourde CVS

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

Modified Files:
	vo_quartz.c 
Log Message:
auto hide menubar and cursor in fullscreen

Index: vo_quartz.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_quartz.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- vo_quartz.c	14 Jun 2005 12:48:39 -0000	1.49
+++ vo_quartz.c	1 Jul 2005 17:21:13 -0000	1.50
@@ -87,6 +87,7 @@
 
 static int int_pause = 0;
 static float winAlpha = 1;
+static int mouseHide = 0;
 
 static int device_width;
 static int device_height;
@@ -282,6 +283,16 @@
 
 		switch (kind)
 		{
+			case kEventMouseMoved:
+			{
+				if(vo_quartz_fs)
+				{
+					ShowCursor();
+					mouseHide = FALSE;
+				}
+			}
+			break;
+			
 			case kEventMouseWheelMoved:
 			{
 				int wheel;
@@ -564,6 +575,7 @@
     };
 
 	const EventTypeSpec mouse_events[] = {
+		{ kEventClassMouse, kEventMouseMoved },
 		{ kEventClassMouse, kEventMouseWheelMoved },
 		{ kEventClassMouse, kEventMouseDown },
 		{ kEventClassMouse, kEventMouseUp },
@@ -956,6 +968,24 @@
 		//CGContextRestoreGState( context );
 		CGContextFlush (context);
 	}
+
+	//auto hide mouse cursor and futur on-screen control?
+	if(vo_quartz_fs && !mouseHide)
+	{
+		DateTimeRec d;
+		unsigned long curTime;
+		static unsigned long lastTime = 0;
+		
+		GetTime(&d);
+		DateToSeconds( &d, &curTime);
+	
+		if( ((curTime - lastTime) >= 5) || (lastTime == 0) )
+		{
+			HideCursor();
+			mouseHide = TRUE;
+			lastTime = curTime;
+		}
+	}
 }
 
 static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y)
@@ -1318,8 +1348,9 @@
 		{
 			if(device_id == 0)
 			{
-				HideMenuBar();
+				SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
 				HideCursor();
+				mouseHide = 1;
 			}
 			
 			if(fs_res_x != 0 || fs_res_y != 0)
@@ -1362,10 +1393,11 @@
 			device_height = deviceRect.bottom;
 			restoreState = NULL;
 		}
-		ShowMenuBar();
+		SetSystemUIMode( kUIModeNormal, NULL);
 
 		//show mouse cursor
 		ShowCursor();
+		mouseHide = 0;
 		
 		//revert window to previous setting
 		ChangeWindowAttributes(theWindow, 0, kWindowNoShadowAttribute);




More information about the MPlayer-cvslog mailing list