Bug 453749 - In WindowHeap-based effects, do not re-arrange windows' positions immediately when a window is closed
Summary: In WindowHeap-based effects, do not re-arrange windows' positions immediately...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-window-management (show other bugs)
Version: 5.24.5
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2022-05-13 16:57 UTC by postix
Modified: 2024-03-16 19:51 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2022-05-13 16:57:24 UTC
SUMMARY

Closing a window from a set of displayed windows, make all windows re-arrange so that they best fit the available space. 
This happens automatically and instantly. However, it makes it hard to keep an overview since it's hard to track the windows movement, especially when there are many windows opened (like > 5). 

It would be therefore helpful if the window would not re-arrange instantly or would arrange just slower, so it becomes easier to find the next window to work with.
Comment 1 fanzhuyifan 2024-02-09 08:25:33 UTC
Currently this just follows the global animation speed. 

With the new proposed layout algorithm, the re-arrangements should be saner: https://invent.kde.org/plasma/kwin/-/merge_requests/4916
Comment 2 fanzhuyifan 2024-02-19 11:55:52 UTC
Git commit c3cda8b62ad3825883826bdd1928c8761aeb026d by Yifan Zhu.
Committed on 19/02/2024 at 11:46.
Pushed by fanzhuyifan into branch 'master'.

effects/overview: implement new layout algorithm

Replace old "closest" and "natural" layout algorithms with new layout
algorithm. The new layout algorithm tries to
- use screen space efficiently, given diverse geometries of windows
- be aesthetically pleasing
- and minimize movement of windows from initial positions.

More concretely, find a layered layout, where each layer, or strip, is a
row or column. Ensure that different strips have similar widths, and use
binary search to find a packing with similar aspect ratio to the layout
area. Within each strip, minimize horizontal movement (for rows) or
vertical movement (for columns) of windows.

Run time is O(n) (up to log factors), where n is the number of windows.
Related: bug 450263, bug 477833, bug 478097, bug 477830

M  +6    -27   src/plugins/overview/kcm/overvieweffectkcm.ui
M  +0    -3    src/plugins/overview/overviewconfig.kcfg
M  +0    -14   src/plugins/overview/overvieweffect.cpp
M  +0    -6    src/plugins/overview/overvieweffect.h
M  +0    -1    src/plugins/overview/qml/main.qml
M  +436  -399  src/plugins/private/expolayout.cpp
M  +204  -28   src/plugins/private/expolayout.h
M  +2    -2    src/plugins/private/qml/WindowHeap.qml
M  +4    -25   src/plugins/windowview/kcm/windowvieweffectkcm.ui
M  +0    -1    src/plugins/windowview/qml/main.qml
M  +0    -3    src/plugins/windowview/windowviewconfig.kcfg
M  +0    -14   src/plugins/windowview/windowvieweffect.cpp
M  +0    -6    src/plugins/windowview/windowvieweffect.h

https://invent.kde.org/plasma/kwin/-/commit/c3cda8b62ad3825883826bdd1928c8761aeb026d
Comment 3 postix 2024-03-16 19:51:44 UTC
(In reply to fanzhuyifan from comment #1)
> Currently this just follows the global animation speed. 
> 
> With the new proposed layout algorithm, the re-arrangements should be saner:
> https://invent.kde.org/plasma/kwin/-/merge_requests/4916

Than let's close it for now and call it fixed for 6.1