[PATCH] corrects mouse-x and mouse-y wrong boundary tests in =

Joseph Tulou brezhoneg1 at yahoo.fr
Thu Feb 12 01:05:04 CET 2009


xcommon.c=0A=
=0A=
---=0A=
 modules/video_output/x11/xcommon.c |   28 ++++++++++++++++++----------=0A=
 1 files changed, 18 insertions(+), 10 deletions(-)=0A=
=0A=
diff --git a/modules/video_output/x11/xcommon.c =
b/modules/video_output/x11/xcommon.c=0A=
index 7b6d6d6..1238043 100644=0A=
--- a/modules/video_output/x11/xcommon.c=0A=
+++ b/modules/video_output/x11/xcommon.c=0A=
@@ -1354,29 +1354,37 @@ static int ManageVideo( vout_thread_t *p_vout )=0A=
                                p_vout->p_sys->p_win->i_height,=0A=
                                &i_x, &i_y, &i_width, &i_height );=0A=
 =0A=
-            /* Compute the x coordinate and check if the value is=0A=
-               in [0,p_vout->fmt_in.i_visible_width] */=0A=
+            /**=0A=
+             * Compute the x coordinate and check if the value is in=0A=
+             * [ p_vout->fmt_in.i_x_offset ,=0A=
+             *   p_vout->fmt_in.i_visible_width + =
p_vout->fmt_in.i_x_offset ]=0A=
+             **/=0A=
             val.i_int =3D ( xevent.xmotion.x - i_x ) *=0A=
                 p_vout->fmt_in.i_visible_width / i_width +=0A=
                 p_vout->fmt_in.i_x_offset;=0A=
 =0A=
             if( (int)(xevent.xmotion.x - i_x) < 0 )=0A=
-                val.i_int =3D 0;=0A=
-            else if( (unsigned int)val.i_int > =
p_vout->fmt_in.i_visible_width )=0A=
-                val.i_int =3D p_vout->fmt_in.i_visible_width;=0A=
+                val.i_int =3D p_vout->fmt_in.i_x_offset;=0A=
+            else if( (int)(xevent.xmotion.x - i_x) > (int)i_width )=0A=
+                val.i_int =3D p_vout->fmt_in.i_visible_width +=0A=
+                            p_vout->fmt_in.i_x_offset;=0A=
 =0A=
             var_Set( p_vout, "mouse-x", val );=0A=
 =0A=
-            /* compute the y coordinate and check if the value is=0A=
-               in [0,p_vout->fmt_in.i_visible_height] */=0A=
+            /**=0A=
+             * Compute the y coordinate and check if the value is in=0A=
+             * [ p_vout->fmt_in.i_y_offset ,=0A=
+             *   p_vout->fmt_in.i_visible_height + =
p_vout->fmt_in.i_y_offset ]=0A=
+             **/=0A=
             val.i_int =3D ( xevent.xmotion.y - i_y ) *=0A=
                 p_vout->fmt_in.i_visible_height / i_height +=0A=
                 p_vout->fmt_in.i_y_offset;=0A=
 =0A=
             if( (int)(xevent.xmotion.y - i_y) < 0 )=0A=
-                val.i_int =3D 0;=0A=
-            else if( (unsigned int)val.i_int > =
p_vout->fmt_in.i_visible_height )=0A=
-                val.i_int =3D p_vout->fmt_in.i_visible_height;=0A=
+                val.i_int =3D p_vout->fmt_in.i_y_offset;=0A=
+            else if( (int)(xevent.xmotion.y - i_y) > (int)i_height )=0A=
+                val.i_int =3D p_vout->fmt_in.i_visible_height +=0A=
+                            p_vout->fmt_in.i_y_offset;=0A=
 =0A=
             var_Set( p_vout, "mouse-y", val );=0A=
 =0A=
-- =0A=
1.5.2.5=0A=
=0A=

------=_NextPart_000_0003_01C98CB2.F83CC7D0--




More information about the vlc-devel mailing list