[AD] fix for mouse warping after set_mouse_position in X version

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


In 3.9.30 version, scrolling test in test program does not work as
good as in older versions, mouse does not stay inside window.  After
setting warped mode in set_mouse_position, it is switched off almost
immediately.  I think it was done for faster mouse switching into
normal mode after setting graphics mode, but delay is too small and it
makes tricks like scrolling test in test program not very useful.

This patch makes delay after set_mouse_position larger, but two times
smaller than delay after get_mouse_mickeys.  I think this delay can be
tuned further, but it should not be smaller than 2.


diff -ruN old/allegro-3.9.30/src/x/xwin.c new/allegro-3.9.30/src/x/xwin.c
--- old/allegro-3.9.30/src/x/xwin.c	Fri Jan  7 12:27:48 2000
+++ new/allegro-3.9.30/src/x/xwin.c	Fri Jan  7 12:09:48 2000
@@ -2082,7 +2082,7 @@
  */
 static void _xwin_private_set_warped_mouse_mode(int permanent)
 {
-   _xwin.mouse_warped = (permanent) ? 1 : MOUSE_WARP_DELAY-1;
+   _xwin.mouse_warped = ((permanent) ? 1 : (MOUSE_WARP_DELAY / 2));
 }
 
 void _xwin_set_warped_mouse_mode(int permanent)


-- 
Michael Bukin



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/