From dd12040ebe7c4006eab56c0d4a18d495274cf37d Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 15 Apr 2015 22:39:01 +0200 Subject: x11: actually disable screensaver We already use 2 screensaver APIs when attempting to disable the screensaver: XResetScreenSaver() (from xlib) and XScreenSaverSuspend (from the X11 Screen Saver extension). None of these actually work. On modern desktop Linux, we are expected to make dbus calls using some freedesktop-defined protocol (and possibly we'd have to fallback to a Gnome specific one). At least xscreensaver doesn't respect the "old" APIs either. Solve this by running the xdg-screensaver script. It's a terrible, ugly piece of shit (just read the script if you disagree), but at least it appears to work everywhere. It's also simpler than involving various dbus client libraries. I hope this can replace the --heartbeat-cmd option, and maybe we could remove our own DPMS/XSS code too. --- video/out/x11_common.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'video/out/x11_common.h') diff --git a/video/out/x11_common.h b/video/out/x11_common.h index f6d73dae00..eeff773bef 100644 --- a/video/out/x11_common.h +++ b/video/out/x11_common.h @@ -20,9 +20,12 @@ #include #include +#include #include #include +#include "osdep/semaphore.h" + #include "common/common.h" struct vo; @@ -57,6 +60,9 @@ struct vo_x11_state { bool screensaver_enabled; bool dpms_touched; double screensaver_time_last; + pthread_t screensaver_thread; + sem_t screensaver_sem; + struct mp_cancel *screensaver_terminate; XIM xim; XIC xic; -- cgit v1.2.3