[vlc-commits] window: deinhibit the screensaver on pause (fixes #3724)

Rémi Denis-Courmont git at videolan.org
Sun Aug 6 20:27:54 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Aug  6 18:47:16 2017 +0300| [e0a109bcdfcdd0cb6f37affa73f49ebc06dfc3c3] | committer: Rémi Denis-Courmont

window: deinhibit the screensaver on pause (fixes #3724)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e0a109bcdfcdd0cb6f37affa73f49ebc06dfc3c3
---

 include/vlc_vout_window.h       |  2 ++
 src/video_output/video_output.c |  4 ++++
 src/video_output/window.c       | 10 +++++++++-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
index f9a2a7dfa3..3a613d4e47 100644
--- a/include/vlc_vout_window.h
+++ b/include/vlc_vout_window.h
@@ -216,6 +216,8 @@ VLC_API vout_window_t * vout_window_New(vlc_object_t *, const char *module, cons
  */
 VLC_API void vout_window_Delete(vout_window_t *);
 
+void vout_window_SetInhibition(vout_window_t *window, bool enabled);
+
 static inline int vout_window_vaControl(vout_window_t *window, int query,
                                         va_list ap)
 {
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 471dfcf7e1..be1249a2b2 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1225,6 +1225,10 @@ static void ThreadChangePause(vout_thread_t *vout, bool is_paused, mtime_t date)
     }
     vout->p->pause.is_on = is_paused;
     vout->p->pause.date  = date;
+
+    vout_window_t *window = vout->p->window;
+    if (window != NULL)
+        vout_window_SetInhibition(window, !is_paused);
 }
 
 static void ThreadFlush(vout_thread_t *vout, bool below, mtime_t date)
diff --git a/src/video_output/window.c b/src/video_output/window.c
index bd43592edb..c5e8bef33b 100644
--- a/src/video_output/window.c
+++ b/src/video_output/window.c
@@ -82,7 +82,6 @@ vout_window_t *vout_window_New(vlc_object_t *obj, const char *module,
         w->inhibit = vlc_inhibit_Create(VLC_OBJECT (window));
         if (w->inhibit != NULL)
             vlc_inhibit_Set(w->inhibit, VLC_INHIBIT_VIDEO);
-            /* FIXME: ^ wait for vout activation, pause */
     }
     else
         w->inhibit = NULL;
@@ -113,6 +112,15 @@ void vout_window_Delete(vout_window_t *window)
     vlc_object_release(window);
 }
 
+void vout_window_SetInhibition(vout_window_t *window, bool enabled)
+{
+    window_t *w = (window_t *)window;
+    unsigned flags = enabled ? VLC_INHIBIT_VIDEO : VLC_INHIBIT_NONE;
+
+    if (w->inhibit != NULL)
+        vlc_inhibit_Set(w->inhibit, flags);
+}
+
 /* Video output display integration */
 #include <vlc_vout.h>
 #include <vlc_vout_display.h>



More information about the vlc-commits mailing list