Bug 509860 - Dragging widgets on top of each other on the desktop freezes and slows down desktop (outside edit mode)
Summary: Dragging widgets on top of each other on the desktop freezes and slows down d...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.5.80
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: efficiency-and-performance
Depends on:
Blocks:
 
Reported: 2025-09-24 09:33 UTC by Akseli Lahtinen
Modified: 2025-09-26 16:49 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Akseli Lahtinen 2025-09-24 09:33:08 UTC
SUMMARY

When user moves widget and it overlaps another outside edit mode, this can cause plasmashell to completely freeze.

STEPS TO REPRODUCE
1. In edit mode, add two widgets, they can be anything, though folderview + any widget seems to have most consistent results
2. Exit edit mode
3. Hold on either of the widgets for it to be movable
4. Move it over the other widget

OBSERVED RESULT
Slowdowns, hiccups, maybe even proper freezing that requires user to kill the plasmashell session

EXPECTED RESULT
Smooth as butter

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 42
KDE Plasma Version: 6.5.80
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.2
Kernel Version: 6.16.7-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 16 GiB of RAM (15.5 GiB usable)
Graphics Processor: AMD Radeon RX 6600

ADDITIONAL INFORMATION
This happens to me with any widgets, but folderview seems to cause most havoc.
Comment 1 Akseli Lahtinen 2025-09-24 15:04:10 UTC
More information:

- I have single monitor
- I have two activities
- Both activities have two virtual desktops
- Trying to move folderview widget outside of the monitors right side will cause even worse freeze

- I have mouse with 1000hz polling rate (idk that affects anything but aynway)
Comment 2 Nate Graham 2025-09-24 20:06:43 UTC
Hmm, I'm not able to reproduce this when dragging an Analog Clock widget on top of a Folder View widget, or vice versa. Outside of edit mode.

One monitor, one virtual desktop, one activity, mouse with 125hz polling rate.
Comment 3 Akseli Lahtinen 2025-09-25 10:12:20 UTC
Okay I found the issue, it's the refresh rate.

If I set the mouse refresh rate to 125hz, it all works fine. If I set it to 1000hz, it gets sad.
Comment 4 Bug Janitor Service 2025-09-25 12:10:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5851
Comment 5 Marco Martin 2025-09-25 13:58:19 UTC
Git commit a066ed7d1e3c390cb705e37cbf4053eba9dedafc by Marco Martin.
Committed on 25/09/2025 at 13:58.
Pushed by mart into branch 'master'.

ContanmentLayoutManager: Limit relayout of placeholder

While dragging an applet around, the placeholder gets laid out at the
position an applet would be normally positioned to show the final
position and size the applet would have.
But this is a somewhat expensive operation, which is not a problem
with devices with a relatively low polling rate, but becomes
a problem with gaming mice that can have a refresh rate of 1000Hz
and up.

Limit the relayout to 10 fps, since it moves snapping, we don't
need to be smooth at all, just as cheap as possible

M  +5    -1    components/containmentlayoutmanager/itemcontainer.cpp
M  +3    -0    components/containmentlayoutmanager/itemcontainer.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/a066ed7d1e3c390cb705e37cbf4053eba9dedafc
Comment 6 Marco Martin 2025-09-25 14:09:08 UTC
Git commit 607cd6067f25beeb98b06ec43a1d778ad30c99c7 by Marco Martin.
Committed on 25/09/2025 at 13:58.
Pushed by mart into branch 'Plasma/6.5'.

ContanmentLayoutManager: Limit relayout of placeholder

While dragging an applet around, the placeholder gets laid out at the
position an applet would be normally positioned to show the final
position and size the applet would have.
But this is a somewhat expensive operation, which is not a problem
with devices with a relatively low polling rate, but becomes
a problem with gaming mice that can have a refresh rate of 1000Hz
and up.

Limit the relayout to 10 fps, since it moves snapping, we don't
need to be smooth at all, just as cheap as possible


(cherry picked from commit a066ed7d1e3c390cb705e37cbf4053eba9dedafc)

c3c5ee83 ContanmentLayoutManager: Limit relayout of placeholder
2207f832 Use grid resolution instead of a timer

Co-authored-by: Marco Martin <notmart@gmail.com>

M  +5    -1    components/containmentlayoutmanager/itemcontainer.cpp
M  +3    -0    components/containmentlayoutmanager/itemcontainer.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/607cd6067f25beeb98b06ec43a1d778ad30c99c7
Comment 7 Akseli Lahtinen 2025-09-26 16:49:33 UTC
Git commit 92b57ea3fda504e644dd55fd1a7fd8dee9304d27 by Akseli Lahtinen.
Committed on 26/09/2025 at 16:49.
Pushed by akselmo into branch 'master'.

GridLayoutManager: Fix some freezes that would happen with dragging widgets

GridLayoutManager does a lot of calculations when
looking for the next fitting spot for a widget.
These are while loops that can often get stuck
trying to find something perfect.

Instead, try only searching for small areas:
We lose some precision for available spots, but
we gain more performance. This is especially noticeable
on high resolution displays.

We should also not start calculating for the
position from start, but from the position
of the item, otherwise we'll do a lot of work
for minimal precision gains.

M  +32   -39   components/containmentlayoutmanager/gridlayoutmanager.cpp
M  +1    -1    components/containmentlayoutmanager/gridlayoutmanager.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/92b57ea3fda504e644dd55fd1a7fd8dee9304d27