summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-21 04:25:10 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-23 13:47:43 +0300
commit49ac1f06cac12dd412a14473e5fd0d5b7c8cf001 (patch)
tree54f5c97756e6a5b81a8f1321c505eef53ea67f60
parent49461e04d0ecbf08c636f80b6aa1617db061e92f (diff)
downloadmpv-49ac1f06cac12dd412a14473e5fd0d5b7c8cf001.tar.bz2
mpv-49ac1f06cac12dd412a14473e5fd0d5b7c8cf001.tar.xz
Move static mouse hide timers to x11 struct
-rw-r--r--libvo/x11_common.c21
-rw-r--r--libvo/x11_common.h2
2 files changed, 11 insertions, 12 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 925fd9ca57..0ba4693507 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -988,9 +988,6 @@ void vo_x11_uninit(struct vo *vo)
}
}
-static unsigned int mouse_timer;
-static int mouse_waiting_hide;
-
int vo_x11_check_events(struct vo *vo)
{
struct vo_x11_state *x11 = vo->x11;
@@ -1003,10 +1000,10 @@ int vo_x11_check_events(struct vo *vo)
// unsigned long vo_KeyTable[512];
- if ((vo_mouse_autohide) && mouse_waiting_hide &&
- (GetTimerMS() - mouse_timer >= 1000)) {
+ if ((vo_mouse_autohide) && x11->mouse_waiting_hide &&
+ (GetTimerMS() - x11->mouse_timer >= 1000)) {
vo_hidecursor(display, x11->window);
- mouse_waiting_hide = 0;
+ x11->mouse_waiting_hide = 0;
}
while (XPending(display))
@@ -1083,16 +1080,16 @@ int vo_x11_check_events(struct vo *vo)
if (vo_mouse_autohide)
{
vo_showcursor(display, x11->window);
- mouse_waiting_hide = 1;
- mouse_timer = GetTimerMS();
+ x11->mouse_waiting_hide = 1;
+ x11->mouse_timer = GetTimerMS();
}
break;
case ButtonPress:
if (vo_mouse_autohide)
{
vo_showcursor(display, x11->window);
- mouse_waiting_hide = 1;
- mouse_timer = GetTimerMS();
+ x11->mouse_waiting_hide = 1;
+ x11->mouse_timer = GetTimerMS();
}
#ifdef HAVE_NEW_GUI
// Ignore mouse button 1-3 under GUI.
@@ -1107,8 +1104,8 @@ int vo_x11_check_events(struct vo *vo)
if (vo_mouse_autohide)
{
vo_showcursor(display, x11->window);
- mouse_waiting_hide = 1;
- mouse_timer = GetTimerMS();
+ x11->mouse_waiting_hide = 1;
+ x11->mouse_timer = GetTimerMS();
}
#ifdef HAVE_NEW_GUI
// Ignore mouse button 1-3 under GUI.
diff --git a/libvo/x11_common.h b/libvo/x11_common.h
index b40755962a..2d498166f4 100644
--- a/libvo/x11_common.h
+++ b/libvo/x11_common.h
@@ -22,6 +22,8 @@ struct vo_x11_state {
GC f_gc;
XSizeHints vo_hint;
+ unsigned int mouse_timer;
+ int mouse_waiting_hide;
unsigned int olddecor;
unsigned int oldfuncs;