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

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

parent a5293e56
......@@ -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
......
......@@ -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;
......
......@@ -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
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