@@ -83,17 +83,18 @@ Item {
8383 }
8484
8585 function handlePressedChanged(pressed, pressedButtons, mouseX, mouseY) {
86− if (pressed && pressedButtons == Qt.LeftButton) {
86+ if (pressed && pressedButtons === Qt.LeftButton) {
8787 var pos = mapToItem(target, mouseX, mouseY);
8888 if (target.anyMaximized) {
8989 // keep distanceX relative to the normal window width minus the window control buttons (+spacing)
9090 // so that dragging it back doesn't make the window jump around to weird positions, away from the mouse pointer
9191 priv.distanceX = MathUtils.clampAndProject(pos.x, 0, target.width, buttonsWidth, target.resizeArea.normalWidth);
92+ priv.distanceY = MathUtils.clampAndProject(pos.y, 0, target.height, 0, target.resizeArea.normalHeight);
9293 } else {
9394 priv.distanceX = pos.x;
95+ priv.distanceY = pos.y;
9496 }
9597
96− priv.distanceY = pos.y;
9798 priv.dragging = true;
9899 } else {
99100 priv.dragging = false;