changeset 15881:ab6d02448e57

auto hide menubar and cursor in fullscreen
author nplourde
date Fri, 01 Jul 2005 17:21:13 +0000
parents 01b42f2f2894
children 77aa290c726a
files libvo/vo_quartz.c
diffstat 1 files changed, 34 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_quartz.c	Fri Jul 01 11:26:38 2005 +0000
+++ b/libvo/vo_quartz.c	Fri Jul 01 17:21:13 2005 +0000
@@ -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);