Bug 463292 - User configuration for KWin scripts is not applied until after disabling and reenabling the script
Summary: User configuration for KWin scripts is not applied until after disabling and ...
Status: CONFIRMED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_kwinscripts (other bugs)
Version First Reported In: 5.26.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-21 00:29 UTC by Natalie Clarius
Modified: 2023-01-05 21:19 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Natalie Clarius 2022-12-21 00:29:18 UTC
SUMMARY
***
Changed user settings for a KWin script do not take effect until after the script is disabled and enabled again.
***

STEPS TO REPRODUCE
1. Install a KWin script with user configuration, e.g. Window Gaps
2. Change settings via the configure button in the entry for the script, e.g. gap size
3. Click "Apply" in the configuration dialog

OBSERVED RESULT
Changes do not take effect; script must be disabled and reenabled first

EXPECTED RESULT
Changes take effect after hitting the "Apply" button

SYSTEM INFORMATION
Operating System: Arch Linux
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Kernel Version: 6.0.10-arch2-1 (64-bit)
Graphics Platform: X11
Comment 1 Nicolas Fella 2022-12-21 12:56:13 UTC
There even is a TODO for this in the code: https://invent.kde.org/plasma/kwin/-/blob/master/src/scripting/genericscriptedconfig.cpp#L182
Comment 2 Nicolas Fella 2022-12-21 13:30:48 UTC
I wonder what the best approach for this is. A brute-force approach would be to automatically reload the script when saving the config. That wouldn't require changing the scripts. Or we do what we do for scripted effects, which is a "configChanged" signal that effects connect to and re-read the config: https://invent.kde.org/plasma/kwin/-/blob/master/src/effects/scale/package/contents/code/main.js#L23
Comment 3 Natalie Clarius 2022-12-21 19:35:23 UTC
I would think that a solution that also works for existing scripts would be preferable, but I don't know what the potential drawbacks of reloading the script would be.