Bug 444646 - After an upgrade to 5.23.2, all Window Rules lost their Virtual Desktop property
Summary: After an upgrade to 5.23.2, all Window Rules lost their Virtual Desktop property
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (other bugs)
Version First Reported In: 5.23.2
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-10-30 06:00 UTC by Andrei Rybak
Modified: 2023-09-06 10:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
a Window Rule as it was before 5.23.2 (not an actual screenshot, just for demonstration) (30.86 KB, image/png)
2021-10-30 06:02 UTC, Andrei Rybak
Details
a Window Rule as it was found in 5.23.2 (an actual screenshot) (42.61 KB, image/png)
2021-10-30 06:10 UTC, Andrei Rybak
Details
kconf_updaterc as of 2021-11-01 (3.12 KB, text/plain)
2021-11-01 18:20 UTC, Andrei Rybak
Details
redacted kwinrulesrc (1.26 KB, text/plain)
2021-11-10 18:12 UTC, Andrei Rybak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Rybak 2021-10-30 06:00:19 UTC
SUMMARY
I extensively use virtual desktops and have five Window Rules that _had_ "Virtual Desktop" property specified in them, but no longer have after some recent upgrade.

STEPS TO REPRODUCE
1. Set up Window Rules with Virtual Desktop property in 5.21 (or maybe 5.22)
2. Upgrade to 5.23.2
3. Open Window Rules window again and observe the properties

OBSERVED RESULT
"Virtual Desktop" properties are gone from all Window Rules.

EXPECTED RESULT
"Virtual Desktop" properties are preserved across upgrades.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-38-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 7.7 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
ADDITIONAL INFORMATION
Comment 1 Andrei Rybak 2021-10-30 06:02:51 UTC
Created attachment 143020 [details]
a Window Rule as it was before 5.23.2 (not an actual screenshot, just for demonstration)
Comment 2 Andrei Rybak 2021-10-30 06:10:06 UTC
Created attachment 143021 [details]
a Window Rule as it was found in 5.23.2 (an actual screenshot)

I have upgraded from 5.23.1 to 5.23.2 on Wednesday 2021-10-27, noticed that something was amiss on Friday evening (one of the windows didn't went where it was supposed to, but I assumed that I moved it by accident manually), and confirmed it Saturday morning when same thing happened again and I checked Window Rules settings.
Comment 3 Andrei Rybak 2021-10-30 06:17:23 UTC
I've checked my aptitude logs, and I've upgraded from 5.23.0 to 5.23.1 on 2021-10-20, which means that it is definitely the upgrade from 5.23.1 to 5.23.2  that caused this. Otherwise, I would have noticed the problem sooner.

Example of the exact 5.23.1 to 5.23.2 aptitude log message:

    [UPGRADE] kwin-common:amd64 4:5.23.1-0xneon+20.04+focal+release+build50 -> 4:5.23.2-0xneon+20.04+focal+release+build

Side note: in my setup, I use "Virtual Desktop" properties and "Maximize horizontally" and "Maximize vertically" properties. "Maximize *" properties were not affected.
Comment 4 Ismael Asensio 2021-11-01 18:06:02 UTC
This is a migration bug. There has been a change in how the  virtual desktops are stored, in the version that was released from 5.23.

Previously, the rules stored a property `desktop` with the number of virtual desltop. After the change, it stores a `desktops` property containing the unique identifier/s for the VDs (there can be several in the case of Wayland). 

The migration between those properties should have been handled by a `kconf_update` script, but it seems it didn't get correctly applied in your case. These scripts are set to only execute once, so going back and forth between versions wouldn't reapply it.

Note that re-adding the Virtual Desktop property manually to your rules should work nonetheless on the new version, but I agree that is inconvenient and not the desired outcome.

Could you please attach a copy of ~/.config/kwinrulesrc and ~/.config/kconf_updaterc, so we can try to see what failed in this case?
Thanks!
Comment 5 Andrei Rybak 2021-11-01 18:20:21 UTC
Created attachment 143108 [details]
kconf_updaterc as of 2021-11-01
Comment 6 Andrei Rybak 2021-11-01 18:23:42 UTC
I don't think attaching `~/.config/kwinrulesrc` would be of any use -- I have already fixed all of my window rules via GUI. Now, all the rules have properties `desktops` and `desktopsrule`.
Comment 7 Ismael Asensio 2021-11-07 16:44:06 UTC
(In reply to Andrei Rybak from comment #6)
> I don't think attaching `~/.config/kwinrulesrc` would be of any use -- I
> have already fixed all of my window rules via GUI. Now, all the rules have
> properties `desktops` and `desktopsrule`.

For the looks of  `kconf_updaterc`, the script was applied.

My current hypothesis is that it failed to get the desktop UUIDs.
The `kwinrulesrc`might still be useful to confirm this, as they would still have the `desktop=` property untouch, but not the `desktoprule=`.

Could you please also provide the content of the ' [Desktops]` group in `~/.config/kwinrc`?

Thanks for your collaboration! Unfortunately the kconf_update scripts are a bit had to work with on these regards, but if that's the case, I might improve it a little bit for the fail case.
Comment 8 Andrei Rybak 2021-11-10 18:12:35 UTC
Created attachment 143418 [details]
redacted kwinrulesrc

attached kwinrulesrc
Comment 9 David Edmundson 2023-09-06 10:38:12 UTC
This bug was reported against an outdated version of KWin. We have made many changes since the. 
If the issue persists in newer versions can you reopen the bug report updating the version number.