Bug 492812 - Empty window rules (with only matching conditions) get deleted
Summary: Empty window rules (with only matching conditions) get deleted
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (show other bugs)
Version: git master
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 462642 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-09-08 13:05 UTC by Patrick Silva
Modified: 2025-04-08 12:45 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2024-09-08 13:05:41 UTC
SUMMARY
Can reproduce on both X11 and Wayland sessions.

STEPS TO REPRODUCE
1. open Konsole
2. right-click on the window decoration, hover over 'More actions' and choose 'Configure special window settings...'  or 'Configure special application settings...' - notice that "Apply" button is activated despite nothing was changed yet
3. change anything (Description, window class (application), match whole window class, window types)
4. click on "OK" button
5. reopen the "Configure special window/application settings..." window

OBSERVED RESULT
the modification done in the step 3 was not saved

EXPECTED RESULT
any modification should be saved

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.8.0
Graphics Platform: Wayland
Comment 1 Zamundaaa 2024-09-19 20:57:34 UTC
Can confirm. It's not just that changes don't get saved, the whole window rule doesn't get saved
Comment 2 Ismael Asensio 2024-09-19 21:40:34 UTC
This was intentional according to the code. 

The RuleBook deletes "empty rules". If there is no property set, just conditions, the rule will never be matched so it serves no purpose.
For instance, temporary properties (Apply Now or Force Temporarily) aare deleted after applied, and if there's no more properties, also the whole rule gets deleted.

If we want to modify this behavior for UX purposes (some user might save the conditions and wanted to modifiy it later), we'd have to change some logic. 

The other solution is to explain this behavior in the placeholder when there are no added properties.
Comment 3 Ismael Asensio 2025-02-22 21:30:40 UTC
*** Bug 462642 has been marked as a duplicate of this bug. ***