Bug 450443 - plasmashell doesn't properly set the geometry of DesktopView on login when having two screens and the one on the left is disabled
Summary: plasmashell doesn't properly set the geometry of DesktopView on login when ha...
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop Containment (show other bugs)
Version: master
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: multiscreen
: 430515 440362 (view as bug list)
Depends on:
Blocks: 356446
  Show dependency treegraph
 
Reported: 2022-02-17 11:34 UTC by Fushan Wen
Modified: 2022-09-27 12:03 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: kde/5.15
Sentry Crash Report:


Attachments
no wallpaper.png (77.24 KB, image/png)
2022-02-17 11:34 UTC, Fushan Wen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fushan Wen 2022-02-17 11:34:20 UTC
Created attachment 146858 [details]
no wallpaper.png

SUMMARY
When using `PLASMA_USE_QT_SCALING=1`, plasmashell doesn't show the wallpaper on the primary screen, and the positions of notification items are wrong.

Display:
1. Laptop display (disabled)
2. External display (enabled, primary)

STEPS TO REPRODUCE
1. Add `PLASMA_USE_QT_SCALING=1` to /etc/environment
2. Reboot
3. Login to an X11 session

OBSERVED RESULT
No wallpaper, notification items are positioned in the center of the screen.

EXPECTED RESULT
Normal behavior after restarting plasmashell

SOFTWARE/OS VERSIONS
Information for package plasma5-desktop:
----------------------------------------
Repository     : unstable-kde-frameworks
Name           : plasma5-desktop
Version        : 5.24.80git.20220216T115625~fb84414bd-ku.24.1
Arch           : x86_64
Vendor         : obs://build.opensuse.org/KDE:Unstable
Installed Size : 8.6 MiB
Installed      : Yes
Status         : up-to-date
Source package : plasma5-desktop-5.24.80git.20220216T115625~fb84414bd-ku.24.1.src
Summary        : The KDE Plasma Workspace Components


ADDITIONAL INFORMATION
X11
Comment 1 Nate Graham 2022-02-17 23:09:59 UTC
1. Are you using any scaling?
2. What are the screens' resolutions?
Comment 2 Fushan Wen 2022-02-19 01:40:32 UTC
(In reply to Nate Graham from comment #1)
> 1. Are you using any scaling?
> 2. What are the screens' resolutions?

1. Yes. without PLASMA_USE_QT_SCALING=1, using any scaling will not affect the primary screen detection.
2. 1920x1080
Comment 3 Fushan Wen 2022-02-25 11:36:05 UTC
The cause is clear now. It has nothing to do with PLASMA_USE_QT_SCALING=1.

When having 2 screens and the one on the left is disabled, on login the "disabled" screen will be enabled and then disabled, but QScreen doesn't emit geometryChanged because there is no change in screen geometry (sometimes). However the signal is required to position the desktop view correctly.
Comment 4 Fushan Wen 2022-02-25 14:48:51 UTC
The x is set by another program, likely kwin. My previous assumption is wrong.
Comment 5 Bug Janitor Service 2022-02-26 05:08:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1491
Comment 6 Fushan Wen 2022-02-28 14:13:56 UTC
If the width of the DesktopView is equal to the width of the screen , then the DesktopView is not likely to be moved. However when using `PLASMA_USE_QT_SCALING=1`, the condition is false.
Comment 7 Bug Janitor Service 2022-05-28 06:17:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1777
Comment 8 Bug Janitor Service 2022-05-29 06:49:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1781
Comment 9 Fushan Wen 2022-05-29 12:41:51 UTC
Upstream fix: https://codereview.qt-project.org/c/qt/qtbase/+/413380
Comment 10 Fushan Wen 2022-06-22 16:03:55 UTC
Git commit cea5cba30890fab992dab2be6ea69521aef0eac0 by Fushan Wen.
Committed on 22/06/2022 at 16:02.
Pushed by fusionfuture into branch 'Plasma/5.24'.

shell: refresh geometries of all `DesktopView` and `PanelView` when receiving `logicalDotsPerInchChanged`

Workaround for https://codereview.qt-project.org/c/qt/qtbase/+/413380
FIXED-IN: 5.24.6

M  +8    -0    shell/desktopview.cpp
M  +8    -0    shell/panelview.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/cea5cba30890fab992dab2be6ea69521aef0eac0
Comment 11 Fushan Wen 2022-06-22 16:06:10 UTC
Currently only 5.24.6 is fixed because LTS tends to ship with an older Qt version. 5.25 and master branch don't have the fix as the Qt fix is still under review.
Comment 12 Nate Graham 2022-06-22 16:07:13 UTC
Unless the proper Qt fix will break the change you just pushed, I think it's worth it to have in 5.25 and master too.
Comment 13 Fushan Wen 2022-06-23 00:26:59 UTC
The Qt fix won't break the workaround. Let's wait for another week to 
see if upstream is willing to accept the fix.
Comment 14 Fushan Wen 2022-06-27 05:05:42 UTC
Git commit 41fb821545aac4df273fb45d0e4de9ab49143d9c by Fushan Wen.
Committed on 27/06/2022 at 05:04.
Pushed by fusionfuture into branch 'Plasma/5.25'.

shell: refresh geometries of all `DesktopView` and `PanelView` when receiving `logicalDotsPerInchChanged`

Workaround for https://codereview.qt-project.org/c/qt/qtbase/+/413380
Related: bug 438114
FIXED-IN: 5.24.6

(cherry picked from cea5cba30890fab992dab2be6ea69521aef0eac0)

M  +8    -0    shell/desktopview.cpp
M  +8    -0    shell/panelview.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/41fb821545aac4df273fb45d0e4de9ab49143d9c
Comment 16 Nate Graham 2022-06-29 16:41:53 UTC
Very cool. Can we backport that in our KDE Qt patch collection?
Comment 18 Fushan Wen 2022-07-03 15:32:23 UTC
*** Bug 430515 has been marked as a duplicate of this bug. ***
Comment 19 Fushan Wen 2022-07-03 15:36:36 UTC
*** Bug 440362 has been marked as a duplicate of this bug. ***
Comment 20 Nate Graham 2022-07-13 19:04:08 UTC
*** Bug 456453 has been marked as a duplicate of this bug. ***