https://bugs.kde.org/show_bug.cgi?id=528470

            Bug ID: 528470
           Summary: Applications open on all virtual desktops due to
                    unnamed wmclass window rules appearing
    Classification: Plasma
           Product: kwin
      Version First 6.8.0
       Reported In:
          Platform: CachyOS
                OS: Linux
            Status: REPORTED
          Severity: major
          Priority: NOR
         Component: rules
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Created attachment 198166
  --> https://bugs.kde.org/attachment.cgi?id=198166&action=edit
Screenshot of the unnamed rules appearing by themselves

Summary : Stray single-key groups ("desktopsrule=4") appear in kwinrulesrc, and
are loaded as rules matching all windows, putting every new window on all
desktops.

SUMMARY
Since Plasma 6.8, unnamed window rules repeatedly appear at the top of the
Window Rules list. Every newly opened window is then placed on all virtual
desktops. Deleting the rules fixes it until they reappear, until another
application is opened again. Setting to "Force" doesn't solve it either. 

In kwinrulesrc each such rule is a group containing only one key, viz. - 

[91304b5e-feb4-48ab-83ce-6806849ca005]
desktopsrule=4

[e2052c36-ef0e-44c1-a798-e853f52e7efa]
desktopsrule=4

Both IDs are at the front of [General] Order. No wmclass, types or desktops
keys are present, so with the defaults, each group matches every window of
every type, with a Remember policy and an empty desktop list, i.e., all
desktops!!

All my real rules are per-application "Application settings for <app>" rules,
created via the title-bar menu, with Virtual Desktop set to Remember
(desktopsrule=4).

STEPS TO REPRODUCE
I am unsure as to how deterministically reproducible this is. In any case, see
below

1. Have several per-application rules with Virtual Desktop = Remember.
2. Use the session normally: open, close and move those applications between
virtual desktops; occasionally add or delete rules in System Settings. It
happens every single time a new window opens. 
3. Check System Settings > Window Management > Window Rules, or kwinrulesrc.

OBSERVED RESULT
Unnamed rules appear at the top of the list. kwinrulesrc contains groups with
only "desktopsrule=4". All new windows open on all desktops. 

EXPECTED RESULT
No rules are created without user action. A partial group without matching
properties is never loaded as an active rule.

ADDITIONAL INFORMATION
- Happened on 6.8.0/6.8.1, and again on 6.8.2, evenvafter I deleted all Plasma
config files and rebuilt the desktop from scratch, think it might've been some
config clash after the big update.
- No local scripts or KWin scripts reference kwinrulesrc (checked with grep
across ~/.local/share/kwin, ~/.local/bin, ~/.config/autostart and
~/.config/plasma-workspace).
- Possibly related: since d138c933d9 ("Add support for cascaded window rules",
v6.8.0), RuleBookSettings::usrRead() treats every non-meta group as a rule and
prepends groups missing from Order. Before that, a stray group like these would
have been ignored.
- Hypothesis, unverified: a writer holding a stale in-memory RuleSettings for a
deleted rule (e.g. the Remember write-back from Rules::update /
RuleBook::discardUsed, or the KCM) saves after the group was deleted on disk.
KConfig merges only the changed entries, which recreates the group with a
single key. This matches the single-key groups and the frequent saves caused by
Remember rules.
- The same thing was reported on Fedora 44 / Plasma 6.8.2:
https://discuss.kde.org/t/windows-open-on-all-desktops/51594

PS - The last three details are from Claude Code's diagnosis; not mine. 

SOFTWARE/OS VERSIONS
Operating System: CachyOS
KDE Plasma Version: 6.8.2

Thank you!

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to