Watch
1
0
Fork
You've already forked souveraine
0

osk: retire the dead dual-keyboard path

This commit is contained in:
Fimeg 2026-08-11 19:21:21 -04:00
commit fb5e9bb80c
4 changed files with 36 additions and 179 deletions

View file

@ -58,21 +58,14 @@ Scope {
// can't flip the wrong way. Known ceiling: squeekboard also shows and
// hides ITSELF on input-method focus, and oskOpen doesn't hear about
// that the gesture toggle can need two swipes after an auto-show.
// One D-Bus call, no sleep. This used to read
// pgrep -x squeekboard >/dev/null || { squeekboard & sleep 1; }
// which was correct only while squeekboard was the sole keyboard. Once
// stevia became the default (2026-07-21) that pgrep missed on EVERY open:
// each one spawned a stray squeekboard to fight stevia for the
// sm.puri.OSK0 name, and the visible damage slept a full second before
// SetVisible. oskOpen flipped instantly, the keyboard arrived ~1s later,
// and the gesture rail spent that whole second lifted over nothing.
// Ask the bus first; whoever owns the name is the live keyboard. Only if
// nobody owns it do we start the sole intended keyboard through the
// transition helper; it also re-asserts visibility itself.
// Ask the bus first. If no owner exists, start the package-owned service;
// the owner monitor below pushes the pending visibility intent as soon as
// Squeekboard claims the name.
function showOsk() {
Quickshell.execDetached(["sh", "-c",
"busctl --user call sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 " +
"SetVisible b true 2>/dev/null || osk-switch squeek >/dev/null 2>&1"])
"SetVisible b true 2>/dev/null || " +
"systemctl --user start squeekboard.service >/dev/null 2>&1"])
}
function hideOsk() {
Quickshell.execDetached(["busctl", "call", "--user",
@ -107,11 +100,8 @@ Scope {
// An owner change is not a visibility event.
//
// sm.puri.OSK0 is a *name*, not a process. Three different things put a
// fresh process behind it: boot, a crash-restart (the keyboards exit
// `Error reading events from display: Broken pipe` when their Wayland
// connection is perturbed, and both units are Restart=on-failure), and
// `osk-switch` swapping squeekboard for stevia at the user's gesture.
// sm.puri.OSK0 is a *name*, not a process. Boot and a crash-restart can
// both put a fresh Squeekboard process behind it.
// Each new process announces its own idea of Visible, and until now this
// monitor mirrored that into oskOpen indistinguishable from the
// keyboard deciding to show itself. Measured on 2026-08-05: shell up at
@ -142,14 +132,9 @@ Scope {
interval: root.ownerSettleMs
onTriggered: {
root.ownerSettling = false;
// Push once more on the way out. The first push (at adopt time)
// can lose a race: osk-switch sleeps 0.3s and then deliberately
// SetVisible(true), and a keyboard that self-shows on startup
// does so after it has finished coming up both land *after* we
// spoke. Measured 2026-08-05: adopt+hide at 07:37:51, stevia
// Visible=true at 07:37:52, leaving oskOpen=false while a
// keyboard sat on the screen. Whoever spoke last during the
// settle window does not get to be the winner; intent does.
// Push once more on the way out. The first push can lose a race to
// Squeekboard self-showing after startup. Whoever speaks last
// during the settle window does not get to win; intent does.
root.assertIntent();
}
}
@ -254,7 +239,7 @@ Scope {
// Unlocking must not leave a keyboard behind.
//
// Nothing asks for one the lock module never touches `oskOpen`, and only
// polkit takes a hold. squeekboard/stevia self-show whenever input-method
// polkit takes a hold. Squeekboard self-shows whenever input-method
// focus lands on them (GlobalStates' own note: "self-showed / self-hid
// every couple of seconds, ending in Visible=true with no keyboard in front
// of the user"), and the surfaces coming back at unlock are exactly such a