From bd7aa4abfae5ed5bc21ff92be1698cef94da3020 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 14 May 2019 15:34:50 +0200 Subject: Fix DPMS timeout calculation --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 3501f5a..312c16d 100644 --- a/src/main.c +++ b/src/main.c @@ -143,7 +143,7 @@ int main( int argc, char **argv ) int want = SCREEN_UNKNOWN; if ( config.logoutTimeout > 0 && idleTime + 300 > config.logoutTimeout ) { want = SCREEN_ON; - } else if ( ! nextAction.disarmed && nextAction.deadline != 0 && monoNOW - nextAction.deadline < 300 ) { + } else if ( ! nextAction.disarmed && nextAction.deadline != 0 && nextAction.deadline - monoNOW < 300 ) { want = SCREEN_ON; } else if ( idleTime > config.dpmsTimeout && screen.idleSeconds >= 60 ) { want = SCREEN_OFF; -- cgit v1.2.3-55-g7522