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

window: remove VOUT_WINDOW_HIDE_MOUSE handling (fixes #18661)

parent d278550e
......@@ -62,7 +62,7 @@ enum vout_window_control {
VOUT_WINDOW_SET_STATE, /* unsigned state */
VOUT_WINDOW_SET_SIZE, /* unsigned i_width, unsigned i_height */
VOUT_WINDOW_SET_FULLSCREEN, /* int b_fullscreen */
VOUT_WINDOW_HIDE_MOUSE, /* int b_hide */
VOUT_WINDOW_HIDE_MOUSE VLC_DEPRECATED_ENUM,
};
/**
......@@ -281,14 +281,6 @@ static inline int vout_window_SetFullScreen(vout_window_t *window, bool full)
return vout_window_Control(window, VOUT_WINDOW_SET_FULLSCREEN, full);
}
/**
* Hide the mouse cursor
*/
static inline int vout_window_HideMouse(vout_window_t *window, bool hide)
{
return vout_window_Control(window, VOUT_WINDOW_HIDE_MOUSE, hide);
}
/**
* Report current window size
*
......
......@@ -74,7 +74,7 @@ typedef struct {
*/
vout_display_t *vout_NewDisplay( vout_thread_t *, const video_format_t *,
const vout_display_state_t *, const char *module,
mtime_t double_click_timeout, mtime_t hide_timeout );
mtime_t double_click_timeout );
/**
* It destroy a vout managed display.
*/
......
......@@ -373,13 +373,7 @@ typedef struct {
vlc_mouse_t state;
mtime_t last_pressed;
mtime_t last_moved;
bool is_hidden;
bool ch_activity;
/* */
mtime_t double_click_timeout;
mtime_t hide_timeout;
} mouse;
bool reset_pictures;
......@@ -543,10 +537,6 @@ static void VoutDisplayEventMouse(vout_display_t *vd, int event, va_list args)
/* */
osys->mouse.state = m;
/* */
osys->mouse.ch_activity = true;
osys->mouse.last_moved = mdate();
/* */
vout_SendDisplayEventMouse(osys->vout, &m);
vlc_mutex_unlock(&osys->lock);
......@@ -713,28 +703,6 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
if (osys->is_splitter)
SplitterManage(vd);
/* Handle mouse timeout */
const mtime_t date = mdate();
bool hide_mouse = false;
vlc_mutex_lock(&osys->lock);
if (!osys->mouse.is_hidden &&
osys->mouse.last_moved + osys->mouse.hide_timeout < date) {
osys->mouse.is_hidden = hide_mouse = true;
} else if (osys->mouse.ch_activity) {
if (osys->mouse.is_hidden)
vout_HideWindowMouse(osys->vout, false);
osys->mouse.is_hidden = false;
}
osys->mouse.ch_activity = false;
vlc_mutex_unlock(&osys->lock);
if (hide_mouse) {
msg_Dbg(vd, "auto hiding mouse cursor");
vout_HideWindowMouse(osys->vout, true);
}
bool reset_render = false;
for (;;) {
......@@ -1105,7 +1073,6 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
const vout_display_state_t *state,
const char *module, bool is_splitter,
mtime_t double_click_timeout,
mtime_t hide_timeout,
const vout_display_owner_t *owner_ptr)
{
/* */
......@@ -1123,9 +1090,7 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
vlc_mutex_init(&osys->lock);
vlc_mouse_Init(&osys->mouse.state);
osys->mouse.last_moved = mdate();
osys->mouse.double_click_timeout = double_click_timeout;
osys->mouse.hide_timeout = hide_timeout;
osys->display_width = cfg->display.width;
osys->display_height = cfg->display.height;
osys->is_display_filled = cfg->is_display_filled;
......@@ -1228,11 +1193,10 @@ vout_display_t *vout_NewDisplay(vout_thread_t *vout,
const video_format_t *source,
const vout_display_state_t *state,
const char *module,
mtime_t double_click_timeout,
mtime_t hide_timeout)
mtime_t double_click_timeout)
{
return DisplayNew(vout, source, state, module, false,
double_click_timeout, hide_timeout, NULL);
double_click_timeout, NULL);
}
/*****************************************************************************
......@@ -1410,8 +1374,7 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
const vout_display_state_t *state,
const char *module,
const char *splitter_module,
mtime_t double_click_timeout,
mtime_t hide_timeout)
mtime_t double_click_timeout)
{
video_splitter_t *splitter =
video_splitter_New(VLC_OBJECT(vout), splitter_module, source);
......@@ -1421,7 +1384,7 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
/* */
vout_display_t *wrapper =
DisplayNew(vout, source, state, module, true,
double_click_timeout, hide_timeout, NULL);
double_click_timeout, NULL);
if (!wrapper) {
video_splitter_Delete(splitter);
return NULL;
......@@ -1470,7 +1433,7 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
vout_display_t *vd = DisplayNew(vout, &output->fmt, &ostate,
output->psz_module ? output->psz_module : module,
false,
double_click_timeout, hide_timeout, &vdo);
double_click_timeout, &vdo);
if (!vd) {
vout_DeleteDisplay(wrapper, NULL);
return NULL;
......
......@@ -28,8 +28,7 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
const vout_display_state_t *state,
const char *module,
const char *splitter_module,
mtime_t double_click_timeout,
mtime_t hide_timeout);
mtime_t double_click_timeout);
/* FIXME should not be there */
void vout_SendDisplayEventMouse(vout_thread_t *, const vlc_mouse_t *);
......@@ -37,6 +36,5 @@ void vout_SendDisplayEventMouse(vout_thread_t *, const vlc_mouse_t *);
vout_window_t *vout_NewDisplayWindow(vout_thread_t *, unsigned type);
void vout_DeleteDisplayWindow(vout_thread_t *, vout_window_t *);
void vout_SetDisplayWindowSize(vout_thread_t *, unsigned, unsigned);
int vout_HideWindowMouse(vout_thread_t *, bool);
void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t *);
......@@ -646,13 +646,6 @@ void vout_SetDisplayWindowSize(vout_thread_t *vout,
vout_display_SendEventDisplaySize(vout->p->display.vd, width, height);
}
int vout_HideWindowMouse(vout_thread_t *vout, bool hide)
{
vout_window_t *window = vout->p->window;
return window != NULL ? vout_window_HideMouse(window, hide) : VLC_EGENERIC;
}
/* */
static int FilterRestartCallback(vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval,
......
......@@ -58,15 +58,14 @@ int vout_OpenWrapper(vout_thread_t *vout,
/* */
const mtime_t double_click_timeout = 3*CLOCK_FREQ/10;
const mtime_t hide_timeout = var_CreateGetInteger(vout, "mouse-hide-timeout") * 1000;
char *modlist = var_InheritString(vout, "vout");
if (splitter_name)
sys->display.vd = vout_NewSplitter(vout, &vout->p->original, state, modlist, splitter_name,
double_click_timeout, hide_timeout);
double_click_timeout);
else
sys->display.vd = vout_NewDisplay(vout, &vout->p->original, state, modlist,
double_click_timeout, hide_timeout);
double_click_timeout);
free(modlist);
if (!sys->display.vd) {
......
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