omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Launch feedback OSD can get stuck on screen indefinitely (duration: 0 with no fallback closer)

Open Tiedeyez opened this issue 2 months ago • 2 comments

Summary

The launch feedback OSD ("Launching app…") can get stuck on screen indefinitely. It opened at 20:29 and was still displayed at 20:45 — roughly 16 minutes — until dismissed manually with omarchy-shell osd close.

The OSD is deliberately opened with duration: 0, so it has no hide timer of its own. closeLaunchFeedback() is the only thing that takes it down, and it appears to have never run.

Steps to reproduce

  1. Launch an app whose startup is slow enough that its first toplevel does not exist ~2 s after the launch is requested. On this machine, Chromium cold start took 11 s, which is enough.
  2. Launch it from the shell (menu / launcher), not from a terminal — the terminal path does not go through AppLibrary.launch(), so no OSD is created and the bug cannot trigger.
  3. Wait for the app window to appear.
  4. The OSD remains on screen indefinitely.

Observed timeline from the user journal:

20:29:00  uwsm_app-daemon: received: app -- gtk-launch chromium.desktop
20:29:00  systemd: Started gtk-launch.
20:29:11  systemd: Started app-org.chromium.Chromium-26526.scope.   <- 11 s to first window
20:43:56  app-org.chromium.Chromium-26526.scope: Consumed 6min 12s CPU, 2.1G memory peak

The OSD was still present when observed at ~20:45.

What I confirmed

The OSD was genuinely stuck open, not a rendering artifact:

$ quickshell -p /usr/share/omarchy/shell ipc call osd state
open

An OSD opened with duration: 0 never dismisses itself. This is by design — Osd.qml only starts hideTimer when duration > 0:

// Osd.qml
opened = true
if (duration > 0) hideTimer.restart()
else hideTimer.stop()

Verified directly. With no external closer, the OSD stayed open for the full 30 s observation window and had to be closed by hand:

$ omarchy-shell osd show '{"icon":"","message":"ORPHAN TEST","duration":0}'
t+05s: open
t+10s: open
...
t+30s: open
$ omarchy-shell osd close
$ quickshell -p /usr/share/omarchy/shell ipc call osd state
closed

The manual close path works. omarchy-shell is on the shell's PATH (/usr/share/omarchy/bin is in /proc/953/environ), and the same IPC call that closeLaunchFeedback() uses succeeds when invoked by hand.

This is not theme-related. The active theme ships no [osd] section in shell.toml, ~/.config/omarchy/plugins/ is empty, and no user QML references osd or launchOsd. The whole code path is stock.

The shell was never restarted during the incident — the quickshell process had been up continuously since 16:41:48 — so the stuck state survived in-process rather than being wiped by a reload.

Where I think the bug is

AppLibrary.qml opens the OSD with no self-healing backstop:

// AppLibrary.qml:245
Quickshell.execDetached(["omarchy-shell", "osd", "show",
  JSON.stringify({ icon: "󱓞", message: root.launchOsdMessage, duration: 0 })])

and clears it only from two places:

// AppLibrary.qml:250
Timer {
  id: launchTimeout
  interval: 15000
  onTriggered: root.closeLaunchFeedback(root.launchSerial)
}
// AppLibrary.qml:180
function maybeFinishLaunchFeedback() {
  if (!launchDelay.running && !launchTimeout.running && !root.launchOsdOpen) return
  if (root.toplevelCount() <= root.launchToplevelCount
      && ToplevelManager.activeToplevel === root.launchActiveToplevel) return
  root.closeLaunchFeedback(root.launchSerial)
}

One of those two must have failed. I was not able to distinguish which:

  1. The 15 s launchTimeout never fired. The QML event loop was alive (the shell answered ping and state throughout, and the OSD was interactive), so a plain missed Timer is odd, but I could not rule it out.
  2. The ToplevelManager change signal never reached AppLibrary.qml. maybeFinishLaunchFeedback is wired to onValuesChanged of ToplevelManager.toplevels and to onActiveToplevelChanged. If neither fired for Chromium's window, the early return on the toplevel-count comparison would keep the OSD up.

