mirror of https://github.com/mpv-player/mpv
x11: drop xscrnsaver use
It's an ancient X11 protocol extension that apparently nobody uses anymore (desktop environments in particular have replaced it with equally bad protocols that require tons of dependencies). Users keep complaining about it being a required dependency. The impact is likely minimal to none. Fixes #4706 and other annoying people.
This commit is contained in:
parent
a434892208
commit
3f75b3c343
|
@ -96,7 +96,7 @@ Example:
|
||||||
Essential dependencies (incomplete list):
|
Essential dependencies (incomplete list):
|
||||||
|
|
||||||
- gcc or clang
|
- gcc or clang
|
||||||
- X development headers (xlib, xrandr, xext, xscrnsaver, xinerama, libvdpau,
|
- X development headers (xlib, xrandr, xext, xinerama, libvdpau,
|
||||||
libGL, GLX, EGL, xv, ...)
|
libGL, GLX, EGL, xv, ...)
|
||||||
- Audio output development headers (libasound/ALSA, pulseaudio)
|
- Audio output development headers (libasound/ALSA, pulseaudio)
|
||||||
- FFmpeg libraries (libavutil libavcodec libavformat libswscale libavfilter
|
- FFmpeg libraries (libavutil libavcodec libavformat libswscale libavfilter
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
#include <X11/XF86keysym.h>
|
#include <X11/XF86keysym.h>
|
||||||
|
|
||||||
#include <X11/extensions/scrnsaver.h>
|
|
||||||
#include <X11/extensions/dpms.h>
|
#include <X11/extensions/dpms.h>
|
||||||
#include <X11/extensions/Xinerama.h>
|
#include <X11/extensions/Xinerama.h>
|
||||||
#include <X11/extensions/Xrandr.h>
|
#include <X11/extensions/Xrandr.h>
|
||||||
|
@ -1908,22 +1907,9 @@ static void xscreensaver_heartbeat(struct vo_x11_state *x11)
|
||||||
{
|
{
|
||||||
x11->screensaver_time_last = time;
|
x11->screensaver_time_last = time;
|
||||||
sem_post(&x11->screensaver_sem);
|
sem_post(&x11->screensaver_sem);
|
||||||
XResetScreenSaver(x11->display);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xss_suspend(Display *mDisplay, Bool suspend)
|
|
||||||
{
|
|
||||||
int event, error, major, minor;
|
|
||||||
if (XScreenSaverQueryExtension(mDisplay, &event, &error) != True ||
|
|
||||||
XScreenSaverQueryVersion(mDisplay, &major, &minor) != True)
|
|
||||||
return 0;
|
|
||||||
if (major < 1 || (major == 1 && minor < 1))
|
|
||||||
return 0;
|
|
||||||
XScreenSaverSuspend(mDisplay, suspend);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void set_screensaver(struct vo_x11_state *x11, bool enabled)
|
static void set_screensaver(struct vo_x11_state *x11, bool enabled)
|
||||||
{
|
{
|
||||||
Display *mDisplay = x11->display;
|
Display *mDisplay = x11->display;
|
||||||
|
@ -1931,8 +1917,6 @@ static void set_screensaver(struct vo_x11_state *x11, bool enabled)
|
||||||
return;
|
return;
|
||||||
MP_VERBOSE(x11, "%s screensaver.\n", enabled ? "Enabling" : "Disabling");
|
MP_VERBOSE(x11, "%s screensaver.\n", enabled ? "Enabling" : "Disabling");
|
||||||
x11->screensaver_enabled = enabled;
|
x11->screensaver_enabled = enabled;
|
||||||
if (xss_suspend(mDisplay, !enabled))
|
|
||||||
return;
|
|
||||||
int nothing;
|
int nothing;
|
||||||
if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) {
|
if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) {
|
||||||
BOOL onoff = 0;
|
BOOL onoff = 0;
|
||||||
|
|
1
wscript
1
wscript
|
@ -578,7 +578,6 @@ video_output_features = [
|
||||||
'name': '--x11',
|
'name': '--x11',
|
||||||
'desc': 'X11',
|
'desc': 'X11',
|
||||||
'func': check_pkg_config('x11', '>= 1.0.0',
|
'func': check_pkg_config('x11', '>= 1.0.0',
|
||||||
'xscrnsaver', '>= 1.0.0',
|
|
||||||
'xext', '>= 1.0.0',
|
'xext', '>= 1.0.0',
|
||||||
'xinerama', '>= 1.0.0',
|
'xinerama', '>= 1.0.0',
|
||||||
'xrandr', '>= 1.2.0'),
|
'xrandr', '>= 1.2.0'),
|
||||||
|
|
Loading…
Reference in New Issue