@@ -38,8 +38,6 @@ Item {
3838 signal fakeMaximizeBottomRightAnimationRequested(real progress)
3939 signal stopFakeAnimation()
4040
41− signal doubleClicked()
42−
4341 QtObject {
4442 id: priv
4543 property real distanceX
@@ -80,14 +78,6 @@ Item {
8078 property real progress: 0
8179 }
8280
83− function handleDoubleClicked(mouse) {
84− priv.resetEdges();
85− if (target.canBeMaximized && mouse.button == Qt.LeftButton) {
86− priv.dragging = false; // do not interfere with a quick double click followed by a mouse move/drag
87− root.doubleClicked();
88− }
89− }
90−
9181 function handlePressedChanged(pressed, pressedButtons, mouseX, mouseY) {
9282 if (pressed && pressedButtons == Qt.LeftButton) {
9383 var pos = mapToItem(target, mouseX, mouseY);
@@ -107,7 +97,7 @@ Item {
10797 }
10898 }
10999
110− function handlePositionChanged(mouseX, mouseY) {
100+ function handlePositionChanged(mouse) {
111101 if (priv.dragging) {
112102 Mir.cursorName = "grabbing";
113103
@@ -116,14 +106,14 @@ Item {
116106 target.restore(false, WindowStateStorage.WindowStateNormal);
117107 }
118108
119− var pos = mapToItem(target.parent, mouseX, mouseY);
109+ var pos = mapToItem(target.parent, mouse.x, mouse.y);
120110 // Use integer coordinate values to ensure that target is left in a pixel-aligned
121111 // position. Mouse movement could have subpixel precision, yielding a fractional
122112 // mouse position.
123113 target.requestedX = Math.round(pos.x - priv.distanceX);
124114 target.requestedY = Math.round(Math.max(pos.y - priv.distanceY, PanelState.panelHeight));
125115
126− var globalPos = mapToItem(null, mouseX, mouseY);
116+ var globalPos = mapToItem(null, mouse.x, mouse.y);
127117 var globalX = globalPos.x;
128118 var globalY = globalPos.y;
129119 if (globalX < priv.triggerArea && globalY < PanelState.panelHeight) { // top left
@@ -197,18 +187,25 @@ Item {
197187 root.stopFakeAnimation();
198188 } else if (priv.nearLeftEdge) {
199189 target.maximizeLeft();
190+ priv.resetEdges();
200191 } else if (priv.nearTopEdge) {
201192 target.maximize();
193+ priv.resetEdges();
202194 } else if (priv.nearRightEdge) {
203195 target.maximizeRight();
196+ priv.resetEdges();
204197 } else if (priv.nearTopLeftCorner) {
205198 target.maximizeTopLeft();
199+ priv.resetEdges();
206200 } else if (priv.nearTopRightCorner) {
207201 target.maximizeTopRight();
202+ priv.resetEdges();
208203 } else if (priv.nearBottomLeftCorner) {
209204 target.maximizeBottomLeft();
205+ priv.resetEdges();
210206 } else if (priv.nearBottomRightCorner) {
211207 target.maximizeBottomRight();
208+ priv.resetEdges();
212209 }
213210 }
214211}