]> git.sesse.net Git - vlc/commitdiff
* modules/video_output/directx, modules/video_output/x11: take cropping into account...
authorGildas Bazin <gbazin@videolan.org>
Sat, 29 Oct 2005 16:14:21 +0000 (16:14 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sat, 29 Oct 2005 16:14:21 +0000 (16:14 +0000)
modules/video_output/directx/events.c
modules/video_output/x11/xcommon.c

index c2af7e8db31f0b9f535a4ca0a06de1d71d8396dd..0790b8ed23e5cb02cbbfa55dc4426c8cc0c406d1 100644 (file)
@@ -144,11 +144,13 @@ void E_(DirectXEventThread)( event_thread_t *p_event )
 
             if( i_width && i_height )
             {
-                val.i_int = ( GET_X_LPARAM(msg.lParam) - i_x )
-                             * p_event->p_vout->render.i_width / i_width;
+                val.i_int = ( GET_X_LPARAM(msg.lParam) - i_x ) *
+                    p_event->p_vout->fmt_in.i_visible_width / i_width +
+                    p_event->p_vout->fmt_in.i_x_offset;
                 var_Set( p_event->p_vout, "mouse-x", val );
-                val.i_int = ( GET_Y_LPARAM(msg.lParam) - i_y )
-                             * p_event->p_vout->render.i_height / i_height;
+                val.i_int = ( GET_Y_LPARAM(msg.lParam) - i_y ) *
+                    p_event->p_vout->fmt_in.i_visible_height / i_height +
+                    p_event->p_vout->fmt_in.i_y_offset;
                 var_Set( p_event->p_vout, "mouse-y", val );
 
                 val.b_bool = VLC_TRUE;
index 126730427284fc90e493096191bc80ab7dc875ad..8533aff8072717efbc1de22be09894429b9e2699 100644 (file)
@@ -785,11 +785,13 @@ static int ManageVideo( vout_thread_t *p_vout )
                                p_vout->p_sys->p_win->i_height,
                                &i_x, &i_y, &i_width, &i_height );
 
-            val.i_int = ( xevent.xmotion.x - i_x )
-                         * p_vout->render.i_width / i_width;
+            val.i_int = ( xevent.xmotion.x - i_x ) *
+                p_vout->fmt_in.i_visible_width / i_width +
+                p_vout->fmt_in.i_x_offset;
             var_Set( p_vout, "mouse-x", val );
-            val.i_int = ( xevent.xmotion.y - i_y )
-                         * p_vout->render.i_height / i_height;
+            val.i_int = ( xevent.xmotion.y - i_y ) *
+                p_vout->fmt_in.i_visible_height / i_height +
+                p_vout->fmt_in.i_y_offset;
             var_Set( p_vout, "mouse-y", val );
 
             val.b_bool = VLC_TRUE;