Commit 4db4bfc6 authored by Gildas Bazin's avatar Gildas Bazin

* modules/video_output/directx/*: only hide the mouse when in fullscreen.

parent a5293e56
...@@ -539,6 +539,9 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -539,6 +539,9 @@ static int Manage( vout_thread_t *p_vout )
/* Normal window */ /* Normal window */
window_placement.showCmd = SW_SHOWNORMAL; 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 */ /* Change window style, borders and title bar */
...@@ -556,8 +559,8 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -556,8 +559,8 @@ static int Manage( vout_thread_t *p_vout )
/* /*
* Pointer change * Pointer change
*/ */
if( (!p_vout->p_sys->b_cursor_hidden) && if( p_vout->b_fullscreen && !p_vout->p_sys->b_cursor_hidden &&
( (mdate() - p_vout->p_sys->i_lastmoved) > 5000000 ) ) (mdate() - p_vout->p_sys->i_lastmoved) > 5000000 )
{ {
POINT point; POINT point;
RECT rect; RECT rect;
...@@ -570,7 +573,6 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -570,7 +573,6 @@ static int Manage( vout_thread_t *p_vout )
GetCursorPos( &point ); GetCursorPos( &point );
if( PtInRect( &rect, 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 ); PostMessage( p_vout->p_sys->hwnd, WM_VLC_HIDE_MOUSE, 0, 0 );
} }
else else
......
...@@ -170,10 +170,19 @@ void DirectXEventThread( event_thread_t *p_event ) ...@@ -170,10 +170,19 @@ void DirectXEventThread( event_thread_t *p_event )
break; break;
case WM_VLC_HIDE_MOUSE: 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 ); GetCursorPos( &old_mouse_pos );
ShowCursor( FALSE ); ShowCursor( FALSE );
break; 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: case WM_LBUTTONDOWN:
var_Get( p_event->p_vout, "mouse-button-down", &val ); var_Get( p_event->p_vout, "mouse-button-down", &val );
val.i_int |= 1; val.i_int |= 1;
......
...@@ -132,8 +132,8 @@ void DirectXUpdateRects ( vout_thread_t *p_vout, vlc_bool_t b_force ); ...@@ -132,8 +132,8 @@ void DirectXUpdateRects ( vout_thread_t *p_vout, vlc_bool_t b_force );
* Constants * Constants
*****************************************************************************/ *****************************************************************************/
#define WM_VLC_HIDE_MOUSE WM_APP #define WM_VLC_HIDE_MOUSE WM_APP
#define WM_VLC_CREATE_VIDEO_WIN WM_APP + 1 #define WM_VLC_SHOW_MOUSE WM_APP + 1
#define WM_VLC_DESTROY_VIDEO_WIN WM_APP + 2 #define WM_VLC_CREATE_VIDEO_WIN WM_APP + 2
#define WM_VLC_CHANGE_TEXT WM_APP + 3 #define WM_VLC_CHANGE_TEXT WM_APP + 3
#define IDM_TOGGLE_ON_TOP WM_USER + 1 #define IDM_TOGGLE_ON_TOP WM_USER + 1
#define DX_POSITION_CHANGE 0x1000 #define DX_POSITION_CHANGE 0x1000
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment