mirror of
https://invent.kde.org/plasma/plasma-desktop.git
synced 2026-11-03 14:49:44 -09:00
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:
parent
c2312d5863
commit
05b6f911bc
1 changed files with 2 additions and 2 deletions
|
|
@ -125,9 +125,9 @@ function childAtCoordinates(x, y) {
|
||||||
if (root.isHorizontal) {
|
if (root.isHorizontal) {
|
||||||
// Only yields incorrect results for widgets smaller than the
|
// Only yields incorrect results for widgets smaller than the
|
||||||
// row/column spacing, which is luckily fairly unrealistic
|
// row/column spacing, which is luckily fairly unrealistic
|
||||||
x -= layout.rowSpacing
|
x -= Math.max(1, layout.rowSpacing)
|
||||||
} else {
|
} else {
|
||||||
y -= layout.columnSpacing
|
y -= Math.max(1, layout.columnSpacing)
|
||||||
}
|
}
|
||||||
if (x < 0 || y < 0) {
|
if (x < 0 || y < 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue