Add timeout assert in IdleDetector

CCBUG: 482077
This commit is contained in:
Vlad Zahorodnii 2024-03-08 11:09:42 +02:00
parent 40b8637ab8
commit 18e414443e

View file

@ -7,6 +7,8 @@
#include "idledetector.h"
#include "input.h"
using namespace std::chrono_literals;
namespace KWin
{
@ -14,6 +16,7 @@ IdleDetector::IdleDetector(std::chrono::milliseconds timeout, QObject *parent)
: QObject(parent)
, m_timer(new QTimer(this))
{
Q_ASSERT(timeout >= 0ms);
m_timer->setSingleShot(true);
m_timer->setInterval(timeout);
connect(m_timer, &QTimer::timeout, this, &IdleDetector::markAsIdle);