mirror of
https://github.com/mpv-player/mpv
synced 2025-01-16 22:37:28 +01:00
DPMS re-enable patch by Loring Holden
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@742 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
09eaa38fba
commit
179b2884c7
@ -219,9 +219,19 @@ void saver_on(Display *mDisplay) {
|
|||||||
{
|
{
|
||||||
if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing))
|
if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing))
|
||||||
{
|
{
|
||||||
printf ("Enabling DPMS\n");
|
if (!DPMSEnable(mDisplay)) { // restoring power saving settings
|
||||||
DPMSEnable(mDisplay); // restoring power saving settings
|
printf("DPMS not available?\n");
|
||||||
DPMSQueryExtension(mDisplay, ¬hing, ¬hing);
|
} 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);
|
DPMSInfo(mDisplay, &state, &onoff);
|
||||||
if (onoff)
|
if (onoff)
|
||||||
{
|
{
|
||||||
|
Status stat;
|
||||||
printf ("Disabling DPMS\n");
|
printf ("Disabling DPMS\n");
|
||||||
dpms_disabled=1;
|
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);
|
XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
|
||||||
|
Loading…
Reference in New Issue
Block a user