]> git.sesse.net Git - vlc/commitdiff
* modules/video_output/directx/events.c: fixed mouse coordinates for dvd navigation...
authorGildas Bazin <gbazin@videolan.org>
Tue, 23 Dec 2003 15:27:50 +0000 (15:27 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 23 Dec 2003 15:27:50 +0000 (15:27 +0000)
modules/video_output/directx/events.c

index a360b1c0cf1bc686b6bc27463d2ecce8a50ffb85..53579d69cd6a61dc6647ba60c8a051c499f466fe 100644 (file)
@@ -2,7 +2,7 @@
  * events.c: Windows DirectX video output events handler
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: events.c,v 1.34 2003/12/23 02:11:27 gbazin Exp $
+ * $Id: events.c,v 1.35 2003/12/23 15:27:50 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -117,13 +117,18 @@ void DirectXEventThread( event_thread_t *p_event )
         switch( msg.message )
         {
 
-        case WM_NCMOUSEMOVE:
         case WM_MOUSEMOVE:
             vout_PlacePicture( p_event->p_vout,
                                p_event->p_vout->p_sys->i_window_width,
                                p_event->p_vout->p_sys->i_window_height,
                                &i_x, &i_y, &i_width, &i_height );
 
+            if( msg.hwnd != p_event->p_vout->p_sys->hwnd )
+            {
+                /* Child window */
+                i_x = i_y = 0;
+            }
+
             val.i_int = ( GET_X_LPARAM(msg.lParam) - i_x )
                          * p_event->p_vout->render.i_width / i_width;
             var_Set( p_event->p_vout, "mouse-x", val );
@@ -134,6 +139,7 @@ void DirectXEventThread( event_thread_t *p_event )
             val.b_bool = VLC_TRUE;
             var_Set( p_event->p_vout, "mouse-moved", val );
 
+        case WM_NCMOUSEMOVE:
             if( (abs(GET_X_LPARAM(msg.lParam) - old_mouse_pos.x) > 2 ||
                 (abs(GET_Y_LPARAM(msg.lParam) - old_mouse_pos.y)) > 2 ) )
             {