summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
Diffstat (limited to 'libvo')
-rw-r--r--libvo/video_out.h1
-rw-r--r--libvo/x11_common.c18
-rw-r--r--libvo/x11_common.h1
3 files changed, 12 insertions, 8 deletions
diff --git a/libvo/video_out.h b/libvo/video_out.h
index 49f5e2af75..369aa32fc8 100644
--- a/libvo/video_out.h
+++ b/libvo/video_out.h
@@ -217,7 +217,6 @@ extern int vo_gamma_red_intensity;
extern int vo_gamma_green_intensity;
extern int vo_gamma_blue_intensity;
-extern int vo_mouse_timer_const;
extern int vo_nomouse_input;
extern int vo_pts;
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 19e9a43596..96cdc05b39 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -1001,8 +1001,8 @@ void vo_x11_uninit(void)
}
}
-int vo_mouse_timer_const = 30;
-static int vo_mouse_counter = 30;
+static unsigned int mouse_timer;
+static int mouse_waiting_hide;
int vo_x11_check_events(Display * mydisplay)
{
@@ -1014,8 +1014,11 @@ int vo_x11_check_events(Display * mydisplay)
// unsigned long vo_KeyTable[512];
- if ((vo_mouse_autohide) && (--vo_mouse_counter == 0))
+ if ((vo_mouse_autohide) && mouse_waiting_hide &&
+ (GetTimerMS() - mouse_timer >= 1000)) {
vo_hidecursor(mydisplay, vo_window);
+ mouse_waiting_hide = 0;
+ }
while (XPending(mydisplay))
{
@@ -1084,14 +1087,16 @@ int vo_x11_check_events(Display * mydisplay)
if (vo_mouse_autohide)
{
vo_showcursor(mydisplay, vo_window);
- vo_mouse_counter = vo_mouse_timer_const;
+ mouse_waiting_hide = 1;
+ mouse_timer = GetTimerMS();
}
break;
case ButtonPress:
if (vo_mouse_autohide)
{
vo_showcursor(mydisplay, vo_window);
- vo_mouse_counter = vo_mouse_timer_const;
+ mouse_waiting_hide = 1;
+ mouse_timer = GetTimerMS();
}
// Ignore mouse whell press event
if (Event.xbutton.button > 3)
@@ -1112,7 +1117,8 @@ int vo_x11_check_events(Display * mydisplay)
if (vo_mouse_autohide)
{
vo_showcursor(mydisplay, vo_window);
- vo_mouse_counter = vo_mouse_timer_const;
+ mouse_waiting_hide = 1;
+ mouse_timer = GetTimerMS();
}
#ifdef HAVE_NEW_GUI
// Ignor mouse button 1 - 3 under gui
diff --git a/libvo/x11_common.h b/libvo/x11_common.h
index a8e0310045..2e9e575486 100644
--- a/libvo/x11_common.h
+++ b/libvo/x11_common.h
@@ -33,7 +33,6 @@ extern Window mRootWin;
extern int mScreen;
extern int mLocalDisplay;
-extern int vo_mouse_timer_const;
extern int vo_mouse_autohide;
extern int vo_init( void );