Commit 1bd49909 authored by Marco Martin's avatar Marco Martin

fix close button

enabled when it should, also use a qpointer to
remove some crashes
parent 98348f1f
......@@ -146,7 +146,13 @@ void TaskPanel::updateActiveWindow()
if (!m_windowManagement) {
return;
}
if (m_activeWindow) {
disconnect(m_activeWindow, &KWayland::Client::PlasmaWindow::closeableChanged, this, &TaskPanel::hasCloseableActiveWindowChanged);
}
m_activeWindow = m_windowManagement->activeWindow();
connect(m_activeWindow, &KWayland::Client::PlasmaWindow::closeableChanged, this, &TaskPanel::hasCloseableActiveWindowChanged);
// TODO: connect to closeableChanged, not needed right now as KWin doesn't provide this changeable
emit hasCloseableActiveWindowChanged();
}
......
......@@ -82,7 +82,7 @@ private:
KWayland::Client::PlasmaShell *m_shellInterface = nullptr;
KWayland::Client::PlasmaWindowManagement *m_windowManagement = nullptr;
KWayland::Client::PlasmaWindowModel *m_windowModel = nullptr;
KWayland::Client::PlasmaWindow *m_activeWindow = nullptr;
QPointer<KWayland::Client::PlasmaWindow> m_activeWindow;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment