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>
This commit is contained in:
parent
623c414765
commit
41d4beb261
|
@ -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,10 +160,16 @@ DPMSSet(ClientPtr client, int level)
|
|||
return Success;
|
||||
|
||||
if (level != DPMSModeOn) {
|
||||
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;
|
||||
}
|
||||
|
||||
/* For each screen, set the DPMS level */
|
||||
for (i = 0; i < xf86NumScreens; i++) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user