]> git.sesse.net Git - vlc/commitdiff
* modules/video_output/directx/*: only hide the mouse when in fullscreen.
authorGildas Bazin <gbazin@videolan.org>
Thu, 22 Apr 2004 15:59:05 +0000 (15:59 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 22 Apr 2004 15:59:05 +0000 (15:59 +0000)
modules/video_output/directx/directx.c
modules/video_output/directx/events.c
modules/video_output/directx/vout.h

index 5c249b8490fef0c3ef309059c841c0cb63e00ded..bc1b2586b1dcfeb0437aa164a599e7d409cc1fe3 100644 (file)
@@ -462,7 +462,7 @@ static int Manage( vout_thread_t *p_vout )
             p_vout->p_sys->rect_parent = rect_parent;
 
             /* This one is to force the update even if only
-            * the position has changed */
+             * the position has changed */
             SetWindowPos( p_vout->p_sys->hwnd, 0, 1, 1,
                           rect_parent.right - rect_parent.left,
                           rect_parent.bottom - rect_parent.top, 0 );
@@ -539,6 +539,9 @@ static int Manage( vout_thread_t *p_vout )
 
             /* Normal window */
             window_placement.showCmd = SW_SHOWNORMAL;
+
+            /* Make sure the mouse cursor is displayed */
+            PostMessage( p_vout->p_sys->hwnd, WM_VLC_SHOW_MOUSE, 0, 0 );
         }
 
         /* Change window style, borders and title bar */
@@ -556,8 +559,8 @@ static int Manage( vout_thread_t *p_vout )
     /*
      * Pointer change
      */
-    if( (!p_vout->p_sys->b_cursor_hidden) &&
-        ( (mdate() - p_vout->p_sys->i_lastmoved) > 5000000 ) )
+    if( p_vout->b_fullscreen && !p_vout->p_sys->b_cursor_hidden &&
+        (mdate() - p_vout->p_sys->i_lastmoved) > 5000000 )
     {
         POINT point;
         RECT rect;
@@ -570,7 +573,6 @@ static int Manage( vout_thread_t *p_vout )
         GetCursorPos( &point );
         if( PtInRect( &rect, point ) )
         {
-            p_vout->p_sys->b_cursor_hidden = VLC_TRUE;
             PostMessage( p_vout->p_sys->hwnd, WM_VLC_HIDE_MOUSE, 0, 0 );
         }
         else
index 81904a585fb4a9b91f1eff8cb93cdb9d05547da0..d2f8c04bb00a2a9a421f9a3d7f7be54c82354745 100644 (file)
@@ -170,10 +170,19 @@ void DirectXEventThread( event_thread_t *p_event )
             break;
 
         case WM_VLC_HIDE_MOUSE:
+            if( p_event->p_vout->p_sys->b_cursor_hidden ) break;
+            p_event->p_vout->p_sys->b_cursor_hidden = VLC_TRUE;
             GetCursorPos( &old_mouse_pos );
             ShowCursor( FALSE );
             break;
 
+        case WM_VLC_SHOW_MOUSE:
+            if( !p_event->p_vout->p_sys->b_cursor_hidden ) break;
+            p_event->p_vout->p_sys->b_cursor_hidden = VLC_FALSE;
+            GetCursorPos( &old_mouse_pos );
+            ShowCursor( TRUE );
+            break;
+
         case WM_LBUTTONDOWN:
             var_Get( p_event->p_vout, "mouse-button-down", &val );
             val.i_int |= 1;
index 3fbfec36104e6a4062a985ea37adab1bd422e3b6..7117dc1ce1ccea4608484f1482c5264a3c01ad56 100644 (file)
@@ -132,8 +132,8 @@ void DirectXUpdateRects ( vout_thread_t *p_vout, vlc_bool_t b_force );
  * Constants
  *****************************************************************************/
 #define WM_VLC_HIDE_MOUSE WM_APP
-#define WM_VLC_CREATE_VIDEO_WIN WM_APP + 1
-#define WM_VLC_DESTROY_VIDEO_WIN WM_APP + 2
+#define WM_VLC_SHOW_MOUSE WM_APP + 1
+#define WM_VLC_CREATE_VIDEO_WIN WM_APP + 2
 #define WM_VLC_CHANGE_TEXT WM_APP + 3
 #define IDM_TOGGLE_ON_TOP WM_USER + 1
 #define DX_POSITION_CHANGE 0x1000