Add timeout assert in IdleDetector
CCBUG: 482077
This commit is contained in:
parent
40b8637ab8
commit
18e414443e
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue