activeWindow can be null

this is possible in case kwin switches around to another active window
This commit is contained in:
Bhushan Shah 2016-08-25 13:52:28 +05:30
parent c81bed39bc
commit 52e52c7e90

View file

@ -141,9 +141,11 @@ void TaskPanel::updateActiveWindow()
}
m_activeWindow = m_windowManagement->activeWindow();
connect(m_activeWindow.data(), &KWayland::Client::PlasmaWindow::closeableChanged, this, &TaskPanel::hasCloseableActiveWindowChanged);
connect(m_activeWindow.data(), &KWayland::Client::PlasmaWindow::unmapped,
this, &TaskPanel::forgetActiveWindow);
if (m_activeWindow) {
connect(m_activeWindow.data(), &KWayland::Client::PlasmaWindow::closeableChanged, this, &TaskPanel::hasCloseableActiveWindowChanged);
connect(m_activeWindow.data(), &KWayland::Client::PlasmaWindow::unmapped,
this, &TaskPanel::forgetActiveWindow);
}
// TODO: connect to closeableChanged, not needed right now as KWin doesn't provide this changeable
emit hasCloseableActiveWindowChanged();