containments/panel: don't hang when the layout spacing is 0

childAtCoordinates() steps back by the layout's spacing until it finds
a widget. With a spacing of 0, which some third-party widgets set, the
point never moves, so dragging something over an empty part of the
panel froze plasmashell.

Always step back by at least 1 px.

BUG: 528228
This commit is contained in:
Niccolò Venerandi 2026-11-02 21:03:30 +01:00
parent c2312d5863
commit 05b6f911bc

View file

@ -125,9 +125,9 @@ function childAtCoordinates(x, y) {
if (root.isHorizontal) {
// Only yields incorrect results for widgets smaller than the
// row/column spacing, which is luckily fairly unrealistic
x -= layout.rowSpacing
x -= Math.max(1, layout.rowSpacing)
} else {
y -= layout.columnSpacing
y -= Math.max(1, layout.columnSpacing)
}
if (x < 0 || y < 0) {
return 0;