[MPlayer-cvslog] r34121 - trunk/gui/wm/ws.c
ib
subversion at mplayerhq.hu
Wed Sep 21 15:26:02 CEST 2011
Author: ib
Date: Wed Sep 21 15:26:02 2011
New Revision: 34121
Log:
Add cursor autohide functionality to the GUI.
Utilize the code from x11_common.
Modified:
trunk/gui/wm/ws.c
Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c Wed Sep 21 15:20:12 2011 (r34120)
+++ trunk/gui/wm/ws.c Wed Sep 21 15:26:02 2011 (r34121)
@@ -46,6 +46,7 @@
#include "help_mp.h"
#include "mplayer.h"
#include "mpbswap.h"
+#include "osdep/timer.h"
#include "ws.h"
#include "wsxdnd.h"
@@ -642,6 +643,8 @@ void wsDestroyWindow(wsTWindow *win)
Bool wsEvents(Display *display, XEvent *Event)
{
+ static Bool mouse_hide;
+ static unsigned int mouse_time;
unsigned long i = 0;
int l;
int x, y;
@@ -654,6 +657,11 @@ Bool wsEvents(Display *display, XEvent *
wsWindowList[l]->State = 0;
+ if (mouse_hide && (GetTimerMS() - mouse_time >= 1000)) {
+ wsVisibleMouse(wsWindowList[l], wsHideMouseCursor);
+ mouse_hide = False;
+ }
+
switch (Event->type) {
case ClientMessage:
@@ -839,14 +847,23 @@ keypressed:
}
}
}
+ wsVisibleMouse(wsWindowList[l], wsShowMouseCursor);
+ mouse_hide = True;
+ mouse_time = GetTimerMS();
goto buttonreleased;
case ButtonRelease:
i = Event->xbutton.button + 128;
+ wsVisibleMouse(wsWindowList[l], wsShowMouseCursor);
+ mouse_hide = True;
+ mouse_time = GetTimerMS();
goto buttonreleased;
case ButtonPress:
i = Event->xbutton.button;
+ wsVisibleMouse(wsWindowList[l], wsShowMouseCursor);
+ mouse_hide = True;
+ mouse_time = GetTimerMS();
goto buttonreleased;
case EnterNotify:
More information about the MPlayer-cvslog
mailing list