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 <[email protected]>
---
v2: Add check if the screen saving states requires changing before calling 
    dixSaveScreens().

 hw/xfree86/common/xf86DPMS.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
index 3f1e142..881cb27 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;
     }
-- 
1.8.1.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to