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
There even is a TODO for this in the code: https://invent.kde.org/plasma/kwin/-/blob/master/src/scripting/genericscriptedconfig.cpp#L182
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
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.