Commit 092f7f94 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

kva: remove VOUT_DISPLAY_HIDE_MOUSE (refs #18661)

parent b334e4f4
...@@ -103,6 +103,8 @@ struct vout_display_sys_t ...@@ -103,6 +103,8 @@ struct vout_display_sys_t
unsigned button_pressed; unsigned button_pressed;
bool is_mouse_hidden; bool is_mouse_hidden;
bool is_on_top; bool is_on_top;
mtime_t cursor_timeout;
mtime_t cursor_deadline;
}; };
typedef struct typedef struct
...@@ -391,32 +393,29 @@ static void Display( vout_display_t *vd, picture_t *picture, ...@@ -391,32 +393,29 @@ static void Display( vout_display_t *vd, picture_t *picture,
* here, WM_SIZE is not sent to its child window. * here, WM_SIZE is not sent to its child window.
* Maybe, is this due to the different threads ? */ * Maybe, is this due to the different threads ? */
WinPostMsg( sys->client, WM_VLC_MANAGE, 0, 0 ); WinPostMsg( sys->client, WM_VLC_MANAGE, 0, 0 );
}
/*****************************************************************************
* Control: control facility for the vout
*****************************************************************************/
static int Control( vout_display_t *vd, int query, va_list args )
{
vout_display_sys_t *sys = vd->sys;
switch (query) if( !sys->is_mouse_hidden && sys->cursor_deadline < mdate() )
{
case VOUT_DISPLAY_HIDE_MOUSE:
{ {
POINTL ptl; POINTL ptl;
WinQueryPointerPos( HWND_DESKTOP, &ptl ); WinQueryPointerPos( HWND_DESKTOP, &ptl );
if( !sys->is_mouse_hidden && if( WinWindowFromPoint( HWND_DESKTOP, &ptl, TRUE ) == sys->client )
WinWindowFromPoint( HWND_DESKTOP, &ptl, TRUE ) == sys->client )
{ {
WinShowPointer( HWND_DESKTOP, FALSE ); WinShowPointer( HWND_DESKTOP, FALSE );
sys->is_mouse_hidden = true; sys->is_mouse_hidden = true;
} }
return VLC_SUCCESS;
} }
}
/*****************************************************************************
* Control: control facility for the vout
*****************************************************************************/
static int Control( vout_display_t *vd, int query, va_list args )
{
vout_display_sys_t *sys = vd->sys;
switch (query)
{
case VOUT_DISPLAY_CHANGE_FULLSCREEN: case VOUT_DISPLAY_CHANGE_FULLSCREEN:
{ {
bool fs = va_arg(args, int); bool fs = va_arg(args, int);
...@@ -647,6 +646,10 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt ) ...@@ -647,6 +646,10 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt )
psz_video_mode[ sys->kvac.ulMode - 1 ]); psz_video_mode[ sys->kvac.ulMode - 1 ]);
WinSetWindowText( sys->frame, sz_title ); WinSetWindowText( sys->frame, sz_title );
sys->cursor_timeout = var_InheritInteger( vd, "mouse-hide-timeout" )
* (CLOCK_FREQ / 1000);
sys->cursor_deadline = INT64_MAX;
sys->i_screen_width = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN ); sys->i_screen_width = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN );
sys->i_screen_height = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN ); sys->i_screen_height = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN );
...@@ -956,6 +959,7 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) ...@@ -956,6 +959,7 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{ {
WinShowPointer(HWND_DESKTOP, TRUE); WinShowPointer(HWND_DESKTOP, TRUE);
sys->is_mouse_hidden = false; sys->is_mouse_hidden = false;
sys->cursor_deadline = mdate() + sys->cursor_timeout;
} }
switch( msg ) switch( msg )
......
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