fix close button

enabled when it should, also use a qpointer to
remove some crashes
This commit is contained in:
Marco Martin 2016-01-05 17:29:43 +01:00
parent 98348f1fa1
commit 1bd4990984
2 changed files with 7 additions and 1 deletions

View file

@ -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();
}

View file

@ -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