aboutsummaryrefslogtreecommitdiffhomepage
path: root/libvo
diff options
context:
space:
mode:
authorGravatar arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-09 20:15:37 +0000
committerGravatar arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-09 20:15:37 +0000
commit179b2884c7a8e8174606d85fdaf85465d48f289c (patch)
tree6cd2d5e20af64ebbd9bbbf411ec82776b7223bfb /libvo
parent09eaa38fba5db1230eb28b9d2b35945ebff98e35 (diff)
DPMS re-enable patch by Loring Holden
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@742 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/x11_common.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 2a6e25f949..c4d296c92e 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -219,9 +219,19 @@ void saver_on(Display *mDisplay) {
{
if (DPMSQueryExtension(mDisplay, &nothing, &nothing))
{
- printf ("Enabling DPMS\n");
- DPMSEnable(mDisplay); // restoring power saving settings
- DPMSQueryExtension(mDisplay, &nothing, &nothing);
+ if (!DPMSEnable(mDisplay)) { // restoring power saving settings
+ printf("DPMS not available?\n");
+ } else {
+ // DPMS does not seem to be enabled unless we call DPMSInfo
+ BOOL onoff;
+ CARD16 state;
+ DPMSInfo(mDisplay, &state, &onoff);
+ if (onoff) {
+ printf ("Successfully enabled DPMS\n");
+ } else {
+ printf ("Could not enable DPMS\n");
+ }
+ }
}
}
@@ -246,9 +256,11 @@ void saver_off(Display *mDisplay) {
DPMSInfo(mDisplay, &state, &onoff);
if (onoff)
{
+ Status stat;
printf ("Disabling DPMS\n");
dpms_disabled=1;
- DPMSDisable(mDisplay); // monitor powersave off
+ stat = DPMSDisable(mDisplay); // monitor powersave off
+ printf ("stat: %d\n", stat);
}
}
XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);