on xenial help sign in
close the drawer when something is launched from the launcher (LP: #1660367)

Approved by: Albert Astals Cid, Unity8 CI Bot

commitfd624b6d4251d5b55001d62679af5b66afb3c971 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 8 Mar 2017, 09:51 (10 years ago) parent13173a83a240ae
2 files changed+20
qml/Launcher/Launcher.qml+3 tests/qmltests/Launcher/tst_Drawer.qml+17
qml/Launcher/Launcher.qml+3
@@ -114,6 +114,9 @@ FocusScope {
114114
115115 function hide(flags) {
116116 if ((flags & ignoreHideIfMouseOverLauncher) && Utils.Functions.itemUnderMouse(panel)) {
117+ if (state == "drawer") {
118+ switchToNextState("visibleTemporary");
119+ }
117120 return;
118121 }
119122 switchToNextState("")
tests/qmltests/Launcher/tst_Drawer.qml+17
@@ -311,5 +311,22 @@ StyledItem {
311311
312312 compare(launcher.lastSelectedApplication, "calendar-app");
313313 }
314+
315+ function test_focusAppFromLauncherWhileDrawerIsOpen() {
316+ // FIXME: Skipping this test because of a bug in Qt. Please enable
317+ // once https://codereview.qt-project.org/#/c/184942/ is accepted
318+ skip();
319+
320+ launcher.openDrawer(true);
321+ waitForRendering(launcher);
322+ waitUntilTransitionsEnd(launcher);
323+
324+ var appIcon = findChild(launcher, "launcherDelegate4")
325+
326+ mouseMove(launcher, units.gu(4), launcher.height / 2)
327+ mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2);
328+
329+ tryCompare(launcher, "state", "visibleTemporary");
330+ }
314331 }
315332}