1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-02-08 01:57:44 +03:00
latte-dock/declarativeimports/core/quickwindowsystem.cpp

59 lines
1.2 KiB
C++
Raw Normal View History

2017-01-02 17:05:30 -05:00
/*
2021-05-27 15:01:00 +00:00
SPDX-FileCopyrightText: 2016 Smith AR <audoban@openmailbox.org>
SPDX-FileCopyrightText: 2016 Michail Vourlakos <mvourlakos@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
2017-01-02 17:05:30 -05:00
*/
#include "quickwindowsystem.h"
2018-12-02 02:05:52 +02:00
// Qt
#include <QDebug>
2017-03-12 20:56:03 -05:00
2018-12-02 02:05:52 +02:00
// X11
#include <KWindowSystem>
2016-12-25 21:28:00 +02:00
namespace Latte {
2017-03-12 20:56:03 -05:00
QuickWindowSystem::QuickWindowSystem(QObject *parent)
: QObject(parent)
{
2016-12-30 16:25:27 -05:00
if (KWindowSystem::isPlatformWayland()) {
2017-01-01 18:50:51 -05:00
//! TODO: Wayland compositing active
m_compositing = true;
2016-12-30 16:25:27 -05:00
} else {
2017-01-01 18:50:51 -05:00
connect(KWindowSystem::self(), &KWindowSystem::compositingChanged
, this, [&](bool enabled) {
if (m_compositing == enabled)
return;
m_compositing = enabled;
emit compositingChanged();
});
m_compositing = KWindowSystem::compositingActive();
}
}
QuickWindowSystem::~QuickWindowSystem()
2017-01-29 00:16:28 -05:00
{
qDebug() << staticMetaObject.className() << "destructed";
2017-01-29 00:16:28 -05:00
}
bool QuickWindowSystem::compositingActive() const
{
return m_compositing;
}
2018-03-02 21:17:16 +02:00
bool QuickWindowSystem::isPlatformWayland() const
{
return KWindowSystem::isPlatformWayland();
}
bool QuickWindowSystem::isPlatformX11() const
{
return KWindowSystem::isPlatformX11();
}
} //end of namespace