Bug 464373

Summary: Desktop widgets placed next to panel move further and further away each login
Product: [Plasma] plasmashell Reporter: Paul Worrall <p.r.worrall>
Component: ContainmentAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, d.motrenko, isma.af, nate, niccolo.venerandi, notmart, sicher-mit-linux
Priority: NOR    
Version: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=458038
Latest Commit: Version Fixed In: 5.27
Sentry Crash Report:
Attachments: Screenshot before logout
Screenshot after login

Description Paul Worrall 2023-01-16 12:28:28 UTC
Created attachment 155347 [details]
Screenshot before logout

I can reproduce this with X11 and Wayland
It is not a problem with Plasma 5.26.5

STEPS TO REPRODUCE
1. Place the panel at the bottom of the screen and place a desktop widget just above it (I put it just above the clock)
2. Logout and login

OBSERVED RESULT
The widget initially appears where it was at logout but when the panel appears, the widget moves up.

EXPECTED RESULT
Widget remains where you put it.

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Graphics Platform: Wayland or X11

ADDITIONAL INFORMATION
Can reproduce with bottom and right panel, but not top or left
Widgets move more and more each login
Comment 1 Paul Worrall 2023-01-16 12:28:59 UTC
Created attachment 155348 [details]
Screenshot after login
Comment 2 Patrick Silva 2023-01-16 15:40:52 UTC
Can confirm on neon unstable.
Comment 3 Nate Graham 2023-01-17 21:14:59 UTC
Cannot reproduce on Wayland with that setup on current git master on Fedora 37.
Comment 4 Ismael Asensio 2023-01-17 21:40:43 UTC
I've looked into this and I know where it happens and why it happens, but I've not figured out yet how to avoid it without incurring on a hack and potentially worse behavior.

Looking at the code, It should happen in both X11 and Wayland, but not 100% sure as I cannot test on Wayland right now.

The issue is we store the widgets config with a key that matches the actual screen resolution. When the panel appears we launch a geometry changed, and try to relayout for the available size (screen minus the panel size). There we don't find a matching key for the new geometry, so a re-layout algorithm takes place as if it were a new geometry.

The bug has probably come to surface when we started saving the new positions after loading (which is needed to avoid multiscreen problems)
Comment 5 Patrick Silva 2023-01-28 14:09:47 UTC
It's no longer happening on neon unstable. Probably fixed by
https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2535
Comment 6 Ismael Asensio 2023-01-28 14:20:12 UTC
Can confirm that https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2535 fixes the bug.
Comment 7 Paul Worrall 2023-02-06 19:11:57 UTC
*** Bug 465383 has been marked as a duplicate of this bug. ***