diff options
author | uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-04-25 21:36:02 +0000 |
---|---|---|
committer | uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-04-25 21:36:02 +0000 |
commit | bee52bbd1045c9f74ee6f8ff57c53cfb433f0675 (patch) | |
tree | 024471b2bc8378a3500177ffb9e69612c7553838 /libvo | |
parent | ef6264e56eb0fdbc2f6984a1dc1ef841821b6cd6 (diff) | |
download | mpv-bee52bbd1045c9f74ee6f8ff57c53cfb433f0675.tar.bz2 mpv-bee52bbd1045c9f74ee6f8ff57c53cfb433f0675.tar.xz |
Remove updating of vo_mouse_timer_const from the main loop and also
remove the variable itself. Convert code in x11_common.c and OSD timing
that depended on the variable to use real time instead.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18288 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/video_out.h | 1 | ||||
-rw-r--r-- | libvo/x11_common.c | 18 | ||||
-rw-r--r-- | libvo/x11_common.h | 1 |
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 ); |