The design issue, independent of which one it is

A duration: 0 OSD guarded by a single closer and no fallback is fragile by construction. Any transient failure in the closer — a dropped signal, a timer that does not fire, an execDetached that fails silently — leaves an undismissable overlay on screen with no way for the shell to recover on its own. The only thing that clears it is a manual omarchy-shell osd close.

Suggested hardening, in rough order of preference:

  • Give the launch OSD a bounded duration (it is a progress hint, not a persistent status) so it always self-clears.
  • Or keep duration: 0 but add a second, independent watchdog so a missed signal cannot strand it.
  • Or have AppLibrary.qml reconcile on focus/Component.onCompleted, so a stranded OSD is torn down the next time the shell gains awareness of it.

I am not claiming a specific one of these is the fix — the point is that the failure should not be able to persist.

Workaround

omarchy-shell osd close

System

Omarchy 4.0.4-1
Kernel 7.2.5-3-omarchy
Hyprland 0.56.2
Quickshell 0.3.1-1
Chromium 152.0.7977.82-1
CPU Intel Core i3-6100U @ 2.30GHz (2 cores / 4 threads, powersave)
GPU Intel Skylake-U GT2 [HD Graphics 520]
Machine HP Notebook (W2M98UA#ABA)
RAM 5.7 GiB

This is a low-powered 2015 laptop. If the failure turns out to be a QML timer being starved under load, it may be much harder to hit on faster hardware — but the missing backstop is a real hazard either way.

Full diagnostics: /tmp/omarchy-debug.log (generated with omarchy-debug --no-sudo --print).

Notes on this report

Two caveats worth stating plainly rather than burying:

  • I could not reproduce the failure on demand. My attempt to trigger it by launching Chromium through gtk-launch directly never created an OSD at all, because that path bypasses AppLibrary.launch() and therefore beginLaunchFeedback(). The bug needs a launch from the shell UI, and I did not have a way to drive that unattended. The evidence above is therefore a confirmed single occurrence plus a confirmed mechanism, not a confirmed reproduction. Steps to reproduce are written from the code path, not from a second confirmed run.
  • I could not search for duplicates. The GitHub search API returns HTTP 422 for this repo from my account, so I have not ruled out an existing issue covering this. If one exists, the mechanism details above are probably still worth folding into it.

Tiedeyez avatar Sep 29 '26 03:09 Tiedeyez

This is a duplicate of #12123, and your own timeline rules out both of the two hypotheses you listed: whichever closer ran, it ran and cancelled the other one, and the osd close it dispatched never reached the shell.

On the duplicate you could not search for. Search works from my account, so: #12123 is the same mechanism with the fullest writeup (it measured omarchy-shell osd state at 2.015 s cold on a comparably slow machine), and #8242 is the show/close ordering variant. Also open on the same path: #13535, #13566, #13264, #12922, #12573, #11928, #11668, #9817. #11041 and #8795 are earlier closed reports of it.

Which variant you hit. A single omarchy-shell call cannot survive the 9 s gap in your journal, so #8242's ordering race is not your case. bin/omarchy-shell:75 puts socat under timeout --kill-after=1s 2s, and :102-104 puts the qs ipc fallback under the same bound, so one call lasts ~6 s at the very most. Measured on the socket path against a shell that never answers:

shell starved, accept queue full -> osd show gives up after : 2.02s

Your show went out at ~20:29:02 (the 2 s launchDelay after the 20:29:00 launch) and your window mapped at 20:29:11. The show process was gone by ~20:29:08, so it landed first and the close is what went missing.

Why neither closer "failed". I ran the launch-feedback state machine from AppLibrary.qml:156-253 verbatim against the real bin/omarchy-shell, with a stand-in socket server matching shell.qml:1632-1649 (quickshell will not run headless here). A delayed close self-heals:

[t=+010.1s] event loop -> STARVED
[t=+011.1s] toplevel appeared (Chromium) -> ToplevelManager.toplevels.onValuesChanged
[t=+014.1s] event loop -> LIVE
[t=+014.1s] APPLIED  osd close  -> opened=False

A lost one never does. Same run, except the accept queue is saturated while the loop is starved, so socat is killed before its write:

[t=+011.1s] toplevel appeared (Chromium) -> ToplevelManager.toplevels.onValuesChanged
[t=+014.1s] event loop -> LIVE
[t=+016.1s] state after the 15s backstop window: launchOsdOpen=false launchTimeout.running=false launchDelay.running=false
[t=+017.1s] maybeFinishLaunchFeedback: early return (no timer running, launchOsdOpen=false)
-- final OSD state, asked the way the reporter asked it --
open

No osd close request ever reached the shell, and the shell was healthy again at t=14.1 s, before the 15 s backstop would have fired. It never fired because closeLaunchFeedback() had already stopped it at t=11.1 s. The call did report its own failure:

osd close exit status         : 1
osd close stderr              : omarchy-shell is not responding

Quickshell.execDetached discards that. So "one of those two must have failed" has the answer: neither. closeLaunchFeedback() (AppLibrary.qml:169-177) writes launchOsdOpen = false and calls launchTimeout.stop() at dispatch, before knowing the IPC landed. Whichever trigger fired, the toplevel signal at 11 s or the 15 s timeout, it consumed both closers and then lost its one call. Your hypothesis 2 therefore does not need a dropped signal: everything you observed follows even if the signal arrived normally.

Fix. #12123's suggestion is the right one: drive the OSD in-process via shell.summon("omarchy.osd", ...) the way omarchy.audio, omarchy.media and omarchy.monitor already do, which removes the subprocess and the ordering question at once. If the external call has to stay, the cheap half covers the whole class: give the launch OSD a finite duration (the remaining launchTimeout budget) instead of 0, and do not clear launchOsdOpen or stop launchTimeout until the close is confirmed. The first run above shows a delayed close already self-heals, so a finite duration is what turns your "the failure should not be able to persist" into an invariant.

One caveat: socat is not installed in my sandbox, so I stood in a ~20-line equivalent for the single invocation bin/omarchy-shell makes of it. The script itself and the state machine are the real code.

A fire-and-forget external call whose nonzero exit is thrown away, with local state marked done at dispatch, is the shape behind item 4 in our own field catalog; five of our notification streams were dead up to eleven days that way (ours): https://github.com/aron-intframe/agent-guards#4-your-alert-channel-is-whitelisted-and-you-dont-know-it

aron-intframe avatar Sep 29 '26 04:09 aron-intframe

Thanks for the detailed timeline. This is the same bug as #12123, which was reported first, so I'm closing this one as a duplicate of it. Both describe the "Launching …" OSD getting stuck after a slow cold start launched from the menu, and both come down to the same code in shell/services/AppLibrary.qml: the OSD is shown with duration: 0, and closeLaunchFeedback() sets launchOsdOpen = false and stops launchTimeout as soon as it sends the detached omarchy-shell osd close, before it knows whether the close got through. If that close is lost, for example because omarchy-shell gives up after its 2 s timeout on a busy machine, nothing ever tries again. That code is still the same on quattro today.

PR #11568 gives the launch OSD a 15-second duration as a fallback and is linked to both issues. It's waiting on the maintainer. I didn't run anything on a worker, because nothing here needed reproducing to see that the two reports are the same. Claude Opus 5.5 compared the two reports, and the duplicate check also asked Codex Medium separately. If this turns out to be a different bug, reopen it and say what's different.

omarchybot avatar Oct 13 '26 05:10 omarchybot