on xenial help sign in
merge albert's test and add some more focus fixes
commit98e912cf5afa576a8c10435006c132394d1347bb authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 4 Apr 2017, 13:44 (10 years ago) parentdb3edc9
2 files changed+10−1
qml/Stage/Stage.qml+7 tests/qmltests/tst_Shell.qml+3−1
qml/Stage/Stage.qml+7
@@ -91,6 +91,7 @@ FocusScope {
9191
9292
9393 onAltTabPressedChanged: {
94+ root.focus = true;
9495 if (altTabPressed) {
9596 if (root.spreadEnabled) {
9697 altTabDelayTimer.start();
@@ -517,14 +518,20 @@ FocusScope {
517518 State {
518519 name: "staged"; when: root.mode === "staged"
519520 PropertyChanges { target: wallpaper; visible: !priv.focusedAppDelegate || priv.focusedAppDelegate.x !== 0 }
521+ PropertyChanges { target: root; focus: true }
522+ PropertyChanges { target: appContainer; focus: true }
520523 },
521524 State {
522525 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
523526 PropertyChanges { target: triGestureArea; enabled: priv.sideStageEnabled }
524527 PropertyChanges { target: sideStage; visible: true }
528+ PropertyChanges { target: root; focus: true }
529+ PropertyChanges { target: appContainer; focus: true }
525530 },
526531 State {
527532 name: "windowed"; when: root.mode === "windowed"
533+ PropertyChanges { target: root; focus: true }
534+ PropertyChanges { target: appContainer; focus: true }
528535 }
529536 ]
530537 transitions: [
tests/qmltests/tst_Shell.qml+3−1
@@ -3218,6 +3218,8 @@ Rectangle {
32183218 var appDelegate = startApplication("gmail-webapp");
32193219 var appDelegate2 = startApplication("dialer-app");
32203220
3221+ tryCompare(appDelegate2.surface, "activeFocus", true);
3222+
32213223 var maximizeButton = findChild(appDelegate2, "maximizeWindowButton");
32223224 mouseClick(maximizeButton);
32233225 tryCompare(appDelegate2, "state", "maximized");
@@ -3242,7 +3244,7 @@ Rectangle {
32423244 if (data.showSpread) {
32433245 tryCompare(stage, "spreadShown", true);
32443246 }
3245− tryCompareFunction(function() { return menuBarLoader.active === false; }, true);
3247+ tryCompare(panelMenuItem, "__popup", null);
32463248 keyRelease(Qt.Key_Alt)
32473249
32483250 tryCompare(appDelegate.surface, "activeFocus", true);