Bug 449960

Summary: Desktops appear cut off and shifted horizontally in Desktop Grid after a KWin crash
Product: [Plasma] kwin Reporter: phrxmd <philipp.reichmuth>
Component: effects-desktop-gridAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 5.24.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.25
Attachments: Photo of Desktop Grid on both monitors. On the left monitor, full-screen Konsole on VD2. On the right monitor, six full-screen windows on the first six VDs, Spectacle on VD7

Description phrxmd 2022-02-10 18:15:15 UTC
Created attachment 146545 [details]
Photo of Desktop Grid on both monitors. On the left monitor, full-screen Konsole on VD2. On the right monitor, six full-screen windows on the first six VDs, Spectacle on VD7

SUMMARY
When KWin comes up again after a crash related to unplugging a monitor (reported in bug 449957), the Virtual Desktop grid on both monitors shows various visual errors.

STEPS TO REPRODUCE
1. Get KWin to crash by unplugging or switching off the external monitor
2. Invoke the Desktop Grid

OBSERVED RESULT
On the monitor which was unplugged earlier, the Desktop Grid shows the following visual errors (see attached photo):
- Moving the mouse over the various desktops, the highlighting of the desktop under the mouse appears offset to the left by an amount X.
- All virtual desktops on that monitor appear smaller by the same amount X. 
  - On some virtual desktops, this shrinking looks as if the windows are cut off on the right (in the photo, various Electron or Qt applications on VD1, VD2-9).
  - On some virtual desktops, this looks as if the window is scaled to fit into X (in the photo, Firefox on VD2).
- The desktops are displayed wallpaper configured on the other monitor, not with the one that is actually configured on them.

On the monitor that was NOT unplugged, the Desktop Grid shows the following visual errors:
- The desktops are shown as if they had a black wallpaper; the configured wallpaper is not shown.

X is equivalent to the width of the desktop on my other monitor (the built-in screen on my laptop).

EXPECTED RESULT
The Desktop Grid effect should show the desktops regularly on all monitors, not only on those that weren't switched off before the crash.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220207
KDE Plasma Version: 5.24.0
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.5-1-default (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620

ADDITIONAL INFORMATION
This error has been around since at least 5.23 or so, so it's not a 5.24 regression.
Comment 1 Marco Martin 2022-05-06 10:46:05 UTC
Git commit 7a4cabf3287e82e7d1d6ba84b8b059ab470f9f42 by Marco Martin.
Committed on 06/05/2022 at 10:44.
Pushed by mart into branch 'master'.

QML version of the Desktop Grid effect

Replace completely the old desktop grid effect with a QML version.
Aims to feature parity and be a change as transparent as possible for the user.
Related: bug 433071, bug 452625, bug 443971, bug 437121, bug 452925, bug 437928, bug 452439, bug 288530, bug 450254, bug 450106, bug 447832, bug 416576, bug 441862, bug 444859, bug 445999, bug 422117, bug 404627, bug 435483, bug 420744, bug 435482, bug 427055, bug 333445, bug 429120, bug 427391, bug 409295, bug 294322, bug 356955
FIXED-IN: 5.25

M  +5    -0    src/effects.cpp
M  +10   -5    src/effects/desktopgrid/CMakeLists.txt
D  +0    -1571 src/effects/desktopgrid/desktopgrid.cpp
D  +0    -186  src/effects/desktopgrid/desktopgrid.h
D  +0    -32   src/effects/desktopgrid/desktopgrid.kcfg
M  +6    -14   src/effects/desktopgrid/desktopgrid_config.cpp
M  +2    -2    src/effects/desktopgrid/desktopgrid_config.h
M  +68   -144  src/effects/desktopgrid/desktopgrid_config.ui
A  +32   -0    src/effects/desktopgrid/desktopgridconfig.kcfg
M  +5    -1    src/effects/desktopgrid/desktopgridconfig.kcfgc
A  +342  -0    src/effects/desktopgrid/desktopgrideffect.cpp     [License: GPL(v2.0+)]
A  +108  -0    src/effects/desktopgrid/desktopgrideffect.h     [License: GPL(v2.0+)]
M  +5    -4    src/effects/desktopgrid/main.cpp
D  +0    -26   src/effects/desktopgrid/main.qml
M  +1    -0    src/effects/desktopgrid/metadata.json
A  +255  -0    src/effects/desktopgrid/qml/DesktopView.qml     [License: GPL(v2.0+)]
A  +193  -0    src/effects/desktopgrid/qml/main.qml     [License: GPL(v2.0+)]
M  +22   -5    src/effects/private/qml/WindowHeap.qml
M  +21   -3    src/libkwineffects/kwineffects.h
M  +4    -1    src/libkwineffects/kwinquickeffect.cpp

https://invent.kde.org/plasma/kwin/commit/7a4cabf3287e82e7d1d6ba84b8b059ab470f9f42