diff --git a/desktop/shell/bin/omarchy-keyboard b/desktop/shell/bin/omarchy-keyboard index 2951fcde..d55b0e83 100644 --- a/desktop/shell/bin/omarchy-keyboard +++ b/desktop/shell/bin/omarchy-keyboard @@ -2,6 +2,7 @@ """Session controller for the theme-matched Wayland keyboard, and its policy. omarchy-keyboard show|hide|toggle what the person asks for (swipe up, bar button) + omarchy-keyboard quiet the window opening next was not asked for by a tap omarchy-keyboard listen the policy: reads the compositor's facts on stdin omarchy-keyboard restart|run (re)start the keyboard process itself @@ -187,6 +188,12 @@ class Policy: def person(self, action): """The person opened or closed it (swipe up, bar button).""" + if action == "quiet": + # A launcher opening a window to read, not to type in (About's + # terminal): the tap that started it does not count for the field + # its window brings. A tap in the window still opens the keyboard. + self.touched_until = self.tapped_until = self.asked_until = 0.0 + return self.opened_here = False self.hide_at = None if action == "show": @@ -274,6 +281,8 @@ def main(mode): elif mode == "hide": hide() tell_policy("hide") + elif mode == "quiet": + tell_policy("quiet") elif mode == "listen": listen() elif mode == "restart": @@ -289,7 +298,7 @@ def main(mode): elif mode == "run": run() else: - raise SystemExit("Usage: omarchy-keyboard [show|hide|toggle|listen|restart|run]") + raise SystemExit("Usage: omarchy-keyboard [show|hide|toggle|quiet|listen|restart|run]") if __name__ == "__main__": diff --git a/desktop/shell/bin/omarchy-launch-about b/desktop/shell/bin/omarchy-launch-about index b33dd437..2038cc6a 100644 --- a/desktop/shell/bin/omarchy-launch-about +++ b/desktop/shell/bin/omarchy-launch-about @@ -3,5 +3,8 @@ # Foot grid is 89x34; keep the real fastfetch readout open at that width. set -euo pipefail export LC_ALL=${LC_ALL:-C.UTF-8} +# About is read, not typed in: the tap on its menu entry must not bring up the +# on-screen keyboard over the details as the terminal's text input comes on. +omarchy-keyboard quiet 2>/dev/null || true exec foot --app-id=org.omarchy.about -W 89x34 -e bash -lc \ 'fastfetch --config "$HOME/.config/fastfetch/config.jsonc"; exec bash -i' diff --git a/tests/test_keyboard_policy.py b/tests/test_keyboard_policy.py index c299f2df..91ecec34 100644 --- a/tests/test_keyboard_policy.py +++ b/tests/test_keyboard_policy.py @@ -101,6 +101,17 @@ def test_a_version_1_field_coming_on_right_after_a_tap_opens_it(self): self.facts('press', TAP, 'field on 1') self.assertEqual(self.calls, ['show']) + def test_a_window_opened_to_read_after_a_tap_does_not_open_it(self): + # About: the menu tap starts a terminal whose text input comes on at once. + self.facts('press', TAP) + self.policy.person('quiet') + self.facts('field on 1') + self.assertEqual(self.calls, []) + # A tap in that window still opens it. + self.wait(1) + self.facts('press', TAP) + self.assertEqual(self.calls, ['show']) + def test_a_tap_that_moves_focus_off_a_version_1_field_does_not(self): self.facts('field on 1', 'press', 'field off', TAP) self.wait(1)