comparison libvo/x11_common.c @ 18287:292337d09af2

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.
author uau
date Tue, 25 Apr 2006 21:36:02 +0000
parents 4231482179b6
children b8ec2d53a206
comparison
equal deleted inserted replaced
18286:e0470e00b3bd 18287:292337d09af2
999 vo_fs = 0; 999 vo_fs = 0;
1000 vo_old_width = vo_old_height = 0; 1000 vo_old_width = vo_old_height = 0;
1001 } 1001 }
1002 } 1002 }
1003 1003
1004 int vo_mouse_timer_const = 30; 1004 static unsigned int mouse_timer;
1005 static int vo_mouse_counter = 30; 1005 static int mouse_waiting_hide;
1006 1006
1007 int vo_x11_check_events(Display * mydisplay) 1007 int vo_x11_check_events(Display * mydisplay)
1008 { 1008 {
1009 int ret = 0; 1009 int ret = 0;
1010 XEvent Event; 1010 XEvent Event;
1012 KeySym keySym; 1012 KeySym keySym;
1013 static XComposeStatus stat; 1013 static XComposeStatus stat;
1014 1014
1015 // unsigned long vo_KeyTable[512]; 1015 // unsigned long vo_KeyTable[512];
1016 1016
1017 if ((vo_mouse_autohide) && (--vo_mouse_counter == 0)) 1017 if ((vo_mouse_autohide) && mouse_waiting_hide &&
1018 (GetTimerMS() - mouse_timer >= 1000)) {
1018 vo_hidecursor(mydisplay, vo_window); 1019 vo_hidecursor(mydisplay, vo_window);
1020 mouse_waiting_hide = 0;
1021 }
1019 1022
1020 while (XPending(mydisplay)) 1023 while (XPending(mydisplay))
1021 { 1024 {
1022 XNextEvent(mydisplay, &Event); 1025 XNextEvent(mydisplay, &Event);
1023 #ifdef HAVE_NEW_GUI 1026 #ifdef HAVE_NEW_GUI
1082 break; 1085 break;
1083 case MotionNotify: 1086 case MotionNotify:
1084 if (vo_mouse_autohide) 1087 if (vo_mouse_autohide)
1085 { 1088 {
1086 vo_showcursor(mydisplay, vo_window); 1089 vo_showcursor(mydisplay, vo_window);
1087 vo_mouse_counter = vo_mouse_timer_const; 1090 mouse_waiting_hide = 1;
1091 mouse_timer = GetTimerMS();
1088 } 1092 }
1089 break; 1093 break;
1090 case ButtonPress: 1094 case ButtonPress:
1091 if (vo_mouse_autohide) 1095 if (vo_mouse_autohide)
1092 { 1096 {
1093 vo_showcursor(mydisplay, vo_window); 1097 vo_showcursor(mydisplay, vo_window);
1094 vo_mouse_counter = vo_mouse_timer_const; 1098 mouse_waiting_hide = 1;
1099 mouse_timer = GetTimerMS();
1095 } 1100 }
1096 // Ignore mouse whell press event 1101 // Ignore mouse whell press event
1097 if (Event.xbutton.button > 3) 1102 if (Event.xbutton.button > 3)
1098 { 1103 {
1099 mplayer_put_key(MOUSE_BTN0 + Event.xbutton.button - 1); 1104 mplayer_put_key(MOUSE_BTN0 + Event.xbutton.button - 1);
1110 break; 1115 break;
1111 case ButtonRelease: 1116 case ButtonRelease:
1112 if (vo_mouse_autohide) 1117 if (vo_mouse_autohide)
1113 { 1118 {
1114 vo_showcursor(mydisplay, vo_window); 1119 vo_showcursor(mydisplay, vo_window);
1115 vo_mouse_counter = vo_mouse_timer_const; 1120 mouse_waiting_hide = 1;
1121 mouse_timer = GetTimerMS();
1116 } 1122 }
1117 #ifdef HAVE_NEW_GUI 1123 #ifdef HAVE_NEW_GUI
1118 // Ignor mouse button 1 - 3 under gui 1124 // Ignor mouse button 1 - 3 under gui
1119 if (use_gui && (Event.xbutton.button >= 1) 1125 if (use_gui && (Event.xbutton.button >= 1)
1120 && (Event.xbutton.button <= 3)) 1126 && (Event.xbutton.button <= 3))