Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions packages/omamobile-shell/plugins/omamobile.launcher/Launcher.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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()
Expand All @@ -1237,15 +1243,25 @@ 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()
}
}

Timer {
id: hold
interval: 350
onTriggered: {
if (!swipe.active || swipe.recents) return
if (!swipe.active || swipe.recents || root.opened) return
swipe.recents = true
root.showRecents()
}
Expand Down
5 changes: 3 additions & 2 deletions packages/omamobile-shell/test/all
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions packages/omamobile-shell/test/pill-touch
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
29 changes: 28 additions & 1 deletion packages/omamobile-shell/test/pill-touch.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/omamobile-shell/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.112
0.2.113