Reload VirtualDesktop settings after passing RootInfo on VirtualDesktopManager

Summary:
The load method and updateLayout ensure the virtual desktop information
is synced to RootInfo and thus to other X11 applications. Thus we need
to call it again when initing X11.

BUG: 385260

Test Plan: Not tested as I'm on Wayland, but given the changes it's obvious.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8086
This commit is contained in:
Martin Flöser 2017-10-01 15:37:41 +02:00
parent 371ad57abd
commit f988a5f654
2 changed files with 10 additions and 5 deletions

View file

@ -263,6 +263,11 @@ public:
**/
VirtualDesktop *desktopForX11Id(uint id) const;
/**
* Updates the net root info for new number of desktops
**/
void updateRootInfo();
/**
* @returns The maximum number of desktops that KWin supports.
*/
@ -410,10 +415,6 @@ private:
* Generate a desktop layout from EWMH _NET_DESKTOP_LAYOUT property parameters.
*/
void setNETDesktopLayout(Qt::Orientation orientation, uint width, uint height, int startingCorner);
/**
* Updates the net root info for new number of desktops
**/
void updateRootInfo();
/**
* @returns A default name for the given @p desktop
**/

View file

@ -387,7 +387,11 @@ void Workspace::initWithX11()
m_nullFocus->map();
RootInfo *rootInfo = RootInfo::create();
VirtualDesktopManager::self()->setRootInfo(rootInfo);
const auto vds = VirtualDesktopManager::self();
vds->setRootInfo(rootInfo);
// load again to sync to RootInfo, see BUG 385260
vds->load();
vds->updateRootInfo();
// TODO: only in X11 mode
// Extra NETRootInfo instance in Client mode is needed to get the values of the properties