Bug 483348 - Plasma desktop panel moving to wrong screen on next login
Summary: Plasma desktop panel moving to wrong screen on next login
Status: REOPENED
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-12 15:04 UTC by adikso4
Modified: 2024-04-13 14:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.3


Attachments
Incorrect placement of the panel (1.92 MB, image/jpeg)
2024-03-12 15:04 UTC, adikso4
Details
Incorrect alignment on X11 (125.15 KB, image/png)
2024-03-19 10:24 UTC, adikso4
Details
Not working on new account after opening panel edit (1.84 MB, image/jpeg)
2024-03-19 10:26 UTC, adikso4
Details
Rounded panel before opening edit (16.63 KB, image/jpeg)
2024-03-19 10:29 UTC, adikso4
Details
"Squared" panel after opening edit (17.88 KB, image/jpeg)
2024-03-19 10:29 UTC, adikso4
Details

Note You need to log in before you can comment on or make changes to this bug.
Description adikso4 2024-03-12 15:04:44 UTC
Created attachment 167042 [details]
Incorrect placement of the panel

SUMMARY
Plasma desktop Panel is moving to the incorrect screen every time on next login and have to be moved manually. "Panels and Desktop Management" shows as if everything was okay, but only moving the panel (via "Panels and Desktop Management") to other screen and then moving it back to correct one shows it at the correct screen. 

STEPS TO REPRODUCE
1. Add a panel on top of the middle screen (3 monitors setup)
2. Re-login

OBSERVED RESULT
Panel is placed at an incorrect screen and "Panels and Desktop Management" doesn't know about this.

EXPECTED RESULT
Panel is placed at a correct screen

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-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2024-03-14 16:40:07 UTC
Thanks for the bug report. A few questions:

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 only on screen sleep/wake?
3. If you create a new clean user account and replicate by hand the same panel setup there, does the bug still happen? Or no?
4. What GPU are these screens plugged into?
Comment 2 Nate Graham 2024-03-14 16:45:25 UTC
Oh and one more too:

5. 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 3 Nate Graham 2024-03-14 19:36:03 UTC
I'm asking all these questions because I strongly suspect this is Bug 483102, but I need a few more data points to be sure.
Comment 4 Bug Janitor Service 2024-03-19 09:30:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4108
Comment 5 adikso4 2024-03-19 10:24:27 UTC
Created attachment 167458 [details]
Incorrect alignment on X11
Comment 6 adikso4 2024-03-19 10:26:57 UTC
Created attachment 167460 [details]
Not working on new account after opening panel edit
Comment 7 adikso4 2024-03-19 10:29:11 UTC
Created attachment 167461 [details]
Rounded panel before opening edit
Comment 8 adikso4 2024-03-19 10:29:28 UTC
Created attachment 167462 [details]
"Squared" panel after opening edit
Comment 9 adikso4 2024-03-19 10:38:39 UTC
Sorry for delay, I was away from the affected system for a week.

(In reply to Nate Graham from comment #1)
> Thanks for the bug report. A few questions:
> 
> 1. Does it also happen on X11, or only on Wayland?
It doesn't show on another screen on X11, but the alignment is incorrect on X11. As visible on https://bugsfiles.kde.org/attachment.cgi?id=167458

> 2. Does it also happen if you lock the screen with Meta+L and then unlock, or only on screen sleep/wake?
That happens only on LOG-IN. Locking, unlocking, screen sleep doesn't change anything.

> 3. If you create a new clean user account and replicate by hand the same panel setup there, does the bug still happen? Or no?
It shows the panel on correct screen, but instantly when I will open panel editing, it will start to stick out to another screen (fill width). This is visible on https://bugsfiles.kde.org/attachment.cgi?id=167460

Also there is a difference in panel shape before and after going to edit. 
Before edit: https://bugs.kde.org/attachment.cgi?id=167461
After edit: https://bugs.kde.org/attachment.cgi?id=167462

I'm not editing anything, I'm just entering edit mode. 

> 4. What GPU are these screens plugged into?
This is AMD 6900 XT with "amdgpu" driver.

> 5. 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`)?

For some reason it has problem with connecting to dbus, so I did `killall plasmashell` `kstart plasmashell`, and the effect is the same like on log-in - the panel is on the wrong screen.
Comment 10 David Redondo 2024-03-26 13:59:44 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 483102, bug 470434
FIXED-IN:6.0.3

M  +1    -1    shell/panelview.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/27dd68970f33627ba52903c2fc5b1442c7217e0f
Comment 11 David Redondo 2024-03-26 14:12:37 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 483102, 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
Comment 12 adikso4 2024-04-13 14:08:50 UTC
This bug is not fixed in 6.0.3. The problem still persists