omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Launch OSD ("Launching <app>…") can get permanently stuck on screen

Open reyalicea opened this issue 3 months ago • 6 comments

Launch OSD ("Launching …") can get permanently stuck on screen

What happened

After launching an app from the Omarchy menu, the persistent "Launching …" OSD overlay stayed on screen indefinitely. It never cleared on its own. The omarchy-osd layer-shell surface remained up (visible card, duration: 0), and omarchy-shell osd close was required to dismiss it manually.

What was expected

The launch OSD should always clear — either when the launched window appears, or via the 15s timeout fallback — with no path that leaves it stranded.

Where it comes from

shell/services/AppLibrary.qml:

  • beginLaunchFeedback(name) starts launchDelay (2000 ms) and launchTimeout (15000 ms).
  • launchDelay.onTriggered sets launchOsdOpen = true and calls Quickshell.execDetached(["omarchy-shell", "osd", "show", {icon, message, duration: 0}]).
  • closeLaunchFeedback() calls Quickshell.execDetached(["omarchy-shell", "osd", "close"]).

shell/plugins/osd/Osd.qml: show() with duration <= 0 calls hideTimer.stop() and leaves opened = true until an explicit close(). There is no self-heal / no max lifetime for a duration: 0 OSD.

Root cause (two compounding issues)

  1. Show/close race. show and close are dispatched as two separate detached omarchy-shell processes. Each then makes its own qs ipc call to the shell. Delivery order is decided by process scheduling, not by the order the QML issued them. When a toplevel appears in roughly the same tick the 2s launchDelay fires, closeLaunchFeedback() runs right after launchDelay.onTriggered, so a close IPC can reach the shell before the show IPC. Net result: opened ends up true with no timer, forever.

  2. Single-shot backstop with no retry. For a launch that never produces a detectable new/active toplevel (app already running and merely refocused so ToplevelManager.toplevels count and activeToplevel are unchanged, a background/agent app, or a failed launch), the only thing that clears the OSD is the one-shot launchTimeout → single closeLaunchFeedback(). If that lone detached close fails to land (shell busy past the 2s OMARCHY_SHELL_IPC_TIMEOUT, transient error), nothing ever retries and the OSD is stranded.

Steps to reproduce

Exact timing is racy, but the shape:

  1. From the Omarchy menu, launch an app whose window takes ~2s to map, or an app that is already open and just gets refocused without changing the toplevel set.
  2. Observe the "Launching …" OSD appear at the 2s mark.
  3. Intermittently: the OSD does not clear after the window is up and does not clear after 15s. It stays until omarchy-shell osd close / omarchy restart shell.

Suggested fixes

  • Have Osd.show() enforce a hard maximum lifetime even for duration <= 0 (e.g. a separate long guard timer, ~30–60s), so no OSD can outlive its purpose.
  • Make the launch feedback converge on shell state rather than fire-and-forget: issue show/close through a single serialized path (one IPC target method that owns the launch-OSD lifecycle), or re-issue close on a short repeating timer until osd state reports closed.
  • In maybeFinishLaunchFeedback() / launchTimeout, always send close unconditionally on timeout (drop the if (root.launchOsdOpen) guard for the timeout path) and verify via the osd state IPC.

System details

  • Omarchy: 4.0.1-1
  • Kernel: 7.1.9-arch1-2
  • Hyprland: 0.56.2 (v0.56.2, efb5099)
  • Quickshell: 0.3.1 (Arch)
  • CPU: Intel Core i3-2350M
  • GPU: Intel 2nd Gen Core integrated graphics [8086:0116] (Sandy Bridge)

reyalicea avatar Aug 28 '26 17:08 reyalicea

Checked this against quattro (0b3f1b7e) and against the two open PRs that touch it.

Both of your root causes hold up in source, but they are not equally established. The race is: closeLaunchFeedback() dispatches omarchy-shell osd close at shell/services/AppLibrary.qml:174 and launchDelay.onTriggered dispatches the duration-0 osd show at shell/services/AppLibrary.qml:245, as two separate detached processes, so delivery order is decided by process scheduling rather than by the order QML issued them. Osd.show() stops hideTimer when duration is non-positive (shell/plugins/osd/Osd.qml:69) and close() only clears opened (:80), so an inverted delivery leaves the card open with nothing left to close it. Your second root cause is a genuinely different failure mode rather than the same one restated — but the 15s launchTimeout does fire an unconditional close in the refocus case, so stranding there needs that detached close to actually be lost, which bin/omarchy-shell:58 makes possible (2s default IPC timeout, no retry, and execDetached never sees the result). That path is plausible from the source and has not been demonstrated; the race has been, by you and by two reporters on #8242.

PR #8890 is open against this issue and cites it. It adds a 30s maxLifetimeTimer for duration-0 OSDs in Osd.qml, and that part works: on a disposable Omarchy VM a duration-0 card was observed open until t=31s and then closed, and a newer OSD correctly cancels the cap. With that PR merged, a stuck launch card can no longer outlive 30s.

What it does not do is fix the race. The show and the close are still two separate detached processes at the same two call sites, so an inverted ordering still happens — the card is bounded at 30s rather than prevented, and for those 30s it still looks stuck. The PR also drops the if (root.launchOsdOpen) guard so osd close fires unconditionally. Because maybeFinishLaunchFeedback() only early-returns when neither timer is running (AppLibrary.qml:180), that sends a close on every launch whose window maps inside the 2s launchDelay, and the OSD is a single shared card: omarchy.osd is what the volume, brightness and media paths all summon (shell/plugins/panels/audio/Panel.qml:435, shell/plugins/panels/monitor/Panel.qml:258, shell/plugins/services/media/Service.qml:248). So that close dismisses whatever card happens to be on screen at the time. This was reproduced by mutation on the same VM.

