summaryrefslogtreecommitdiffstats
path: root/video/out/x11_common.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-15 22:39:01 +0200
committerwm4 <wm4@nowhere>2015-04-15 22:40:19 +0200
commitdd12040ebe7c4006eab56c0d4a18d495274cf37d (patch)
tree83c0ce18519280a650ed34ef8df48f567cb4544e /video/out/x11_common.h
parente6d7e550125873f46126f3d23c4970df1976a269 (diff)
downloadmpv-dd12040ebe7c4006eab56c0d4a18d495274cf37d.tar.bz2
mpv-dd12040ebe7c4006eab56c0d4a18d495274cf37d.tar.xz
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.
Diffstat (limited to 'video/out/x11_common.h')
-rw-r--r--video/out/x11_common.h6
1 files changed, 6 insertions, 0 deletions
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 <stdint.h>
#include <stdbool.h>
+#include <pthread.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
+#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;