Bug 483102 - When Plasma 5 panel config migrated to Plasma 6 with AMD GPU, all panels move to primary screen on login
Summary: When Plasma 5 panel config migrated to Plasma 6 with AMD GPU, all panels move...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop Containment (show other bugs)
Version: 6.0.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: multiscreen
: 483405 483882 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-10 11:50 UTC by luluklzde
Modified: 2024-03-26 14:12 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.3


Attachments
plasma's appletsrc (23.67 KB, text/plain)
2024-03-14 17:06 UTC, luluklzde
Details
plasma's plasmarc (3.44 KB, text/plain)
2024-03-14 17:07 UTC, luluklzde
Details
Garuda Linux desktop-appletsrc, with ordering fix applied (7.45 KB, text/plain)
2024-03-16 21:40 UTC, Etienne Maheu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description luluklzde 2024-03-10 11:50:59 UTC
SUMMARY
I have two monitors each with its own panel. After every login (not from sleep) both of them are on top of each other on the primary display. The Panels and desktop management (right click on desktop -> edit mode -> manage desktops and panels) reports both of them in the correct position though.
Moving the panel from the secondary monitor to the primary and back fixes the problem for the current session.

NOTE: With "on top of each other" I mean that both are on the same spot, not one above the other, i.e. only one is visible at the same time.

STEPS TO REPRODUCE
1. Have two panels on one monitor each
2. Log in

OBSERVED RESULT
Both panels are on top of each other.

