D18328: Correctly update X11 desktop ids

Vlad Zagorodniy <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
zzag created this revision.
zzag added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
zzag requested review of this revision.

REVISION SUMMARY
    //update the id of displaced desktops
    for (uint i = actualNumber; i < (uint)m_desktops.count(); ++i) {
        m_desktops[i]->setX11DesktopNumber(i + 1);
        if (m_rootInfo) {
            m_rootInfo->setDesktopName(i + 1, m_desktops[i]->name().toUtf8().data());
        }
    }
  
  Assumes that the new virtual desktop has been already inserted at
  `actualDesktop - 1`, but because that's not the case, several virtual
  desktops can start sharing a single id.
  
  That in its turn breaks some assumptions in removeVirtualDesktop, which
  can lead later on to a crash.
  
  BUG: 403312

TEST PLAN
  No longer able to reproduce bug 403312.

REPOSITORY
  R108 KWin

BRANCH
  correctly-update-x11-desktop-ids

REVISION DETAIL
  https://phabricator.kde.org/D18328

AFFECTED FILES
  virtualdesktops.cpp

To: zzag, #kwin
Cc: kwin, jraleigh, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, ngraham, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.