[MPlayer-cvslog] r34171 - in trunk/gui: interface.c wm/ws.c wm/ws.h
ib
subversion at mplayerhq.hu
Sat Oct 1 17:32:05 CEST 2011
Author: ib
Date: Sat Oct 1 17:32:04 2011
New Revision: 34171
Log:
Simplify wsAutohideCursor().
Use window pointer as the flag. This enables omitting the parameter to
the function and doesn't require a special note on the usage, because
misuse isn't possible any longer.
Modified:
trunk/gui/interface.c
trunk/gui/wm/ws.c
trunk/gui/wm/ws.h
Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c Sat Oct 1 17:12:54 2011 (r34170)
+++ trunk/gui/interface.c Sat Oct 1 17:32:04 2011 (r34171)
@@ -350,7 +350,7 @@ int gui(int what, void *data)
case GUI_HANDLE_EVENTS:
if (!guiInfo.Playing || !guiInfo.VideoWindow)
wsHandleEvents();
- wsAutohideCursor(&guiApp.subWindow);
+ wsAutohideCursor();
gtkEventHandling();
break;
Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c Sat Oct 1 17:12:54 2011 (r34170)
+++ trunk/gui/wm/ws.c Sat Oct 1 17:32:04 2011 (r34171)
@@ -68,7 +68,7 @@
#define MOUSEHIDE_DELAY 1000 // in milliseconds
-static Bool mouse_hide;
+static wsTWindow *mouse_win;
static unsigned int mouse_time;
typedef struct {
@@ -644,16 +644,12 @@ void wsDestroyWindow(wsTWindow *win)
/**
* @brief Handle automatic hiding of the cursor.
- *
- * @param win pointer to a ws window structure
- *
- * @note Only one window will be handled at a time.
*/
-void wsAutohideCursor(wsTWindow *win)
+void wsAutohideCursor(void)
{
- if (mouse_hide && (GetTimerMS() - mouse_time >= MOUSEHIDE_DELAY)) {
- wsVisibleMouse(win, wsHideMouseCursor);
- mouse_hide = False;
+ if (mouse_win && (GetTimerMS() - mouse_time >= MOUSEHIDE_DELAY)) {
+ wsVisibleMouse(mouse_win, wsHideMouseCursor);
+ mouse_win = NULL;
}
}
@@ -862,7 +858,7 @@ keypressed:
}
if (wsWindowList[l]->wsCursor != None) {
wsVisibleMouse(wsWindowList[l], wsShowMouseCursor);
- mouse_hide = True;
+ mouse_win = wsWindowList[l];
mouse_time = GetTimerMS();
}
goto buttonreleased;
@@ -871,7 +867,7 @@ keypressed:
i = Event->xbutton.button + 128;
if (wsWindowList[l]->wsCursor != None) {
wsVisibleMouse(wsWindowList[l], wsShowMouseCursor);
- mouse_hide = True;
+ mouse_win = wsWindowList[l];
mouse_time = GetTimerMS();
}
goto buttonreleased;
@@ -880,7 +876,7 @@ keypressed:
i = Event->xbutton.button;
if (wsWindowList[l]->wsCursor != None) {
wsVisibleMouse(wsWindowList[l], wsShowMouseCursor);
- mouse_hide = True;
+ mouse_win = wsWindowList[l];
mouse_time = GetTimerMS();
}
goto buttonreleased;
Modified: trunk/gui/wm/ws.h
==============================================================================
--- trunk/gui/wm/ws.h Sat Oct 1 17:12:54 2011 (r34170)
+++ trunk/gui/wm/ws.h Sat Oct 1 17:32:04 2011 (r34171)
@@ -216,7 +216,7 @@ int wsGetDepthOnScreen(void);
void wsDoExit(void);
void wsMainLoop(void);
-void wsAutohideCursor(wsTWindow *win);
+void wsAutohideCursor(void);
Bool wsEvents(Display *display, XEvent *Event);
void wsHandleEvents(void);
More information about the MPlayer-cvslog
mailing list