Changeset View
Changeset View
Standalone View
Standalone View
applets/showdesktop/plugin/showdesktop.cpp
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2008 Petri Damsten <damu@iki.fi> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2 of | ||||
7 | * the License, or (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU General Public License | ||||
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
16 | */ | ||||
17 | | ||||
18 | #include "showdesktop.h" | ||||
19 | | ||||
20 | #include <KWindowSystem> | ||||
21 | | ||||
22 | ShowDesktop::ShowDesktop(QObject *parent) : QObject(parent) | ||||
23 | { | ||||
24 | connect(KWindowSystem::self(), &KWindowSystem::showingDesktopChanged, | ||||
25 | this, &ShowDesktop::showingDesktopChanged); | ||||
26 | } | ||||
27 | | ||||
28 | ShowDesktop::~ShowDesktop() = default; | ||||
29 | | ||||
30 | bool ShowDesktop::showingDesktop() const | ||||
31 | { | ||||
32 | return KWindowSystem::showingDesktop(); | ||||
33 | } | ||||
34 | | ||||
35 | void ShowDesktop::setShowingDesktop(bool showingDesktop) | ||||
36 | { | ||||
37 | KWindowSystem::setShowingDesktop(showingDesktop); | ||||
38 | } | ||||
39 | | ||||
40 | void ShowDesktop::minimizeAll() | ||||
41 | { | ||||
42 | const auto &windows = KWindowSystem::windows(); | ||||
43 | for (WId wid : windows) { | ||||
44 | KWindowSystem::minimizeWindow(wid); | ||||
45 | } | ||||
46 | } |