summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEgbert Eich <eich@freedesktop.org>2013-08-14 11:50:26 +0200
committerKeith Packard <keithp@keithp.com>2013-10-31 18:31:18 -0700
commit41d4beb2616ceb3f1a1b8694733e85bae70de59a (patch)
tree377205e4f86f6bacd216726ba59bbf6224db8bd4 /hw
parent623c4147650d0404cfbea0f9b7df66dc7d928e00 (diff)
DDX/DPMS: Call dixSaveScreens() also when screen is turned on
DMPS calls dixSaveScreens() when turned off but not when turned on. In most cases this is irrelevant as DPMS is done when a key is hit in which case dixSaveScreens() will be called to unblank anyhow. This isn't the case if we use xset (or the DPMS extension directly) to unblank. Check screenIsSaved to make sure the state needs to be changed before calling dixSaveScreens(). Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86DPMS.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
index 3f1e142c7..881cb2773 100644
--- a/hw/xfree86/common/xf86DPMS.c
+++ b/hw/xfree86/common/xf86DPMS.c
@@ -36,6 +36,7 @@
#include <X11/X.h>
#include "os.h"
#include "globals.h"
+#include "windowstr.h"
#include "xf86.h"
#include "xf86Priv.h"
#ifdef DPMSExtension
@@ -159,7 +160,13 @@ DPMSSet(ClientPtr client, int level)
return Success;
if (level != DPMSModeOn) {
- rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverActive);
+ if (xf86IsUnblank(screenIsSaved)) {
+ rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverActive);
+ if (rc != Success)
+ return rc;
+ }
+ } else if (!xf86IsUnblank(screenIsSaved)) {
+ rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverReset);
if (rc != Success)
return rc;
}