Bug 504848 - Dragging tiled windows to other virtual desktops in Overview un-tiles them on the destination desktop
Summary: Dragging tiled windows to other virtual desktops in Overview un-tiles them on...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-overview (other bugs)
Version First Reported In: 6.3.90
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2025-05-27 07:55 UTC by dmatteo002
Modified: 2025-06-07 11:37 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.4.0
Sentry Crash Report:


Attachments
Video of swapping two virtual desktop (1.08 MB, video/webm)
2025-05-27 13:07 UTC, dmatteo002
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dmatteo002 2025-05-27 07:55:07 UTC
SUMMARY
When swapping desktop (all windows from one virtual desktop to the other and viceversa, by dragging over empty space in the virtual desktop) or moving windows in the overview effect now the windows that are swapped lose their position they add on the previous virtual desktop.

That is probably caused by per-virtual desktop positioning (as position are remembered if they are changed and than swapped again).

STEPS TO REPRODUCE
1. Open some windows and position them in a way that is clearly recognizable
2. open overview
3. Drag the virtual desktop by empty space over another virtual desktop / drag a single windows

OBSERVED RESULT
The windows don't use previous position (on previous virtual desktop) on the new virtual desktop.

EXPECTED RESULT
They should use the previous position.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.90
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.8-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7735HS with Radeon Graphics
Memory: 16 GiB of RAM (14.9 GiB usable)
Graphics Processor: AMD Radeon 680M

ADDITIONAL INFORMATION
Comment 1 dmatteo002 2025-05-27 13:07:02 UTC
Created attachment 181775 [details]
Video of swapping two virtual desktop
Comment 2 Nate Graham 2025-05-27 17:48:59 UTC
It looks like what's going on here is that moving windows between desktops resets their tiled state on the destination desktop. Interestingly, the tiled state is remembered for the original desktop if you drag the window back.
Comment 3 Vlad Zahorodnii 2025-05-29 12:48:34 UTC
(In reply to Nate Graham from comment #2)
> It looks like what's going on here is that moving windows between desktops
> resets their tiled state on the destination desktop. Interestingly, the
> tiled state is remembered for the original desktop if you drag the window
> back.

Yeah, that's exactly what happens... In an ideal world, the overview effect would simply swap the desktops, but that's not the case. Given that virtual desktops can have different layouts, in 6.4, I don't think it's feasible to preserve window geometries as is. So untiling is the best option atm.

In 6.5, we should look for a proper way to swap `VirtualDesktop`s. The hardest part is maintaining compatibility with stupid X11. If we didn't have to care about X11, it'd take 5 minutes to fix the bug.
Comment 4 Bug Janitor Service 2025-05-29 13:50:14 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7704
Comment 5 Vlad Zahorodnii 2025-06-06 07:17:51 UTC
Git commit e0569606ab5a5075a55e6d528e93d7abaf45d4f5 by Vlad Zahorodnii.
Committed on 06/06/2025 at 06:47.
Pushed by vladz into branch 'master'.

Implement proper virtual desktop reordering

At the moment, the only available to move a virtual desktop from one
position to another is to move windows. While this works fine if a window
is not in any special state, it doesn't work out with tiling.

This change introduces basic infrastructure to reorder virtual desktops.

M  +0    -22   src/plugins/overview/overvieweffect.cpp
M  +0    -2    src/plugins/overview/overvieweffect.h
M  +1    -1    src/plugins/overview/qml/main.qml
M  +12   -0    src/scripting/virtualdesktopmodel.cpp
M  +1    -0    src/scripting/virtualdesktopmodel.h
M  +10   -0    src/scripting/workspace_wrapper.cpp
M  +5    -0    src/scripting/workspace_wrapper.h
M  +30   -0    src/virtualdesktops.cpp
M  +10   -0    src/virtualdesktops.h
M  +25   -1    src/x11window.cpp
M  +3    -0    src/x11window.h

https://invent.kde.org/plasma/kwin/-/commit/e0569606ab5a5075a55e6d528e93d7abaf45d4f5
Comment 6 Vlad Zahorodnii 2025-06-07 11:37:49 UTC
Git commit 0f7dd844be0d01ff72b539b04ad2c37f0a29d662 by Vlad Zahorodnii.
Committed on 07/06/2025 at 10:29.
Pushed by vladz into branch 'Plasma/6.4'.

Implement proper virtual desktop reordering

At the moment, the only available to move a virtual desktop from one
position to another is to move windows. While this works fine if a window
is not in any special state, it doesn't work out with tiling.

This change introduces basic infrastructure to reorder virtual desktops.


(cherry picked from commit e0569606ab5a5075a55e6d528e93d7abaf45d4f5)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>

M  +0    -22   src/plugins/overview/overvieweffect.cpp
M  +0    -2    src/plugins/overview/overvieweffect.h
M  +1    -1    src/plugins/overview/qml/main.qml
M  +12   -0    src/scripting/virtualdesktopmodel.cpp
M  +1    -0    src/scripting/virtualdesktopmodel.h
M  +10   -0    src/scripting/workspace_wrapper.cpp
M  +5    -0    src/scripting/workspace_wrapper.h
M  +30   -0    src/virtualdesktops.cpp
M  +10   -0    src/virtualdesktops.h
M  +25   -1    src/x11window.cpp
M  +3    -0    src/x11window.h

https://invent.kde.org/plasma/kwin/-/commit/0f7dd844be0d01ff72b539b04ad2c37f0a29d662