[vlc-commits] window: remove VOUT_WINDOW_HIDE_MOUSE handling (fixes #18661)
Rémi Denis-Courmont
git at videolan.org
Sun May 20 19:51:30 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri May 18 18:24:01 2018 +0300| [cfc593e7d61e8c3450867feb3c8d61ded7dc8b5e] | committer: Rémi Denis-Courmont
window: remove VOUT_WINDOW_HIDE_MOUSE handling (fixes #18661)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cfc593e7d61e8c3450867feb3c8d61ded7dc8b5e
---
include/vlc_vout_window.h | 10 +--------
include/vlc_vout_wrapper.h | 2 +-
src/video_output/display.c | 47 +++++------------------------------------
src/video_output/display.h | 4 +---
src/video_output/video_output.c | 7 ------
src/video_output/vout_wrapper.c | 5 ++---
6 files changed, 10 insertions(+), 65 deletions(-)
diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
index c674c262c2..54b83971a1 100644
--- a/include/vlc_vout_window.h
+++ b/include/vlc_vout_window.h
@@ -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,
};
/**
@@ -282,14 +282,6 @@ static inline int vout_window_SetFullScreen(vout_window_t *window, bool 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
*
* This notifies the user of the window what the pixel dimensions of the
diff --git a/include/vlc_vout_wrapper.h b/include/vlc_vout_wrapper.h
index 98f9ddcfa9..fec72efd8c 100644
--- a/include/vlc_vout_wrapper.h
+++ b/include/vlc_vout_wrapper.h
@@ -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.
*/
diff --git a/src/video_output/display.c b/src/video_output/display.c
index e87f877f97..871190c766 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -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;
@@ -544,10 +538,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;
diff --git a/src/video_output/display.h b/src/video_output/display.h
index 34c39a35a8..f1acf839cc 100644
--- a/src/video_output/display.h
+++ b/src/video_output/display.h
@@ -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 *);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 3af016763f..a40cdaed76 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -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,
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index b4251dc79f..473518c2e0 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -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) {
More information about the vlc-commits
mailing list