ff4ff35918
Red Bear OS is a full fork. All sources must be available from git clone with zero network access. Removed gitignore rules that excluded fetched source trees under recipes/*/source/, local/recipes/kde/*/source/, local/recipes/qt/*/source/, and vendor source trees. Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded. 127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt frameworks, mesa, wayland, DRM drivers, and every other recipe source.
48 lines
833 B
C++
48 lines
833 B
C++
/*
|
|
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <kwin_export.h>
|
|
|
|
#include <QBasicTimer>
|
|
#include <QObject>
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
class KWIN_EXPORT IdleDetector : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit IdleDetector(std::chrono::milliseconds timeout, QObject *parent = nullptr);
|
|
~IdleDetector() override;
|
|
|
|
void activity();
|
|
|
|
bool isInhibited() const;
|
|
void setInhibited(bool inhibited);
|
|
|
|
Q_SIGNALS:
|
|
void idle();
|
|
void resumed();
|
|
|
|
protected:
|
|
void timerEvent(QTimerEvent *event) override;
|
|
|
|
private:
|
|
void markAsIdle();
|
|
void markAsResumed();
|
|
|
|
QBasicTimer m_timer;
|
|
std::chrono::milliseconds m_timeout;
|
|
bool m_isIdle = false;
|
|
bool m_isInhibited = false;
|
|
};
|
|
|
|
} // namespace KWin
|