Bug 473680 - Tiling config changes/resets itself due to monitor being identified differently after resume from sleep
Summary: Tiling config changes/resets itself due to monitor being identified different...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: Custom Tiling (show other bugs)
Version: 6.0.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen
Depends on:
Blocks:
 
Reported: 2023-08-23 12:57 UTC by Arne
Modified: 2024-08-22 13:55 UTC (History)
5 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 Arne 2023-08-23 12:57:26 UTC
SUMMARY
I use custom-sized tiles and set padding to 0. After my system goes to sleep and wakes up again, the tiling/padding settings are changed. Either the settings in ~/.config/kwinrc are overwritten or new lines were added using a different identifier.
I assume that it's due to my screen turning off after a certain amount of time and afterwards my system goes to sleep. After waking it from sleep kwin registers my screen using a different identifier and therefore applies a new (default) setting.

STEPS TO REPRODUCE
1. Create custom tiling layout and/or padding.
2. Turn off screen and turn system to sleep afterwards.

OBSERVED RESULT
Custom tiling layout and padding settings are reset/changed.

EXPECTED RESULT
Custom tiling layout and padding should be preserved.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux, Kernel 6.4.10-zen2-1.1-zen
(available in About System)
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 
Qt Version: 5.15.10+kde+r147 & 6.5.2

ADDITIONAL INFORMATION
kwin 5.27.7
Using ALHP packages: https://somegit.dev/ALHP/ALHP.GO
Comment 1 Oded Arbel 2023-08-23 14:09:00 UTC
I messaged to reproduce this issue with a laptop and external monitor:
1. Set non default tiling layout to both screens.
2. Unplug external screen
3. Suspend laptop
4. Wake up laptop and connect external screen

In my case the laptop's built-in screen kept the custom layout and just the external screen for a new, default, layout. Looking at `kscreen-doctor -o`, I can see that my screen layout hasn't changed, and kscreen still see the same screen IDs and layout (kscreen sometimes does reset the screen layout, at which point tiling layout reset makes sense, but this is not the case here).
Comment 2 Arne 2023-08-25 16:46:09 UTC
I just changed my config on both my Arch Linux systems and after a reboot both settings were changed in an identical manner ({"width":0.378},{"width":0.621} got changed to {"width":0.378125},{"width":0.621875}).
Comment 3 Oded Arbel 2023-08-25 19:53:06 UTC
(In reply to kde from comment #2)
> I just changed my config on both my Arch Linux systems and after a reboot
> both settings were changed in an identical manner
> ({"width":0.378},{"width":0.621} got changed to
> {"width":0.378125},{"width":0.621875}).

That is not an actual reset - its just an IEEE-754 style "floating numbers are hard" issue. I'm going to say that this isn't a bug and can't be "fixed" without something ridiculously overkill such as libgmp, so its just not worth it. You just have to accept that unless you're using binary fractions, you can't have exact rations.
Comment 4 Arne 2023-10-24 07:31:43 UTC
Thanks for your reply. I understand that adjusting the fractions is not really fixable, but my main issue is still present.
Comment 5 Iizuki 2024-03-12 10:49:16 UTC
So the actual resetting bug seems to be always due to monitor identification failures. Explained here by guss777: https://discuss.kde.org/t/new-tiling-settings-constantly-reset-themself/2520/7

I experience this bug sometimes and can testify that my kwinrc has way more `[Tiling][some-id]` configs than I have monitors.
Comment 6 Arne 2024-03-12 11:16:35 UTC
Yes, the actual issue has neither anything particular to do with waking my system from sleep nor with the issue regarding fractions. The config gets changed between reboots and/or re-logins regardless of the values used. And most importantly the issue still persists on Plasma 6.
Comment 7 Arne 2024-03-12 14:53:41 UTC
Steps to reproduce:
1. Set custom tiling panel layout and padding.
2. Turn display off and on again.
3. New section in ~/.config/kwinrc got added with the default layout: tiles={"layoutDirection":"horizontal","tiles":[{"width":0.25},{"width":0.5},{"width":0.25}]} and padding got reset to 4.
Comment 8 ecrosby1971 2024-06-26 12:35:01 UTC
I recently started using Tiling again and noticed my setting not saving.
This, apparently, is still an issue in 6.1 as I just upgraded at the beginning of the week.
I hope a solution is found soon. It's rather annoying to keep setting it up. Makes the Tiling feature useless.