From 8fd0418187484673e6682b96e93850d0cc1553a5 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Thu, 24 Jan 2019 18:18:49 +0200 Subject: [PATCH] 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 --- virtualdesktops.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/virtualdesktops.cpp b/virtualdesktops.cpp index aba80c2a77..086af5cead 100644 --- a/virtualdesktops.cpp +++ b/virtualdesktops.cpp @@ -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()); } }