KWin
Loading...
Searching...
No Matches
idle_inhibition.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2017 Martin Flöser <mgraesslin@kde.org>
6 SPDX-FileCopyrightText: 2018 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10#pragma once
11
12#include <QList>
13#include <QMap>
14#include <QObject>
15
16namespace KWin
17{
18class Window;
19
20class IdleInhibition : public QObject
21{
22 Q_OBJECT
23public:
24 explicit IdleInhibition(QObject *parent = nullptr);
25 ~IdleInhibition() override;
26
27 void registerClient(Window *client);
28
29private Q_SLOTS:
30 void slotWorkspaceCreated();
31 void slotDesktopChanged();
32
33private:
34 void inhibit(Window *client);
35 void uninhibit(Window *client);
36 void update(Window *client);
37
38 QMap<Window *, QMetaObject::Connection> m_connections;
39};
40}
void registerClient(Window *client)
IdleInhibition(QObject *parent=nullptr)
~IdleInhibition() override