Bug 437121

Summary: Desktop grid animation zooms back into wrong desktop after moving window
Product: [Plasma] kwin Reporter: Mahe <mahe>
Component: effects-desktop-gridAssignee: KWin default assignee <kwin-bugs-null>
Severity: normal CC: nate, tazamijakal
Priority: NOR    
Version: git-stable-Plasma/5.24   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 5.25
Attachments: screen recording of a virtual machine running neon-unstable-20210509-0329 showing the issue

Description Mahe 2021-05-14 21:42:09 UTC
Created attachment 138435 [details]
screen recording of a virtual machine running neon-unstable-20210509-0329 showing the issue


When the desktop grid view is quit using its own global hotkey, the animation will zoom into the wrong desktop when the active window was dragged to a different desktop beforehand. The viewport ends up on the correct desktop, only the animation is wrong.


1. set up a grid of virtual desktops (e.g. 4 desktops in 2 rows = 2x2 grid)
2. bind the "Show Desktop Grid" action to a hotkey (or use default ctrl + F8)
3. open a window (e.g. Dolphin) on desktop #1
4. trigger the desktop grid by hotkey
5. move the Dolphin window to desktop #2 on the grid using mouse drag
6. trigger the hotkey for the desktop grid again


The animation zooms back into desktop #1 (the original) whereas after the animation finishes, the screen switches to desktop #2 immediately (where the window was dragged to).


The animation zooms into desktop #2 (where the window was dragged to) and activates it.


Linux/KDE Plasma: Neon unstable 
KDE Plasma Version: 5.21.80
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2


- initially observed on Kubuntu 20.04 (KDE Plasma 5.18.5) installed on bare metal
- reproduced on the latest Neon unstable build using a VirtualBox VM (see attached recording)
- the animation zooms into the correct workspace when clicking with the mouse or pressing enter, only the desktop grid hotkey itself shows the erroneous behavior
Comment 1 Mahe 2022-01-20 20:15:00 UTC
This is still an issue and reproducible with the latest KDE neon Unstable using Plasma 5.24.80.
Comment 2 Marco Martin 2022-05-06 10:45:01 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 452925, bug 437928, bug 452439, bug 288530, bug 450254, bug 450106, bug 447832, bug 449960, 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