Make VirtualDesktopManager update grid dimentions when only 1 desktop
This is a patch to get the last two commits to work. A larger problem to fix is that when the desktop grid size is changed in the KCM by removing desktops, the internal grid dimensions are not updated until system restart.
This commit is contained in:
parent
003c820e00
commit
c09871917b
1 changed files with 8 additions and 1 deletions
|
@ -502,9 +502,9 @@ void VirtualDesktopManager::removeVirtualDesktop(VirtualDesktop *desktop)
|
||||||
Q_EMIT currentChanged(oldCurrent, newCurrent);
|
Q_EMIT currentChanged(oldCurrent, newCurrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateRootInfo();
|
||||||
save();
|
save();
|
||||||
|
|
||||||
updateRootInfo();
|
|
||||||
Q_EMIT desktopRemoved(desktop);
|
Q_EMIT desktopRemoved(desktop);
|
||||||
Q_EMIT countChanged(m_desktops.count() + 1, m_desktops.count());
|
Q_EMIT countChanged(m_desktops.count() + 1, m_desktops.count());
|
||||||
|
|
||||||
|
@ -661,6 +661,13 @@ void VirtualDesktopManager::updateLayout()
|
||||||
m_rows = count() == 1u ? 1 : 2;
|
m_rows = count() == 1u ? 1 : 2;
|
||||||
columns = count() / m_rows;
|
columns = count() / m_rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Patch to make desktop grid size equal 1 when 1 desktop for desktop switching animations
|
||||||
|
if (m_desktops.size() == 1) {
|
||||||
|
m_rows = 1;
|
||||||
|
columns = 1;
|
||||||
|
}
|
||||||
|
|
||||||
setNETDesktopLayout(orientation,
|
setNETDesktopLayout(orientation,
|
||||||
columns, m_rows, 0 // rootInfo->desktopLayoutCorner() // Not really worth implementing right now.
|
columns, m_rows, 0 // rootInfo->desktopLayoutCorner() // Not really worth implementing right now.
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue