[vlc-devel] [PATCH] window: add an API to show or hide the cursor over the window

Steve Lhomme robux4 at ycbcr.xyz
Fri Apr 5 08:24:37 CEST 2019


This will allow handling the "mouse-hide-timeout" in the core rather than in
each vout_window_t implementation.
---
 include/vlc_vout_window.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
index 11752116bf..ae872c650b 100644
--- a/include/vlc_vout_window.h
+++ b/include/vlc_vout_window.h
@@ -317,6 +317,7 @@ struct vout_window_operations {
     void (*unset_fullscreen)(struct vout_window_t *);
     void (*set_fullscreen)(struct vout_window_t *, const char *id);
     void (*set_title)(struct vout_window_t *, const char *id);
+    void (*show_cursor)(struct vout_window_t *, bool show);
 };
 
 /**
@@ -501,6 +502,18 @@ static inline void vout_window_SetTitle(vout_window_t *window, const char *title
         window->ops->set_title(window, title);
 }
 
+/**
+ * Show or hide the cursor when the mouse is over this window.
+ *
+ * \param window window to change the title.
+ * \param show show or hide the cursor.
+ */
+static inline void vout_window_ShowCursor(vout_window_t *window, bool show)
+{
+    if (window->ops->show_cursor != NULL)
+        window->ops->show_cursor(window, title);
+}
+
 /**
  * Enables a window.
  *
-- 
2.17.1



More information about the vlc-devel mailing list