Keep _NET_DESKTOP_NAMES in sync

Summary:
We have to connect to nameChanged even if m_rootInfo is not set yet,
otherwise names in _NET_DESKTOP_NAMES won't be kept in sync if
a virtual desktop is renamed.

CCBUG: 403307

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18503
This commit is contained in:
Vlad Zagorodniy 2019-01-24 18:18:49 +02:00
parent 45719a25db
commit 8fd0418187

View file

@ -590,14 +590,14 @@ void VirtualDesktopManager::setCount(uint count)
}
m_desktops << vd;
newDesktops << vd;
if (m_rootInfo) {
connect(vd, &VirtualDesktop::nameChanged, this,
[this, vd]() {
if (m_rootInfo) {
m_rootInfo->setDesktopName(vd->x11DesktopNumber(), vd->name().toUtf8().data());
}
connect(vd, &VirtualDesktop::nameChanged, this,
[this, vd] {
if (m_rootInfo) {
m_rootInfo->setDesktopName(vd->x11DesktopNumber(), vd->name().toUtf8().data());
}
);
}
);
if (m_rootInfo) {
m_rootInfo->setDesktopName(vd->x11DesktopNumber(), vd->name().toUtf8().data());
}
}