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

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

parent 8bf2942e
......@@ -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)
{
......
......@@ -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)
......
......@@ -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>
......
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