# HG changeset patch # User nplourde # Date 1120238473 0 # Node ID ab6d02448e57cff24e079b1ec5fd01d74807e5a5 # Parent 01b42f2f2894d02144df4e588b1d876f21f82ce2 auto hide menubar and cursor in fullscreen diff -r 01b42f2f2894 -r ab6d02448e57 libvo/vo_quartz.c --- 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);