[X2Go-Commits] [nx-libs] 02/03: WaitFor.c: insert ugly DPMSDEBUG printf code to find out why exactly this is looping.

git-admin at x2go.org git-admin at x2go.org
Wed Mar 7 03:39:53 CET 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x-rpm-debug
in repository nx-libs.

commit 8a171934397d2452345ab8489b2710d99cd1e0e6
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Mar 7 03:38:40 2018 +0100

    WaitFor.c: insert ugly DPMSDEBUG printf code to find out why exactly this is looping.
---
 nx-X11/programs/Xserver/os/WaitFor.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c
index 9133adf..86a0013 100644
--- a/nx-X11/programs/Xserver/os/WaitFor.c
+++ b/nx-X11/programs/Xserver/os/WaitFor.c
@@ -704,12 +704,16 @@ TimerInit(void)
 #ifdef DPMSExtension
 
 #define DPMS_CHECK_MODE(mode,time)\
-    if (time > 0 && DPMSPowerLevel < mode && timeout >= time)\
-       DPMSSet(mode);
+    if (time > 0 && DPMSPowerLevel < mode && timeout >= time) {\
+       fprintf(stderr, "DPMSDEBUG: Setting DPMS mode to %d\n", mode);\
+       DPMSSet(mode);\
+    }
 
 #define DPMS_CHECK_TIMEOUT(time)\
-    if (time > 0 && (time - timeout) > 0)\
-       return time - timeout;
+    if (time > 0 && (time - timeout) > 0) {\
+       fprintf(stderr, "DPMSDEBUG: Returning time (%d) - timeout (%d) = %d in DPMS timeout check\n", time, timeout, time - timeout);\
+       return time - timeout;\
+    }
 
 static CARD32
 NextDPMSTimeout(INT32 timeout)
@@ -730,6 +734,7 @@ NextDPMSTimeout(INT32 timeout)
            DPMS_CHECK_TIMEOUT(DPMSOffTime)
 
        default: /* DPMSModeOff */
+           fprintf(stderr, "DPMSDEBUG: Returning 0 as next DPMS timeout\n");
            return 0;
     }
 }
@@ -753,36 +758,45 @@ ScreenSaverTimeoutExpire(OsTimerPtr timer,CARD32 now,void * arg)
        DPMS_CHECK_MODE(DPMSModeStandby, DPMSStandbyTime)
 
        nextTimeout = NextDPMSTimeout(timeout);
+       fprintf(stderr, "DPMSDEBUG: Checked all modes, new timeout: %d\n", nextTimeout);
     }
 
     /*
      * Only do the screensaver checks if we're not in a DPMS
      * power saving mode
      */
-    if (DPMSPowerLevel != DPMSModeOn)
+    if (DPMSPowerLevel != DPMSModeOn) {
+       fprintf(stderr, "DPMSDEBUG: not in DPMS mode 'on', returning next timeout %d\n", nextTimeout);
        return nextTimeout;
+    }
 #endif /* DPMSExtension */
 
-    if (!ScreenSaverTime)
+    if (!ScreenSaverTime) {
+       fprintf(stderr, "DPMSDEBUG: no ScreenSaverTime set, returning next timeout %d\n", nextTimeout);
        return nextTimeout;
+    }
 
     if (timeout < ScreenSaverTime)
     {
+       fprintf(stderr, "DPMSDEBUG: nextTimeout %d > 0 %d ? MIN(ScreenSaverTime %d - timeout %d %d, nextTimeout) %d : ScreenSaverTime - timeout %d -- %d\n", nextTimeout, nextTimeout > 0, ScreenSaverTime, timeout, ScreenSaverTime - timeout, MIN(ScreenSaverTime - timeout, nextTimeout), ScreenSaverTime - timeout, nextTimeout > 0 ? MIN(ScreenSaverTime - timeout, nextTimeout) : ScreenSaverTime - timeout);
        return nextTimeout > 0 ?
                MIN(ScreenSaverTime - timeout, nextTimeout) :
                ScreenSaverTime - timeout;
     }
 
     ResetOsBuffers(); /* not ideal, but better than nothing */
+    fprintf(stderr, "DPMSDEBUG: activating screen saver\n");
     SaveScreens(SCREEN_SAVER_ON, ScreenSaverActive);
 
     if (ScreenSaverInterval > 0)
     {
+       fprintf(stderr, "DPMSDEBUG: nextTimeout %d > 0 %d ? MIN(ScreenSaverInterval %d, nextTimeout) %d : ScreenSaverInterval -- %d\n", nextTimeout, nextTimeout > 0, ScreenSaverInterval, MIN(ScreenSaverInterval, nextTimeout), nextTimeout > 0 ? MIN(ScreenSaverInterval, nextTimeout) : ScreenSaverInterval);
        nextTimeout = nextTimeout > 0 ?
                MIN(ScreenSaverInterval, nextTimeout) :
                ScreenSaverInterval;
     }
 
+    fprintf(stderr, "DPMSDEBUG: returning nextTimeout %d\n", nextTimeout);
     return nextTimeout;
 }
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list