Bug 455287

Summary: systemstettings: "virtual desktops" never reach default state
Product: [Applications] systemsettings Reporter: Stefan <meniskus>
Component: kcm_kwinvirtualdesktopsAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: kde, nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: systemsettings "virtual desktops" never reach there default state

Description Stefan 2022-06-14 22:03:46 UTC
Created attachment 149717 [details]
systemsettings "virtual desktops" never reach there default state

SUMMARY

systemsettings: the orange dot is always visible. Its not possible to set "virtual desktops" back to preset state.

Default is one Desktop and two rows.  But setting rows to the preset value of two is not possible if there is only one desktop. 

STEPS TO REPRODUCE
- Open Systemsettings > "Virual Desktops"
- reduce desktops to one
- set rows to two
- apply changes

OBSERVED RESULT

The orange persists, because the value of "rows" is still "1".

EXPECTED RESULT

the orange dot disappear, because the value of "rows" is now "2"


SOFTWARE/OS VERSIONS
Betriebssystem: openSUSE Tumbleweed 20220613
KDE-Plasma-Version: 5.25.0
KDE-Frameworks-Version: 5.94.0
Qt-Version: 5.15.2
Comment 1 David Redondo 2022-06-15 07:32:32 UTC
In KWIN:
void VirtualDesktopManager::setRows(uint rows)
{
    if (rows == 0 || rows > count() || rows == m_rows) {
        return;
    }
Comment 2 Stefan 2022-06-15 07:54:30 UTC
(In reply to David Redondo from comment #1)
> In KWIN:
> void VirtualDesktopManager::setRows(uint rows)
> {
>     if (rows == 0 || rows > count() || rows == m_rows) {
>         return;
>     }

And a little bit later `updateLayout()`

https://invent.kde.org/plasma/kwin/-/blob/master/src/virtualdesktops.cpp#L649
void VirtualDesktopManager::updateLayout()
{
    m_rows = qMin(m_rows, count());
   //  count() = 1 = wins qMin = m_rows is now back to "1"
Comment 3 Stefan 2022-06-15 07:59:43 UTC
If the intention is to show the grid by default (it was in a fresh installation), so to have at least two desktops, the default value of desktops should be increased to two.  So no orange dot at two desktops and two rows
Comment 4 Nate Graham 2022-06-15 16:22:42 UTC

*** This bug has been marked as a duplicate of bug 448552 ***