summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_macosx.h4
-rw-r--r--libvo/vo_macosx.m17
2 files changed, 11 insertions, 10 deletions
diff --git a/libvo/vo_macosx.h b/libvo/vo_macosx.h
index 422a91a462..6320b49651 100644
--- a/libvo/vo_macosx.h
+++ b/libvo/vo_macosx.h
@@ -56,6 +56,10 @@
NSMenuItem *kAspectFullCmd;
NSMenuItem *kAspectWideCmd;
NSMenuItem *kPanScanCmd;
+
+ //timestamps for disabling screensaver and mouse hiding
+ int lastMouseHide;
+ int lastScreensaverUpdate;
}
- (BOOL) acceptsFirstResponder;
diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m
index b70ccbc4e8..b756550ae3 100644
--- a/libvo/vo_macosx.m
+++ b/libvo/vo_macosx.m
@@ -759,28 +759,25 @@ static int control(uint32_t request, void *data, ...)
glFlush();
+ curTime = TickCount()/60;
+
//auto hide mouse cursor (and future on-screen control?)
if(isFullscreen && !mouseHide && !isRootwin)
{
- int curTime = TickCount()/60;
- static int lastTime = 0;
-
- if( ((curTime - lastTime) >= 5) || (lastTime == 0) )
+ if( ((curTime - lastMouseHide) >= 5) || (lastMouseHide == 0) )
{
CGDisplayHideCursor(kCGDirectMainDisplay);
- mouseHide = YES;
- lastTime = curTime;
+ mouseHide = TRUE;
+ lastMouseHide = curTime;
}
}
//update activity every 30 seconds to prevent
//screensaver from starting up.
- curTime = TickCount()/60;
-
- if( ((curTime - lastTime) >= 30) || (lastTime == 0) )
+ if( ((curTime - lastScreensaverUpdate) >= 30) || (lastScreensaverUpdate == 0) )
{
UpdateSystemActivity(UsrActivity);
- lastTime = curTime;
+ lastScreensaverUpdate = curTime;
}
}