EXPECTED RESULT
Each panel is own its display, as set.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.9-zen1-1-zen (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
This is not a fresh install of Plasma 6. This system is updated from Plasma 5.
Comment 1 Nate Graham 2024-03-11 21:53:50 UTC
Sorry this is happening. Can I ask you to create a new user account, replicate the multi-screen panel setup, and see if it still happens? This will establish if it's a general bug, or something specifically caused by old settings that didn't migrate properly.
Comment 2 luluklzde 2024-03-12 07:11:54 UTC
(In reply to Nate Graham from comment #1)
> Sorry this is happening. Can I ask you to create a new user account,
> replicate the multi-screen panel setup, and see if it still happens? This
> will establish if it's a general bug, or something specifically caused by
> old settings that didn't migrate properly.

Why didn't I think of that! Great idea!

I can't try it right now, but I can try it in the late afternoon.
Comment 3 luluklzde 2024-03-12 15:38:35 UTC
You're correct, it has something to do with my old configs!

The new user can logout and back in without the panels resetting.
Comment 4 luluklzde 2024-03-12 15:56:38 UTC
I have chosen the nuclear option: Delete all panels and recreate them and it seems that fixes this issue.
Although Plasmashell crashed when I deleted both of them and didn't like resizing the Application Launcher and froze if I didn't log out first.

I still have every config, if they're needed.
Comment 5 Nate Graham 2024-03-13 16:41:36 UTC
Thanks, I had a feeling.

By any chance were you using X11 in Plasma 5, and then when you upgraded to Plasma 6 you started to use Wayland? Or were you using Wayland on Plasma 5 too?
Comment 6 luluklzde 2024-03-13 16:46:42 UTC
Wayland.
I switched to it as soon as I could.
Comment 7 luluklzde 2024-03-13 16:54:18 UTC
I should mention while I use Wayland as the default, I rarely had to switch to X.
So this system was not Wayland only.
Comment 8 Nate Graham 2024-03-13 17:38:06 UTC
Ok, so probably not an upgrade issue. Still, would yo mind replicating the setup in a clean user account? That would be very helpful.
Comment 9 luluklzde 2024-03-13 17:59:27 UTC
The new user with the old configs has the same issue.
Comment 10 Nate Graham 2024-03-13 18:19:52 UTC
When you say "old configs", did you actually move the old config files to the new user account? Or did you manually replicate the panel setup by hand?
Comment 11 luluklzde 2024-03-13 18:26:23 UTC
I copied the config. That's when the panels break.
The same layout, just replicated with new panels (delete old panels, add back panels, manually adjust widgets), works fine though.
Comment 12 Nate Graham 2024-03-13 19:34:35 UTC
Great, thanks. So it's definitely a config migration issue.

Would you be able to attach your old config (after scrubbing it of any personal information)?

Another thing that would be even more helpful would be to compare the old and new configs to see what changes related to panels and desktops which may explain the issue.
Comment 13 luluklzde 2024-03-13 19:54:39 UTC
I'll be very honest: I have no idea which file I should look for.
I used the entire .config folder as testing, i.e. copy the entire backed-up folder over, and never needed to look for anything specific.
Comment 14 Nate Graham 2024-03-14 16:42:13 UTC
~/.config/plasmashellrc and ~/.config/plasma-org.kde.plasma.desktop-appletsrc, specifically. Remember to scrub out any personal information!

I also have a few more questions for you, if you aren't sick of me already:

1. Does it also happen on X11, or only on Wayland?
2. Does it also happen if you lock the screen with Meta+L and then unlock, or is it only on login?
3. What GPU are these screens plugged into?
Comment 15 Nate Graham 2024-03-14 16:44:57 UTC
Oh and one more too: when this happens, can you make the issue go away by restarting plasmashell with `systemctl restart --user plasma-plasmashell.service` (assuming you're using the systemd boot; if not, try `plasmashell --replace`)
Comment 16 luluklzde 2024-03-14 17:05:13 UTC
(In reply to Nate Graham from comment #14)
> ~/.config/plasmashellrc and
> ~/.config/plasma-org.kde.plasma.desktop-appletsrc, specifically. Remember to
> scrub out any personal information!
> 
> I also have a few more questions for you, if you aren't sick of me already:
> 
> 1. Does it also happen on X11, or only on Wayland?
> 2. Does it also happen if you lock the screen with Meta+L and then unlock,
> or is it only on login?
> 3. What GPU are these screens plugged into?

No worries, helping to make plasma better is never a problem :)

So, your questions
1. X11 does not have this issue. Both panels are on their respective monitor.
2. Screen locking has no effect, everything stays where it is. This is also true for going into and coming back from sleep
3. I'm not sure what you mean here, but I have a XFX SWFT MERC 6900 XT. The screens both use DP.

Also while talking about hardware: Both screens are the same, as in the same model.
Comment 17 luluklzde 2024-03-14 17:06:59 UTC
Created attachment 167189 [details]
plasma's appletsrc

Here is the appletsrc

Note: Everything changed is in `[[ ]]`
Comment 18 luluklzde 2024-03-14 17:07:51 UTC
Created attachment 167190 [details]
plasma's plasmarc

And here's the plasmarc

Note: Everything changed is in `[[ ]]`
Comment 19 Nate Graham 2024-03-14 19:31:15 UTC
Thanks a lot! Much appreciated.
Comment 20 Nate Graham 2024-03-14 19:35:17 UTC
*** Bug 483405 has been marked as a duplicate of this bug. ***
Comment 21 Etienne Maheu 2024-03-16 21:38:29 UTC
I have a similar issue on my system. However, for me, the symptoms are a little bit different. I have a tripple monitor setup, with DP-1 as priority 0 in the middle, DP-2 as priority 1 on the right, and DP-3 as priority-2 on the left. I'm on the Garuda Linux distro so I have a top menu bar and a bottom dock. The dock remained on DP-1, but the top bar kept on moving to DP-3 (the left-most monitor in my setup). Moreover, I noticed that sub-applets from the top bar, like the popup from the system tray or the application launcher menu, always "tried" to open on the correct screen, which clamped them to the right of the screen. Visually, it looks like this:

Expected:
---------------------------------------------------------------
|                        |===top bar===|                    |
|                        | popup              |                    |
|     DP-3 p2     |       DP-1 p0      |   DP-2 p1  |
|                        |        =dock=      |                    |
----------------------------------------------------------------

Actual:
---------------------------------------------------------------
|===top bar===|                        |                    |
|             popup |                        |                    |
|     DP-3 p2       |     DP-1 p0     |   DP-2 p1  |
|                          |      =dock=     |                    |
----------------------------------------------------------------

I also noticed that manually editing the plasma-org.kde.plasma.desktop-appletsrc file to set my topbar to "lastScreen=1" correctly moved it to what should be the 0 screen (according to my dock position), and setting it to "lastScreen=2" moved to to my right-most screen. However, the popups would always try to open on the following screen, keeping them clamped to the right.

It's like if the value had a -1 applied to it when loading the file, somehow.

Not only that, but I noticed that changing the declaration order of the various Containments sections can fix the problem! If I make sure that my topbar is declared before the plasma.folder containments (which I assume is what drives the actual desktop), then everything works just fine! This only happens if the topbar is declared after the folders.

I'll also attach my config file, in case it helps you diagnose this issue.
Comment 22 Etienne Maheu 2024-03-16 21:40:54 UTC
Created attachment 167345 [details]
Garuda Linux desktop-appletsrc, with ordering fix applied

For me, moving the whole set of declarations for Containment 102 after Containment 42, 43 and 44 is what causes the problem.
Comment 23 h2o 2024-03-17 20:59:43 UTC
FYI - Setting the top panel alignment to "left" on my main monitor and my secondary monitor to "center" results in the top panels maintaining position after a logout/login for me.

https://forum.garudalinux.org/t/garuda-default-top-panel-not-showing-on-primary-monitor-after-restart/35407/16?u=ira787
Comment 24 Bug Janitor Service 2024-03-19 09:30:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4108
Comment 25 fanzhuyifan 2024-03-19 18:12:39 UTC
*** Bug 483882 has been marked as a duplicate of this bug. ***
Comment 26 David Redondo 2024-03-26 13:59:28 UTC
Git commit 27dd68970f33627ba52903c2fc5b1442c7217e0f by David Redondo.
Committed on 26/03/2024 at 13:47.
Pushed by davidre into branch 'master'.

Avoid positioning the panel when it has no size yet

Calling setPosition with a position of the left-most pixel of a screen
and  size of 0x0 will set the screen to be the one to the left of it.
Making screenToFollow() and QWindow::screen() out of sync temporarily.
While arguably a Qt issue and this being fixed up later when the panel
resizes and other properties are updated, we need to workaround this
to our usage of layer-shell. Layer surfaces can't change screen once
created. It can happen that the surface is created during the time
that the panel is on the wrong screen, resulting in the panel
appearing on the wrong screen while thinking it is on another one.
To fix this the initial positionPanel() call is removed, the
panel will now be positioned after it has resized from the event handler.
Related: bug 483348, bug 470434
FIXED-IN:6.0.3

M  +1    -1    shell/panelview.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/27dd68970f33627ba52903c2fc5b1442c7217e0f
Comment 27 David Redondo 2024-03-26 14:12:21 UTC
Git commit d03a98fc69c94f83f9410651d15a21ff41a72904 by David Redondo.
Committed on 26/03/2024 at 14:06.
Pushed by davidre into branch 'Plasma/6.0'.

Avoid positioning the panel when it has no size yet

Calling setPosition with a position of the left-most pixel of a screen
and  size of 0x0 will set the screen to be the one to the left of it.
Making screenToFollow() and QWindow::screen() out of sync temporarily.
While arguably a Qt issue and this being fixed up later when the panel
resizes and other properties are updated, we need to workaround this
to our usage of layer-shell. Layer surfaces can't change screen once
created. It can happen that the surface is created during the time
that the panel is on the wrong screen, resulting in the panel
appearing on the wrong screen while thinking it is on another one.
To fix this the initial positionPanel() call is removed, the
panel will now be positioned after it has resized from the event handler.
Related: bug 483348, bug 470434
FIXED-IN:6.0.3


(cherry picked from commit 27dd68970f33627ba52903c2fc5b1442c7217e0f)

M  +1    -1    shell/panelview.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/d03a98fc69c94f83f9410651d15a21ff41a72904