mirror of
https://github.com/mpv-player/mpv
synced 2025-01-05 03:06:28 +01:00
vo_corevideo: move mouse hiding to check_events
Move mouse hiding code to check_events, this allows mouse hiding to continue to work with -idle -fixed-vo, after the video has finished but the last frame is still displayed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31825 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
902417b999
commit
2e6847a352
@ -717,8 +717,6 @@ static int control(uint32_t request, void *data)
|
||||
*/
|
||||
- (void) render
|
||||
{
|
||||
int curTime;
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glEnable(CVOpenGLTextureGetTarget(texture));
|
||||
@ -757,27 +755,6 @@ static int control(uint32_t request, void *data)
|
||||
}
|
||||
|
||||
glFlush();
|
||||
|
||||
curTime = TickCount()/60;
|
||||
|
||||
//automatically hide mouse cursor (and future on-screen control?)
|
||||
if(isFullscreen && !mouseHide && !isRootwin)
|
||||
{
|
||||
if(curTime - lastMouseHide >= 5 || lastMouseHide == 0)
|
||||
{
|
||||
CGDisplayHideCursor(kCGDirectMainDisplay);
|
||||
mouseHide = TRUE;
|
||||
lastMouseHide = curTime;
|
||||
}
|
||||
}
|
||||
|
||||
//update activity every 30 seconds to prevent
|
||||
//screensaver from starting up.
|
||||
if(curTime - lastScreensaverUpdate >= 30 || lastScreensaverUpdate == 0)
|
||||
{
|
||||
UpdateSystemActivity(UsrActivity);
|
||||
lastScreensaverUpdate = curTime;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -901,6 +878,27 @@ static int control(uint32_t request, void *data)
|
||||
*/
|
||||
- (void) check_events
|
||||
{
|
||||
int curTime = TickCount()/60;
|
||||
|
||||
//automatically hide mouse cursor (and future on-screen control?)
|
||||
if(isFullscreen && !mouseHide && !isRootwin)
|
||||
{
|
||||
if(curTime - lastMouseHide >= 5 || lastMouseHide == 0)
|
||||
{
|
||||
CGDisplayHideCursor(kCGDirectMainDisplay);
|
||||
mouseHide = TRUE;
|
||||
lastMouseHide = curTime;
|
||||
}
|
||||
}
|
||||
|
||||
//update activity every 30 seconds to prevent
|
||||
//screensaver from starting up.
|
||||
if(curTime - lastScreensaverUpdate >= 30 || lastScreensaverUpdate == 0)
|
||||
{
|
||||
UpdateSystemActivity(UsrActivity);
|
||||
lastScreensaverUpdate = curTime;
|
||||
}
|
||||
|
||||
event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:NSEventTrackingRunLoopMode dequeue:YES];
|
||||
if (event == nil)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user