diff --git a/packages/omamobile-shell/plugins/omamobile.launcher/Launcher.qml b/packages/omamobile-shell/plugins/omamobile.launcher/Launcher.qml index 7bf8562e8..8ccbb3505 100644 --- a/packages/omamobile-shell/plugins/omamobile.launcher/Launcher.qml +++ b/packages/omamobile-shell/plugins/omamobile.launcher/Launcher.qml @@ -470,7 +470,8 @@ Item { // controls apps keep at the very bottom (the Phone app's Favorites, // Recents, Contacts and Keypad tabs). The zone goes with the window: the // strip isn't mapped on the home screen (the dock reserves its own height - // there), with the drawer open, under the lock screen's keyboard, or for + // there) or with the drawer open, unless the keyboard is up and covers the + // dock; nor under the lock screen's keyboard, or for // a fullscreen window (video, the screensaver), which keeps the whole // screen. Under the lock it isn't drawn (no above_lock rule in // hypr/phone.lua), and the session lock's surface covers the whole screen @@ -667,7 +668,10 @@ Item { // The strip is on screen (each screen's window shows with it), and it is // the keyboard's strip: the keyboard is up above it. - readonly property bool stripShown: appOnScreen && !opened && !fullscreenOnScreen && !(oskOpen && sessionLocked) + // While the keyboard is up the strip shows on the home screen too, and + // over the open drawer (its search field): the keyboard covers the dock + // there, and with it the swipe up to the drawer. + readonly property bool stripShown: (appOnScreen || oskOpen) && (!opened || oskOpen) && !fullscreenOnScreen && !(oskOpen && sessionLocked) readonly property bool keyboardStripShown: stripShown && oskOpen Process { @@ -1224,7 +1228,9 @@ Item { property bool recents: false onActiveTranslationChanged: { swipeY = activeTranslation.y - if (recents) return + // Over the open drawer a swipe only closes it: recent apps from + // there left the drawer half open over the next app. + if (recents || root.opened) return if (swipeY < -120) { recents = true hold.stop() @@ -1237,7 +1243,17 @@ Item { if (active) { swipeY = 0; recents = false; return } hold.stop() console.log("omamobile-home-indicator: swipe", Math.round(swipeY), recents ? "recents" : "", "(" + swipeArea.strip + ")") - if (!recents && swipeY < -24) root.goHome() + if (!recents && swipeY < -24 && root.opened) { + // Over the drawer (searching): the keyboard goes and the drawer + // closes, back to the home screen. + root.keyboardCall("hideKeyboard") + root.dismiss(0) + } else if (!recents && swipeY < -24 && !root.appOnScreen) { + // On the home screen (the keyboard's strip, no app): the drawer + // opens, as the dock's swipe does, and the keyboard goes. + root.keyboardCall("hideKeyboard") + root.expand() + } else if (!recents && swipeY < -24) root.goHome() } } @@ -1245,7 +1261,7 @@ Item { id: hold interval: 350 onTriggered: { - if (!swipe.active || swipe.recents) return + if (!swipe.active || swipe.recents || root.opened) return swipe.recents = true root.showRecents() } diff --git a/packages/omamobile-shell/test/all b/packages/omamobile-shell/test/all index bac547012..fc58d8298 100755 --- a/packages/omamobile-shell/test/all +++ b/packages/omamobile-shell/test/all @@ -145,7 +145,7 @@ def vis(w): v = re.sub(r"(^|[^.\w])(\w+)", lambda x: x.group(1) + ("root." + x.group(2) if x.group(2) not in ("true", "false") else x.group(2)), d) return v v = vis(strip) -for need in ("root.appOnScreen", "!root.opened", "!root.fullscreenOnScreen", "!(root.oskOpen && root.sessionLocked)"): +for need in ("(root.appOnScreen || root.oskOpen)", "(!root.opened || root.oskOpen)", "!root.fullscreenOnScreen", "!(root.oskOpen && root.sessionLocked)"): assert need in v, (need, v) assert "!root.oskOpen" not in v, "the keyboard doesn't unmap the strip: " + v assert "!root.appOnScreen" in vis(dock), "the dock and the strip never reserve together" @@ -174,7 +174,8 @@ elif [[ $rc != 0 ]]; then else pass "the home pill under touch: a double tap toggles the keyboard, a tap does nothing, swipes go home, the hide key, the reserved strip, the search pill, the hold for voice" fi -grep -c 'if (!recents && swipeY < -24) root.goHome()' "$l" >/dev/null || fail "a short swipe goes home" +grep -c '} else if (!recents && swipeY < -24) root.goHome()' "$l" >/dev/null || fail "a short swipe goes home" +grep -c 'if (recents || root.opened) return' "$l" >/dev/null || fail "over the drawer a swipe opens no recent apps" grep -c 'if (swipeY < -120) {' "$l" >/dev/null || fail "a long swipe opens recent apps" # Drawer: pull down to close, and a pull is not also a tap on an app. grep -c 'if (LauncherModel.drawerEndsOpen(root.progress, speed, true)) root.settleTo(true, speed)' "$l" >/dev/null || fail "pulling the drawer down closes it" diff --git a/packages/omamobile-shell/test/pill-touch b/packages/omamobile-shell/test/pill-touch index cf6ab0185..494d2d6cc 100755 --- a/packages/omamobile-shell/test/pill-touch +++ b/packages/omamobile-shell/test/pill-touch @@ -115,6 +115,7 @@ Item { readonly property string agentName: "" readonly property color foreground: "#c0caf5" function expand() { Quickshell.execDetached(["expand"]) } + function dismiss(speed) { Quickshell.execDetached(["dismiss"]) } %s diff --git a/packages/omamobile-shell/test/pill-touch.qml b/packages/omamobile-shell/test/pill-touch.qml index 01e124c37..6c34f5422 100644 --- a/packages/omamobile-shell/test/pill-touch.qml +++ b/packages/omamobile-shell/test/pill-touch.qml @@ -236,7 +236,14 @@ Item { var z = zones({}) compare(z.total, 0, JSON.stringify(z)) compare(zones({ drawer: true }).total, 0, "nor with the drawer open") - compare(zones({ osk: true }).strip, 0, "nor the strip with the keyboard on home") + } + + function test_the_keyboard_on_home_brings_the_strip() { + // The keyboard covers the dock (and its swipe) on the home screen and + // over the drawer's search, so the strip comes back above it there. + compare(zones({ osk: true }).strip, harness.touch, "the keyboard on home") + compare(zones({ drawer: true, osk: true }).strip, harness.touch, "the keyboard over the drawer") + compare(zones({ osk: true }).reserving, 1, "the strip alone") } function test_a_fullscreen_window_keeps_the_whole_screen() { @@ -297,6 +304,26 @@ Item { compare(calls("hl.dsp.focus"), 0) } + function test_swipe_in_the_keyboard_strip_on_home_opens_the_drawer() { + zones({ osk: true }) + var strip = find(harness, "keyboardStrip") + swipeUp(strip, 60, strip.height / 2) + compare(calls("expand"), 1, JSON.stringify(Quickshell.executed)) + compare(keyboardCalls("hideKeyboard"), 1, "the keyboard goes") + compare(calls("hl.dsp.focus"), 0, "not home: already there") + zones({ app: true, osk: true }) + } + + function test_swipe_in_the_keyboard_strip_over_the_drawer_closes_it() { + zones({ drawer: true, osk: true }) + var strip = find(harness, "keyboardStrip") + swipeUp(strip, 60, strip.height / 2) + compare(calls("dismiss"), 1, JSON.stringify(Quickshell.executed)) + compare(keyboardCalls("hideKeyboard"), 1, "the keyboard goes") + compare(calls("omamobile.switcher"), 0, "no recent apps over the drawer") + zones({ app: true, osk: true }) + } + function test_swipe_in_the_keyboard_strip_goes_home() { var strip = find(harness, "keyboardStrip") swipeUp(strip, 60, strip.height / 2) diff --git a/packages/omamobile-shell/version b/packages/omamobile-shell/version index 71b776cdf..4a3b5c363 100644 --- a/packages/omamobile-shell/version +++ b/packages/omamobile-shell/version @@ -1 +1 @@ -0.2.112 +0.2.113