From 6307e6fc72f3cd748c9dc0e601a87171131309ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Thu, 9 Feb 2017 21:28:12 +0000 Subject: Move the code for resetting the DPMS mode in response to input events, from WaitForSomething to mieqProcessInputEvents. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backported from X.org: commit 3b5b7ef5c2ab1d196806f6359e0972fd78d204dd Author: Fredrik Höglund Date: Wed Jan 3 21:05:35 2007 +0100 Move the code for resetting the DPMS mode in response to input events, from WaitForSomething to mieqProcessInputEvents. mieqProcessInputEvents already handles resetting the screen saver. Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/mi/mieq.c | 14 ++++++++++++++ nx-X11/programs/Xserver/os/WaitFor.c | 4 ---- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'nx-X11/programs') diff --git a/nx-X11/programs/Xserver/mi/mieq.c b/nx-X11/programs/Xserver/mi/mieq.c index b5d9baa31..fefb222c4 100644 --- a/nx-X11/programs/Xserver/mi/mieq.c +++ b/nx-X11/programs/Xserver/mi/mieq.c @@ -43,6 +43,12 @@ in this Software without prior written authorization from The Open Group. # include "mi.h" # include "scrnintstr.h" +#ifdef DPMSExtension +# include "dpmsproc.h" +# define DPMS_SERVER +# include +#endif + #define QUEUE_SIZE 256 typedef struct _Event { @@ -151,6 +157,14 @@ void mieqProcessInputEvents () 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/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c index 19a1b9809..d94ada1d5 100644 --- a/nx-X11/programs/Xserver/os/WaitFor.c +++ b/nx-X11/programs/Xserver/os/WaitFor.c @@ -509,10 +509,6 @@ WaitForSomething(int *pClientsReady) if (XFD_ANYSET(&tmp_set)) HandleNotifyFds(); -#ifdef DPMSExtension - if (XFD_ANYSET (&devicesReadable) && (DPMSPowerLevel != DPMSModeOn)) - DPMSSet(DPMSModeOn); -#endif if (XFD_ANYSET (&devicesReadable) || XFD_ANYSET (&clientsReadable)) break; #ifdef WIN32 -- cgit v1.2.3