From 3b5b7ef5c2ab1d196806f6359e0972fd78d204dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 3 Jan 2007 21:05:35 +0100 Subject: [PATCH] Move the code for resetting the DPMS mode in response to input events, from WaitForSomething to mieqProcessInputEvents. mieqProcessInputEvents already handles resetting the screen saver. --- mi/mieq.c | 13 +++++++++++++ os/WaitFor.c | 5 +---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mi/mieq.c b/mi/mieq.c index 80915fd73..507cdd337 100644 --- a/mi/mieq.c +++ b/mi/mieq.c @@ -52,6 +52,12 @@ in this Software without prior written authorization from The Open Group. # include "extinit.h" # include "exglobals.h" +#ifdef DPMSExtension +# include "dpmsproc.h" +# define DPMS_SERVER +# include +#endif + #define QUEUE_SIZE 256 typedef struct _Event { @@ -183,6 +189,13 @@ mieqProcessInputEvents() while (miEventQueue.head != miEventQueue.tail) { if (screenIsSaved == SCREEN_SAVER_ON) SaveScreens (SCREEN_SAVER_OFF, ScreenSaverReset); +#ifdef DPMSExtension + else if (DPMSPowerLevel != DPMSModeOn) + SetScreenSaverTimer(); + + if (DPMSPowerLevel != DPMSModeOn) + DPMSSet(DPMSModeOn); +#endif e = &miEventQueue.events[miEventQueue.head]; /* Assumption - screen switching can only occur on motion events. */ diff --git a/os/WaitFor.c b/os/WaitFor.c index ba227a3b6..d39964f30 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -337,10 +337,7 @@ WaitForSomething(int *pClientsReady) if (XFD_ANYSET(&tmp_set)) QueueWorkProc(EstablishNewConnections, NULL, (pointer)&LastSelectMask); -#ifdef DPMSExtension - if (XFD_ANYSET (&devicesReadable) && (DPMSPowerLevel != DPMSModeOn)) - DPMSSet(DPMSModeOn); -#endif + if (XFD_ANYSET (&devicesReadable) || XFD_ANYSET (&clientsReadable)) break; #ifdef WIN32