improved portability to wayland

v0.6
audoban 8 years ago
parent 756bf19fa6
commit f02dd9e592

@ -8,32 +8,35 @@ WindowSystem::WindowSystem(QObject *parent) :
QObject(parent)
{
if (KWindowSystem::isPlatformWayland()) {
//! TODO: Wayland compositing
} else {
compositingChangedProxy(KWindowSystem::self()->compositingActive());
connect(KWindowSystem::self(), SIGNAL(compositingChanged(bool))
, this, SLOT(compositingChangedProxy(bool)));
connect(KWindowSystem::self(), SIGNAL(compositingChanged(bool)), this, SLOT(compositingChanged(bool)));
}
}
WindowSystem &WindowSystem::self()
WindowSystem::~WindowSystem()
{
static WindowSystem wm;
return wm;
}
WindowSystem::~WindowSystem()
WindowSystem &WindowSystem::self()
{
static WindowSystem ws;
return ws;
}
bool WindowSystem::compositingActive() const
{
return m_enabled;
return m_compositing;
}
void WindowSystem::compositingChangedProxy(bool enabled)
void WindowSystem::compositingChangedProxy(bool enable)
{
m_enabled = enabled;
if (m_compositing == enable)
return;
m_compositing = enable;
emit compositingChanged();
}

@ -11,10 +11,10 @@ class WindowSystem : public QObject {
Q_PROPERTY(bool compositingActive READ compositingActive NOTIFY compositingChanged)
public:
explicit WindowSystem(QObject *parent = nullptr);
explicit WindowSystem(QObject *parent = Q_NULLPTR);
~WindowSystem();
static WindowSystem &self();
~WindowSystem();
bool compositingActive() const;
@ -22,10 +22,10 @@ signals:
void compositingChanged();
private slots:
void compositingChangedProxy(bool enabled);
void compositingChangedProxy(bool state);
private:
bool m_enabled{false};
bool m_compositing{false};
};
}//LatteDock namespace

Loading…
Cancel
Save