on xenial help sign in
restore the double tap decoration to maximize feature
commite48ebfde675d935ba4e7b1556d1f5c51eec3b994 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 27 Sep 2016, 17:03 (10 years ago) parentaadcb3d
3 files changed+21−2
qml/Stage/MoveHandler.qml+2−1 qml/Stage/Stage.qml+3−1 tests/qmltests/Stage/tst_DesktopStage.qml+16
qml/Stage/MoveHandler.qml+2−1
@@ -103,7 +103,8 @@ QtObject {
103103 if (priv.dragging) {
104104 Mir.cursorName = "grabbing";
105105
106− if (target.anyMaximized) { // restore from maximized when dragging away from edges/corners
106+ // restore from maximized when dragging away from edges/corners; guard against inadvertent changes when going into maximized state
107+ if (target.anyMaximized && !target.windowedTransitionRunning) {
107108 priv.progress = 0;
108109 target.restore(false, WindowStateStorage.WindowStateNormal);
109110 }
qml/Stage/Stage.qml+3−1
@@ -707,6 +707,7 @@ FocusScope {
707707 readonly property string appName: model.application ? model.application.name : ""
708708 property bool visuallyMaximized: false
709709 property bool visuallyMinimized: false
710+ readonly property alias windowedTransitionRunning: windowedTransition.running
710711
711712 property int stage: ApplicationInfoInterface.MainStage
712713 function saveStage(newStage) {
@@ -1155,7 +1156,7 @@ FocusScope {
11551156 }
11561157 },
11571158 State {
1158− name: "maximized"; when: appDelegate.windowState == WindowStateStorage.WindowStateMaximized
1159+ name: "maximized"; when: appDelegate.maximized && !appDelegate.minimized
11591160 PropertyChanges {
11601161 target: appDelegate;
11611162 requestedX: root.leftMargin;
@@ -1372,6 +1373,7 @@ FocusScope {
13721373 }
13731374 },
13741375 Transition {
1376+ id: windowedTransition
13751377 to: "normal,maximized,maximizedLeft,maximizedRight,maximizedTop,maximizedBottom,maximizedTopLeft,maximizedTopRight,maximizedBottomLeft,maximizedBottomRight,maximizedHorizontally,maximizedVertically,fullscreen"
13761378 enabled: appDelegate.animationsEnabled
13771379 SequentialAnimation {
tests/qmltests/Stage/tst_DesktopStage.qml+16
@@ -772,5 +772,21 @@ Item {
772772
773773 tryCompare(mouseEaterSpy, "count", 0);
774774 }
775+
776+ // regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1627281
777+ function test_doubleTapToMaximizeWindow() {
778+ var dialerAppDelegate = startApplication("dialer-app");
779+ verify(dialerAppDelegate);
780+ var decoration = findChild(dialerAppDelegate, "appWindowDecoration");
781+ verify(decoration);
782+
783+ // simulate a double tap, with a slight erroneous move in between those 2 taps
784+ tap(decoration);
785+ touchPress(decoration);
786+ touchMove(decoration, decoration.width/2, decoration.height/2 - 10)
787+ touchRelease(decoration);
788+
789+ tryCompare(dialerAppDelegate, "state", "maximized");
790+ }
775791 }
776792}