Bug 497137 - Moving one widget too close to another on the desktop causes the widget being moved to shrink in order to fit, instead of snapping at its current size to the nearest allowable position
Summary: Moving one widget too close to another on the desktop causes the widget being...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Containment (other bugs)
Version First Reported In: 6.2.4
Platform: Arch Linux Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-06 18:00 UTC by Filip
Modified: 2025-02-08 02:56 UTC (History)
3 users (show)

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


Attachments
showcase 1 (1.90 MB, video/mp4)
2024-12-06 18:00 UTC, Filip
Details
showcase 2 (1.91 MB, video/mp4)
2024-12-06 18:00 UTC, Filip
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Filip 2024-12-06 18:00:27 UTC
SUMMARY
Widget sizes change when you overlap 2 widgets when dragging in order to snap them close to each other

STEPS TO REPRODUCE
1. Add 2 widgets to desktop
2. Drag one close to the other and overlap them a bit

OBSERVED RESULT
Dragged widget is reduced in size when snapped in place

EXPECTED RESULT
Widget is snapped at the closest distance from the other widget while keeping its original size

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.1
Kernel Version: 6.12.1-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 Filip 2024-12-06 18:00:38 UTC
Created attachment 176398 [details]
showcase 1
Comment 2 Filip 2024-12-06 18:00:53 UTC
Created attachment 176399 [details]
showcase 2
Comment 3 John Kizer 2024-12-17 04:04:40 UTC
I can reproduce on Fedora KDE 41.
Comment 4 John Kizer 2024-12-17 04:07:28 UTC
Marking this as Confirmed instead of a duplicate of https://bugs.kde.org/show_bug.cgi?id=359653 since that one appeared to be Resolved/Intentional because disallowing overlapping widgets is a design choice; this one is in agreement with that point, but raising an issue with how the would-be overlap is handled
Comment 5 Bug Janitor Service 2025-02-06 14:25:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5168
Comment 6 Niccolò Venerandi 2025-02-07 15:58:53 UTC
Git commit bb150110d4da5bad133bb31a25e07eba2e7d3480 by Niccolò Venerandi.
Committed on 07/02/2025 at 15:58.
Pushed by niccolove into branch 'master'.

Improve accuracy of positioning of elements in applet layout

Avoids overlapping of applets by always using the latest calculated
item position (since the x, y values might not be updated yet),
iterates cell-by-cell to find the closes available position and
accounts for both distance and change in size when choosing for
the best free space available.

M  +15   -13   components/containmentlayoutmanager/abstractlayoutmanager.cpp
M  +7    -5    components/containmentlayoutmanager/abstractlayoutmanager.h
M  +0    -2    components/containmentlayoutmanager/appletslayout.cpp
M  +12   -17   components/containmentlayoutmanager/gridlayoutmanager.cpp
M  +1    -1    components/containmentlayoutmanager/gridlayoutmanager.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/bb150110d4da5bad133bb31a25e07eba2e7d3480