Make NETRootInfo initialization reasonable

The documentation of NETRootInfo::activate() says that it should be
called after creating the NETRootInfo object to read properties.

However, it's called in two places: VirtualDesktopManager::setRows()
and Workspace::initializeX11(). At quick glance, there's no justifying
reason to call activate() in setRows(), it doesn't fit the purpose
of setRows().

This change re-arranges NETRootInfo initialization code so it makes
more sense.
wilder/Plasma/6.2
Vlad Zahorodnii 2 years ago
parent 993f110d59
commit 8b29f07dbe
  1. 1
      src/virtualdesktops.cpp
  2. 3
      src/workspace.cpp

@ -610,7 +610,6 @@ void VirtualDesktopManager::setRows(uint rows)
}
if (m_rootInfo) {
m_rootInfo->setDesktopLayout(NET::OrientationHorizontal, columns, m_rows, NET::DesktopLayoutCornerTopLeft);
m_rootInfo->activate();
}
updateLayout();

@ -303,9 +303,10 @@ void Workspace::initializeX11()
m_nullFocus->map();
RootInfo *rootInfo = RootInfo::create();
rootInfo->activate();
const auto vds = VirtualDesktopManager::self();
vds->setRootInfo(rootInfo);
rootInfo->activate();
// TODO: only in X11 mode
// Extra NETRootInfo instance in Client mode is needed to get the values of the properties

Loading…
Cancel
Save