Skip to content

Keep launch OSDs from sticking on screen forever - #8890

Closed
chessing234 wants to merge 4 commits into
omacom:quattrofrom
chessing234:fix/omarchy-launch-osd-stuck
Closed

chessing234 wants to merge 4 commits into
omacom:quattrofrom
chessing234:fix/omarchy-launch-osd-stuck

Conversation

@chessing234

@chessing234 chessing234 commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Launch feedback can remain visible when detached show/close processes arrive out of order. AppLibrary now uses the injected shell host's synchronous callIfLoaded path, closes feedback only after a successful open, and gives launch feedback a 13-second lifetime. Fast launches no longer close an unrelated OSD. The public duration-zero OSD behavior is preserved.

Fixes #8795.

Validation: bash test/shell.d/launch-feedback-test.sh, bash test/shell.d/app-search-test.sh, and bash test/shell.d/osd-test.sh pass. The focused test executes the QML functions with a fake shell host to cover fast launches, ordered calls, stale completion, and unloaded plugins.

Live Quickshell verification remains pending: already-running apps, delayed launches, and volume/brightness OSD interaction require an Omarchy desktop. It was unavailable in the current macOS environment.

Launch feedback uses duration 0 and relies on an explicit close. If that
close IPC is dropped or loses a race to show, the card stayed forever.
Guarding close on launchOsdOpen meant a close that arrived before show
never cleared the later sticky OSD, and the flag then blocked retries.
Copilot AI balanced review requested due to automatic review settings August 29, 2026 06:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds safeguards to prevent launch OSDs from remaining indefinitely.

Changes:

  • Adds a 30-second maximum lifetime for sticky OSDs.
  • Revises launch-feedback cleanup behavior.
  • Adds regression assertions.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
shell/services/AppLibrary.qml Changes launch OSD cleanup.
shell/plugins/osd/Osd.qml Adds the sticky OSD lifetime timer.
test/shell.d/app-search-test.sh Adds regression assertions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/shell.d/app-search-test.sh Outdated
Comment on lines +153 to +154
/id: maxLifetimeTimer[\s\S]*interval: 30000/.test(osdQml),
'sticky OSDs have a 30s max lifetime when duration is 0'
Comment thread shell/services/AppLibrary.qml Outdated
// Always issue close. show/close are separate detached processes; a close
// that loses the race to show would otherwise leave duration-0 OSD up, and
// the launchOsdOpen guard would then refuse every later close.
Quickshell.execDetached(["omarchy-shell", "osd", "close"])
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed on a disposable VM built from the Omarchy ISO, with the compositor serving this branch (quickshell -n -p .../pr-8890/shell). Second opinion from Codex at xhigh reasoning; where it agreed with something I had already concluded I say so, because its independence is not currently guaranteed.

The OSD half works, and it is proven live

  • omarchy-shell osd show '{"message":"probeA","duration":0}' then polling osd state: open until t=31s, then closed. The cap fires.
  • Sticky OSD at t=0, then a duration: 60000 OSD at t=25s: at t=34s, past the sticky card's cap, osd state was still open. So maxLifetimeTimer is correctly cancelled by a later duration > 0 show and an old cap cannot close a newer card.
  • hideTimer's onTriggered: root.opened = false not stopping maxLifetimeTimer is safe rather than an oversight: hideTimer.restart() only ever runs on the line after maxLifetimeTimer.stop() (Osd.qml:69-71), so at most one of the two timers is ever running. The asymmetry with close() is fine.
  • test/shell.d/app-search-test.sh passes, 25 of 25, through the worker's session wrapper.

AppLibrary.qml:176 dismisses an unrelated OSD on every fast launch

This is the one thing worth changing. maybeFinishLaunchFeedback() (AppLibrary.qml:180) proceeds whenever launchDelay or launchTimeout is running, not only when a launch OSD is up. For a launch whose window maps before the 2s launchDelay — the common case — launchOsdOpen is still false, but closeLaunchFeedback() now fires an unconditional omarchy-shell osd close. The OSD is a singleton, so that close takes down whatever card is on screen: a volume or brightness bar raised while waiting for the app, or a media card.

Proven on the worker by mutation, not reasoned. A 60s OSD was put on screen, then an app was launched from the apps menu:

tree before after
this branch open closed
same tree, only the if (root.launchOsdOpen) guard restored open open
control: apps menu opened and dismissed with Escape, no launch open open

A foot window mapped in both launch rows, so the launch really completed in each.

The race in root cause 1 of #8795 is bounded, not fixed

show (AppLibrary.qml:246) and close (AppLibrary.qml:176) are still two separate detached omarchy-shell processes, so their IPC arrival order is still undefined; removing the guard does not reorder them. When close still wins, the card now stays 30s instead of forever. That is a real improvement, but it is a backstop, and the commit messages read as though it were the fix.

The repo already has the race-free route, and three sibling call sites use it: shell/plugins/panels/audio/Panel.qml:435, shell/plugins/panels/monitor/Panel.qml:258 and shell/plugins/services/media/Service.qml:248 all reach the OSD through shell.summon("omarchy.osd", ...), which is an ordinary in-process call — deliverIfLoaded hands the payload straight to Osd.open(), and shell.hide() invokes Osd.close() on the same event loop. AppLibrary is the only in-shell code that round-trips through omarchy-shell to talk to its own process. Injecting a shell reference at shell.qml:20 and using shell.callIfLoaded("omarchy.osd", "open"/"close", ...) removes the race outright, keeps the launchOsdOpen guard honest, and leaves the 30s cap as pure belt and braces. Codex contributed one reason to prefer callIfLoaded over summon/hide that had not come up otherwise: summon() queues the payload into pendingPayloads (shell.qml:467) and hide() does not drain it (shell.qml:480), so during shell startup a queued show can still arrive after the hide, whereas callIfLoaded returns "unknown" instead.

That is a larger change than this one, and whether to take the backstop now or go in-process is the maintainer's call, so nothing has been pushed to this branch.

Two smaller notes

The cap lives in Osd.show(), so it redefines duration: 0 for every caller, including the public omarchy-osd -d 0 (bin/omarchy-osd:21). Launch feedback is the only duration-0 producer in the repo today, so nothing breaks now, but a user script or third-party plugin using duration 0 as "I will close it myself" gets cut off at 30s. Scoping the failsafe to launch feedback would leave that contract alone. Worth noting too that launch feedback's own intended maximum life is 13s — the 2s launchDelay to the 15s launchTimeout — so 30s is about twice the ceiling it guards.

The new assertions (app-search-test.sh:143 and :151) grep the QML source text, and pass unchanged if maxLifetimeTimer.restart() or onTriggered: root.close() is deleted. They pin the literals rather than the behaviour, so that half is unproven by the suite; that is why it was exercised live above. The Osd.qml assertion would also be easier to find in test/shell.d/osd-test.sh than in the app-search file.

Related: #8242 reports the same bug separately and this would close it too. #8570 touches shell/services/AppLibrary.qml and test/shell.d/app-search-test.sh and changes the same launch path, and #7503 touches shell/plugins/osd/Osd.qml, so expect conflicts depending on merge order.

Waiting on you for the closeLaunchFeedback guard, and on the maintainer for whether the 30s cap ships as the fix or as a backstop under a proper in-process close.

@chessing234

Copy link
Copy Markdown
Contributor Author

@dhh @ryanrhughes ready for review

@chessing234

Copy link
Copy Markdown
Contributor Author

folding into #12115 with the other bar panel fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants