//update the id of displaced desktops
for (uint i = actualNumber; i < (uint)m_desktops.count();Currently, ++i) {
m_desktops[i]->setX11DesktopNumber(i + 1);
if (m_rootInfo) {there are several issues with
m_rootInfo->setVirtualDesktopManager::createVirtualDesktopName(i + 1, m_desktops[i]->name().toUtf8().data());
}:
(a) The method expects the number parameter to be in range [1, count + 1],
}
Assumes that the new virtual desktop has been already inserted at
`actualDesktop - 1`, but because that's not the casebut we pass [0, several virtualcount];
desktops can start sharing a single id(b) It doesn't correctly update X11 desktop numbers.
That in its turn breaks some assumptions in removeVirtualDesktop, which
can lead to a crash later onThis change tries to address all previously mentioned issues.
BUG: 403312
FIXED-IN: 5.15.0