Bug 459226 - [Desktop grid] Window re-arranging animation played when dragging whole VD to another empty VD
Summary: [Desktop grid] Window re-arranging animation played when dragging whole VD to...
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-overview (other bugs)
Version First Reported In: 6.0.1
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: ratijas
URL:
Keywords:
: 486202 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-09-16 15:58 UTC by postix
Modified: 2024-12-01 19:26 UTC (History)
3 users (show)

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


Attachments
Screenrecording: With MR2965 (1.48 MB, video/x-matroska)
2022-09-17 11:20 UTC, postix
Details
Screenrecording: Without MR2965 (1.47 MB, video/x-matroska)
2022-09-17 11:20 UTC, postix
Details
Desktop Grid behavior in 11/28 master (1.97 MB, video/mp4)
2024-12-01 19:26 UTC, Blazer Silving
Details

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2022-09-16 15:58:09 UTC
STEPS TO REPRODUCE
1. Open the grid view
2.  Drag all windows of a VD together to another empty VD. In my case I had like 6 windows opened

OBSERVED RESULT
The windows appear to re-arrange to the very some positions on drop.

EXPECTED RESULT
The windows do not re-arrange but simply drop at their right spots in the same spacial configuration as they are dragged.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220914
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.5
Graphics Platform: Wayland
Comment 1 Nate Graham 2022-09-16 20:47:35 UTC
Can confirm.
Comment 2 ratijas 2022-09-16 22:09:14 UTC
I believe this is due to an incorrect usage of a TextField API in QML/QtQuick:

>     onTextChanged: {
>         effect.searchText = text;
>         heap.resetSelected();
>         heap.selectNextItem(WindowHeap.Direction.Down);
>     }
>     Binding {
>         target: searchField
>         property: "text"
>         value: effect.searchText
>     }

My gut feeling tells my this Binding should've never existed. and onTextEdited should've been used in the first place.

There's also the Window View effect, which is like Overview but should be merged with it. And there's a similar SearchField, but with a comment:

>             // Binding loops will be avoided from the fact that setting the text to the same won't emit textChanged

which supports my theory that developers simply didn't know the trick.

Also, the root cause here is this function:

>    function start() {
>        animationEnabled = true;
>        organized = true;
>        searchField.text = "";
>    }

Clearly, it resets search text too late.
Comment 3 ratijas 2022-09-16 22:23:01 UTC
...not to mention that the `searchText` property exists only in WindowViewEffect class, but not in OverviewEffect :-\

how did it even…
Comment 4 Bug Janitor Service 2022-09-17 00:05:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2965
Comment 5 Bug Janitor Service 2022-09-17 00:05:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2965
Comment 6 postix 2022-09-17 11:20:16 UTC
Created attachment 152148 [details]
Screenrecording: With MR2965

Short feedback: I have tested the current state of MR2965, but unfortunately it hasn't fixed the issue for me yet. Please see the screen recording.
Comment 7 postix 2022-09-17 11:20:33 UTC
Created attachment 152149 [details]
Screenrecording: Without MR2965
Comment 8 ratijas 2022-09-17 11:43:23 UTC
> Short feedback: I have tested the current state of MR2965, but unfortunately it hasn't fixed the issue for me yet. Please see the screen recording.

I must have linked the wrong BUG number. That MR fixes the rearrangement after searching and not clearing the search text. It should've been BUG 459202. Thanks, I'll correct the commit description now.

The rearrangement I see here is likely because desktops get recreated, and the new window heap instance re-layouts its content. It really sucks that it is not deterministic as it should be.
Comment 9 Blazer Silving 2024-12-01 19:13:07 UTC
*** Bug 486202 has been marked as a duplicate of this bug. ***
Comment 10 Blazer Silving 2024-12-01 19:24:35 UTC
This is still an issue in latest master (6.3), provided video clip demonstrating this. 
The clip demonstrates normal window drop behavior, and then attempts to perform this drop action on the entire desktop's selection. The two methods should ideally behave as similarly as possible. 

When an entire selection of a desktop's windows are dropped into a Desktop Grid tile, the windows will animate rearranging themselves upon drop, without actually changing positions. 

In addition to the rearrangement animation, the drop animation is also missing, evident in the clip. 
This results in an abrupt pop to the destination desktop, when the windows should "glide" to their destination or back as a whole, as individual windows do.
Comment 11 Blazer Silving 2024-12-01 19:26:58 UTC
Created attachment 176269 [details]
Desktop Grid behavior in 11/28 master