From f91271b29e628218b5914b496dbd47374cded4e8 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 16 Nov 2020 15:30:50 +0000 Subject: [PATCH] Allow small timeout intervals in IdleInterface A threshold exists to stop users flooding the server for no reason. However, there is a usecase for small timeouts. rsibreak has a "please relax for 20 seconds" interface. Here it makes perfect sense to know if a user is active in small increments. The plan is to start a 1s timer and wait for that. Then we wait locally for 20s without a resume event. --- src/wayland/idle_interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wayland/idle_interface.cpp b/src/wayland/idle_interface.cpp index 84c6e38752..8842686bac 100644 --- a/src/wayland/idle_interface.cpp +++ b/src/wayland/idle_interface.cpp @@ -144,8 +144,8 @@ void IdleTimeoutInterface::setup(quint32 timeout) } timer = new QTimer(this); timer->setSingleShot(true); - // less than 5 sec is not idle by definition - timer->setInterval(qMax(timeout, 5000u)); + // less than 500 msec is not idle by definition + timer->setInterval(qMax(timeout, 500u)); QObject::connect(timer, &QTimer::timeout, this, [this] { send_idle();