The repo already has a route with no second process to reorder against: shell.callIfLoaded("omarchy.osd", ...) (shell/shell.qml:567), the in-process call those three siblings reach through summon. Closing the launch OSD that way removes the reordering rather than capping its consequence.

Your second root cause is separately targeted by open PR #8570, which also edits AppLibrary.qml and test/shell.d/app-search-test.sh and will likely conflict with #8890.

On duplicates: #8242 reports the same show/close race, filed three days earlier, with a 100-iteration reproduction (53 stranded of 100) and an independent confirmation on different hardware. Your root cause 1 and that issue are the same defect; your report additionally raises the lost-close path, which #8242 does not discuss. They should be linked, but which number stays open is the maintainer's to decide.

Next: this is waiting on the maintainer to choose between the 30s cap in #8890 and closing the launch OSD in-process. Nothing is needed from you.

Diagnosed by Opus 5 in Claude Code with a second opinion from Codex at xhigh reasoning. Codex confirmed the mechanism and the shared-OSD side effect against the same source, and corrected the characterisation of your second root cause from an established defect to a reported-but-undemonstrated path, which is how it is described above.

omarchybot avatar Aug 29 '26 12:08 omarchybot

A few technical observations regarding why this is timing-dependent and how to reproduce it:

  1. Warm vs. Cold Start:
    • In AppLibrary.qml, there is a 2000 ms launchDelay timer.
    • When launching Bitwarden with a warm disk cache (< 2.0s), the OSD is never shown at all.
    • On a cold launch (e.g. after killall bitwarden or under system load) where startup takes > 2.0s, the "Launching Bitwarden…" OSD appears with duration: 0.
  2. Stuck Layer-Surface OSD:
    • Once displayed, maybeFinishLaunchFeedback() does not reliably catch the new toplevel window for Bitwarden / Electron (especially when restoring from tray or single-instance handoff).
    • Because the OSD is spawned with duration: 0 and rendered as a Wayland layer-shell surface, it stays stuck across all virtual workspaces indefinitely until a manual shell restart or omarchy-shell osd close. Enforcing a non-zero fallback duration (e.g. duration: 3500 ms) on the launch OSD or ensuring unconditional dismissal on timeout would prevent the OSD layer from getting permanently stranded.

on370 avatar Aug 31 '26 16:08 on370

Can confirm — hit this exact issue on Omarchy 4.0.2-1 (Hyprland, Nautilus 50.2.2). The toast stayed stuck for several minutes past the 15s failsafe. Manually running omarchy-shell osd close closed it immediately, confirming the OSD backend itself is fine — it's the timeout/close dispatch that's unreliable, matching what's described here.

alexandremot avatar Sep 02 '26 15:09 alexandremot

Automated duplication check: this issue looks similar to #8242, which covers the same stuck Launching OSD from IPC race. I keep that one open and close this one to keep the discussion in one place.

If you feel this is the wrong decision, please open the issue again with a note on the difference.

bjarneo avatar Sep 21 '26 09:09 bjarneo

Additional reproduction on a windowless app: Caffeine (/usr/bin/caffeine, AUR caffeine 2.10.1).

Observed:

  • Launcher shows Launching Caffeine… and the OSD can remain indefinitely.
  • The app does launch successfully: pgrep -af /usr/bin/caffeine shows a live PID in app-Hyprland-gtk\x2dlaunch-*.scope (ActiveState=active SubState=running), journal has uwsm_app-daemon: received: app -- gtk-launch caffeine.desktop with no failed units.
  • No window appears because caffeine.py is a headless daemon: it builds Caffeine(EWMH()) + Gtk.main() with no Gtk.Window and no status icon.

Why the heuristic can't succeed here (AppLibrary.qml):

  • maybeFinishLaunchFeedback() clears the OSD only on toplevelCount() growth or ToplevelManager.activeToplevel change. A windowless app never produces either.
  • The launchTimeout (15 s) backstop calls closeLaunchFeedback() exactly once, guarded by launchOsdOpen, with no retry — so the show/close IPC race described in this issue strands the duration: 0 OSD permanently instead of self-healing.

Suggestion: for .desktop entries whose app is expected to be windowless (NoDisplay/TrayIcon/no mapped toplevel), key launch feedback off the process/scope existing (e.g. the transient app-…-gtk\x2dlaunch-*.scope reaching running and then exiting/staying alive) rather than toplevel arrival, and make the 15 s close retry-safe.

Happy to provide journal excerpts or test a patched AppLibrary.qml.

marktantongco avatar Sep 23 '26 18:09 marktantongco

Confirmed as well on

OS: Omarchy 4.0.6-1 ├󰔫: stable ├: Linux 7.2.5-3-omarchy ├: Hyprland 0.56.2 (Wayland) ├: foot 1.28.0 ├󰏖: 986 (pacman) ├󰸌: Tokyo Night ●●●●●●●● └: JetBrainsMono Nerd Font (9pt)

I do believe a max delay could prevent this in case the application fails to notify the service.

HerreraCarlos81 avatar Oct 23 '26 21:10 HerreraCarlos81