@@ -29,7 +29,7 @@ Item {
2929 property int stageHeight
3030 property real buttonsWidth: 0
3131
32− readonly property alias dragging: priv.dragging
32+ property alias dragging: priv.dragging
3333
3434 signal fakeMaximizeAnimationRequested(real progress)
3535 signal fakeMaximizeLeftAnimationRequested(real progress)
@@ -104,6 +104,7 @@ Item {
104104 Mir.cursorName = "grabbing";
105105
106106 if (target.anyMaximized) { // restore from maximized when dragging away from edges/corners
107+ print("!!! Restoring maximized window after a drag away")
107108 priv.progress = 0;
108109 target.restore(false, WindowStateStorage.WindowStateNormal);
109110 }
@@ -115,75 +116,75 @@ Item {
115116 target.requestedX = Math.round(pos.x - priv.distanceX);
116117 target.requestedY = Math.round(Math.max(pos.y - priv.distanceY, PanelState.panelHeight));
117118
118− var globalPos = mapToItem(null, mouse.x, mouse.y);
119− var globalX = globalPos.x;
120− var globalY = globalPos.y;
121− if (globalX < priv.triggerArea && globalY < PanelState.panelHeight) { // top left
122− if (target.canBeCornerMaximized) {
123− priv.progress = priv.progressInCorner(0, PanelState.panelHeight, globalX, globalY);
124− priv.resetEdges();
125− priv.nearTopLeftCorner = true;
126− root.fakeMaximizeTopLeftAnimationRequested(priv.progress);
127− }
128− } else if (globalX > stageWidth - priv.triggerArea && globalY < PanelState.panelHeight) { // top right
129− if (target.canBeCornerMaximized) {
130− priv.progress = priv.progressInCorner(stageWidth, PanelState.panelHeight, globalX, globalY);
131− priv.resetEdges();
132− priv.nearTopRightCorner = true;
133− root.fakeMaximizeTopRightAnimationRequested(priv.progress);
134− }
135− } else if (globalX < priv.triggerArea && globalY > stageHeight - priv.triggerArea) { // bottom left
136− if (target.canBeCornerMaximized) {
137− priv.progress = priv.progressInCorner(0, stageHeight, globalX, globalY);
138− priv.resetEdges();
139− priv.nearBottomLeftCorner = true;
140− root.fakeMaximizeBottomLeftAnimationRequested(priv.progress);
141− }
142− } else if (globalX > stageWidth - priv.triggerArea && globalY > stageHeight - priv.triggerArea) { // bottom right
143− if (target.canBeCornerMaximized) {
144− priv.progress = priv.progressInCorner(stageWidth, stageHeight, globalX, globalY);
145− priv.resetEdges();
146− priv.nearBottomRightCorner = true;
147− root.fakeMaximizeBottomRightAnimationRequested(priv.progress);
148− }
149− } else if (globalX < priv.triggerArea) { // left
150− if (target.canBeMaximizedLeftRight) {
151− priv.progress = MathUtils.clampAndProject(globalX, priv.triggerArea, 0, 0, 1);
152− priv.resetEdges();
153− priv.nearLeftEdge = true;
154− root.fakeMaximizeLeftAnimationRequested(priv.progress);
155− }
156− } else if (globalX > stageWidth - priv.triggerArea) { // right
157− if (target.canBeMaximizedLeftRight) {
158− priv.progress = MathUtils.clampAndProject(globalX, stageWidth - priv.triggerArea, stageWidth, 0, 1);
159− priv.resetEdges();
160− priv.nearRightEdge = true;
161− root.fakeMaximizeRightAnimationRequested(priv.progress);
162− }
163− } else if (globalY < PanelState.panelHeight) { // top
164− if (target.canBeMaximized) {
165− priv.progress = MathUtils.clampAndProject(globalY, Math.max(PanelState.panelHeight, priv.triggerArea), 0, 0, 1);
166− priv.resetEdges();
167− priv.nearTopEdge = true;
168− root.fakeMaximizeAnimationRequested(priv.progress);
169− }
170− } else if (priv.nearLeftEdge || priv.nearRightEdge || priv.nearTopEdge || priv.nearTopLeftCorner || priv.nearTopRightCorner ||
171− priv.nearBottomLeftCorner || priv.nearBottomRightCorner) {
172− print("!!! Exited")
173− priv.progress = 0;
174− priv.resetEdges();
175− root.stopFakeAnimation();
176− }
119+// var globalPos = mapToItem(null, mouse.x, mouse.y);
120+// var globalX = globalPos.x;
121+// var globalY = globalPos.y;
122+// if (globalX < priv.triggerArea && globalY < PanelState.panelHeight) { // top left
123+// if (target.canBeCornerMaximized) {
124+// priv.progress = priv.progressInCorner(0, PanelState.panelHeight, globalX, globalY);
125+// priv.resetEdges();
126+// priv.nearTopLeftCorner = true;
127+// root.fakeMaximizeTopLeftAnimationRequested(priv.progress);
128+// }
129+// } else if (globalX > stageWidth - priv.triggerArea && globalY < PanelState.panelHeight) { // top right
130+// if (target.canBeCornerMaximized) {
131+// priv.progress = priv.progressInCorner(stageWidth, PanelState.panelHeight, globalX, globalY);
132+// priv.resetEdges();
133+// priv.nearTopRightCorner = true;
134+// root.fakeMaximizeTopRightAnimationRequested(priv.progress);
135+// }
136+// } else if (globalX < priv.triggerArea && globalY > stageHeight - priv.triggerArea) { // bottom left
137+// if (target.canBeCornerMaximized) {
138+// priv.progress = priv.progressInCorner(0, stageHeight, globalX, globalY);
139+// priv.resetEdges();
140+// priv.nearBottomLeftCorner = true;
141+// root.fakeMaximizeBottomLeftAnimationRequested(priv.progress);
142+// }
143+// } else if (globalX > stageWidth - priv.triggerArea && globalY > stageHeight - priv.triggerArea) { // bottom right
144+// if (target.canBeCornerMaximized) {
145+// priv.progress = priv.progressInCorner(stageWidth, stageHeight, globalX, globalY);
146+// priv.resetEdges();
147+// priv.nearBottomRightCorner = true;
148+// root.fakeMaximizeBottomRightAnimationRequested(priv.progress);
149+// }
150+// } else if (globalX < priv.triggerArea) { // left
151+// if (target.canBeMaximizedLeftRight) {
152+// priv.progress = MathUtils.clampAndProject(globalX, priv.triggerArea, 0, 0, 1);
153+// priv.resetEdges();
154+// priv.nearLeftEdge = true;
155+// root.fakeMaximizeLeftAnimationRequested(priv.progress);
156+// }
157+// } else if (globalX > stageWidth - priv.triggerArea) { // right
158+// if (target.canBeMaximizedLeftRight) {
159+// priv.progress = MathUtils.clampAndProject(globalX, stageWidth - priv.triggerArea, stageWidth, 0, 1);
160+// priv.resetEdges();
161+// priv.nearRightEdge = true;
162+// root.fakeMaximizeRightAnimationRequested(priv.progress);
163+// }
164+// } else if (globalY < PanelState.panelHeight) { // top
165+// if (target.canBeMaximized) {
166+// priv.progress = MathUtils.clampAndProject(globalY, Math.max(PanelState.panelHeight, priv.triggerArea), 0, 0, 1);
167+// priv.resetEdges();
168+// priv.nearTopEdge = true;
169+// root.fakeMaximizeAnimationRequested(priv.progress);
170+// }
171+// } else if (priv.nearLeftEdge || priv.nearRightEdge || priv.nearTopEdge || priv.nearTopLeftCorner || priv.nearTopRightCorner ||
172+// priv.nearBottomLeftCorner || priv.nearBottomRightCorner) {
173+// print("!!! Exited")
174+// priv.progress = 0;
175+// priv.resetEdges();
176+// root.stopFakeAnimation();
177+// }
177178 }
178179 }
179180
180181 function handleReleased(mouse) {
181− print("Mouse released (left/top/right)", priv.nearLeftEdge, priv.nearTopEdge, priv.nearRightEdge)
182182 if (mouse.button == Qt.LeftButton && (target.state == "normal" || target.state == "restored") && priv.progress == 0) {
183183 // save the x/y to restore to
184+ print("!!! Saving restoredX/Y")
184185 target.restoredX = target.x;
185186 target.restoredY = target.y;
186− } else if (priv.progress < 0.3) { // cancel the preview shape if under 30%
187+ } /*else if (priv.progress < 0.3) { // cancel the preview shape if under 30%
187188 priv.progress = 0;
188189 priv.resetEdges();
189190 root.stopFakeAnimation();
@@ -208,6 +209,6 @@ Item {
208209 } else if (priv.nearBottomRightCorner) {
209210 target.maximizeBottomRight();
210211 priv.resetEdges();
211− }
212+ }*/
212213 }
213214}