mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 09:29:29 +00:00
x11_common does not compile, when the XDPMS extension is not available on the
target system. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1346 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5d8d555740
commit
ca79276b20
@ -17,7 +17,9 @@
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#ifdef HAVE_XDPMS
|
||||
#include <X11/extensions/dpms.h>
|
||||
#endif
|
||||
|
||||
static int dpms_disabled=0;
|
||||
static int timeout_save=0;
|
||||
@ -278,6 +280,7 @@ int vo_x11_check_events(Display *mydisplay){
|
||||
|
||||
void saver_on(Display *mDisplay) {
|
||||
|
||||
#ifdef HAVE_XDPMS
|
||||
int nothing;
|
||||
if (dpms_disabled)
|
||||
{
|
||||
@ -298,7 +301,8 @@ void saver_on(Display *mDisplay) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (timeout_save)
|
||||
{
|
||||
int dummy, interval, prefer_blank, allow_exp;
|
||||
@ -311,7 +315,9 @@ void saver_on(Display *mDisplay) {
|
||||
|
||||
void saver_off(Display *mDisplay) {
|
||||
|
||||
int interval, prefer_blank, allow_exp, nothing;
|
||||
int interval, prefer_blank, allow_exp;
|
||||
#ifdef HAVE_XDPMS
|
||||
int nothing;
|
||||
|
||||
if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing))
|
||||
{
|
||||
@ -327,6 +333,7 @@ void saver_off(Display *mDisplay) {
|
||||
printf ("stat: %d\n", stat);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
|
||||
if (timeout_save)
|
||||
XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp);
|
||||
|
Loading…
Reference in New Issue
Block a user