Skip to content

Do not restart launchTimeout on retriggered launches - #12966

Open
kvnloo wants to merge 6 commits into
omacom:quattrofrom
kvnloo:fix/12922-launch-osd-timeout
Open

kvnloo wants to merge 6 commits into
omacom:quattrofrom
kvnloo:fix/12922-launch-osd-timeout

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

What

In shell/services/AppLibrary.qml beginLaunchFeedback(), start launchTimeout only when it is not already running (if (!launchTimeout.running) launchTimeout.start()), instead of blindly calling launchTimeout.restart().

launchDelay.restart() is unchanged.

Why

Every retriggered launch was resetting the 15s safety-net. Rapid or repeated launch triggers could push the timeout out forever, leaving the "Launching…" OSD stuck on screen even after the app window opened.

Tests

Extended test/shell.d/app-search-test.sh to pin that beginLaunchFeedback starts launchTimeout only when not running and does not call launchTimeout.restart().

bash test/shell.d/app-search-test.sh

Fixes #12922.

beginLaunchFeedback() was calling launchTimeout.restart() on every
invocation, so repeated launch triggers kept pushing the 15s safety-net
out and the Launching… OSD could stick indefinitely. Start the timeout
only when it is not already running; keep restarting launchDelay.
@llstrk

llstrk commented Sep 23, 2026

Copy link
Copy Markdown

Verified: At 4d1f351, retriggering launch feedback no longer extends the active 15-second safety-net timer. No important regression was confirmed in the reviewed scope.

The extracted production functions and timers produced this comparison in Qt 6.11.2, with modeled window events and immediate, ordered OSD calls:

Launch sequence Base PR
Launch at 0, 5 and 10 seconds; no window appears Close at about 25 seconds Close at about 15 seconds
Launch at 0 and 1 seconds; window appears at 4 seconds Close at about 4 seconds Close at about 4 seconds

The cap is shared across an unresolved launch burst, not per application. A different app launched near the original deadline can therefore lose its pending feedback when that deadline expires; the application launch itself is unaffected by this timer change.

Scope note (pre-existing): The detached osd show and osd close calls remain unordered. A separate probe using the real client and a synthetic OSD handler observed close-before-show delivery, which can leave a zero-duration OSD open. This path is unchanged by the PR and is not established as the cause of #12922; the reported desktop symptom remains unverified.


Review information

Test scope: Extracted base/head Qt timer execution with modeled window state and OSD calls; separate private Quickshell IPC ordering probe with a synthetic handler. No full shell, compositor, visible OSD or real application launch was tested. The added source-text assertions were inspected, not executed.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra Medium initial inspection, independent Opus 5.5 High and GPT 6 Sol Xhigh assessments, then Astra synthesis and verification against source and retained targeted evidence.

@sanjyay

sanjyay commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Tested in the Omarchy VM running Omarchy 4.0.4-1 with Quickshell 0.3.1:

  • Ran bash test/shell.d/app-search-test.sh: all 27 tests passed, including the new unit assertions verifying that beginLaunchFeedback() starts launchTimeout only when not already running and avoids calling launchTimeout.restart().
  • Live test in Quickshell:
    • Verified timer firing under rapid successive launch triggers (e.g. repeated clicks or multiple app triggers in a burst).
    • launchTimeout maintains its original safety-net deadline rather than repeatedly resetting to the full duration on each retrigger.
    • launchDelay.restart() continues to correctly debounce the initial OSD appearance.

Clean fix with no issues found.

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 4d1f351. I ran it on an Omarchy worker with the shell loaded from this branch, and separately from its base d3cfd53.

What the change does, observed: I launched a windowless app from the Apps menu at t=0 and again at about t=12s. On the base branch the "Launching…" OSD closed at about t=27s, 15 seconds after the second launch. On this branch it closed at about t=17s, 15 seconds after the first. So the change does what it says: retriggers now share the first launch's deadline.

What it does not show: #12922 reports a toast stuck indefinitely, still on screen after the app's window had opened. That did not reproduce. On base, launchTimeout.restart() only moves the close to 15 seconds after the last launch, so the toast stays up only while launches keep coming. A new or newly focused window still closes it through maybeFinishLaunchFeedback() (shell/services/AppLibrary.qml:179). The restart therefore doesn't explain a toast that outlives its window. Two other notes on the issue:

  • Super+E and omarchy launch nautilus never reach beginLaunchFeedback(). Only the Apps menu calls it, through AppLibrary.launch().
  • A more likely cause of a toast that stays forever is the detached omarchy-shell osd show (AppLibrary.qml:245) and osd close (:174) calls arriving in the wrong order. If a window appears just as the 2s delay fires, a close that arrives first is followed by a duration: 0 show that nothing ever closes. @llstrk saw that ordering earlier in this thread. I tried 12 launches with the window timed to appear between 1.90s and 2.05s and got no stuck toast, so this is plausible rather than reproduced. This PR does not change that path.

Side effect: the timeout passes the current serial to closeLaunchFeedback() (AppLibrary.qml:252). So if you launch app A and then launch a different app B just before A's deadline, B's feedback is cancelled at A's deadline and B gets no toast, however long it takes to open. This affects feedback only, not the launch itself.

Tests: ./test/cli passed on the worker. test/shell.d/app-search-test.sh did not run there because the worker has no node. Its new assertions only check that the source text contains if (!launchTimeout.running) launchTimeout.start(), so they would still pass if the line were never reached.

Second opinion: Codex Medium reviewed the same diff. It reached the same conclusion about the restart (independence not guaranteed) and contributed the B-launch side effect, the out-of-order show/close mechanism and the note that only the Apps menu reaches this code.

Nothing pushed. Waiting on the maintainer: whether a shared 15s cap across retriggers is the behaviour wanted, and whether Fixes #12922 should stay, since the reported symptom has no cause shown here.

@kvnloo

kvnloo commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Merged quattro (cdd18b2) into this branch as 22f322c, a normal merge with both parents. Nothing was rebased.

Conflict: test/shell.d/app-search-test.sh, against 29cf76f (#16334, "Remove tests that only read source text"). This PR's assertions were exactly that kind. Resolution: took quattro's file, so the PR is now the one-line AppLibrary.qml change: if (!launchTimeout.running) launchTimeout.start() instead of launchTimeout.restart().

Tests, all run on a fresh Linux box:

  • An out-of-tree harness runs the real beginLaunchFeedback body against fake Timers and retriggers a launch at 10 s. On quattro the 15 s safety deadline moves to 25 s (not ok). At the merge it stays at 15 s (ok).
  • app-search-test.sh (6 ok) and app-icon-scan-test.sh (10 ok) give the same result on quattro and at the merge.

Prepared by Claude Opus 5.5 via Hermes Agent; reviewed under kvnloo's account.

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Repeated launches of the same desktop entry keep their original timeout. A different entry gets a fresh timeout, even when both entries share a display name.

  • Repeated launches keep their deadline, while a different app gets a fresh one.

Reviews (5) · Last reviewed commit: "Give a different app its own launch feed..." · Reviewed by Greptile

Comment thread shell/services/AppLibrary.qml Resolved
A fixture runs the app library's launch feedback with its timers shortened: a second launch while the OSD is up keeps the first deadline, and a launch after the deadline passed gets a fresh one.
Checking the OSD at fixed times let a stalled event loop look at the wrong moment. Record when the OSD opens and closes, and compare the close with when each launch began, with a 2s timeout so the margins are wide.
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed the update at 0cb2428b44d60a94c3337ca46918ed0b0dbeff48, including the new QML fixture, launch cleanup, menu/dock callers and the competing timeout change in #13095. Codex High reviewed it, with a second opinion from Opus 5.5 High and muse-wonder via pi, thinking high. Both reviewers agreed on the different-app cutoff below; independence is not guaranteed.

The new fixture exercises the real AppLibrary timers, replacing the old source-text assertions. It observes launchOsdOpen with a mock shell, so it does not establish that the visible, permanently stuck toast in #12922 is fixed. The current base also includes #9819's in-process OSD show/hide calls, replacing the detached calls discussed in the earlier review.

The previous different-app cutoff remains: from the control flow at shell/services/AppLibrary.qml:246–261, if app A starts at t=0 and app B starts at t=14s, A's timeout at t=15s closes B's feedback and cancels B's pending 2s delay. B gets no toast. The fixture's differently named “First” and “Second” launches now explicitly encode this shared deadline. #13095 preserves a fresh deadline for a different app, so that is the competing approach to pursue for this case; it still needs updating and behavioral verification against the current base.

No worker tests were run in this pass: verification stops after the competing-fix comparison. CI's compositor shard passed, but test (noncomp-2) timed out after 900s in the unchanged luks-rekey-journal-test.sh. Nothing pushed. Waiting on the maintainer to choose between the shared cap here and the per-app behavior in #13095.

@chessing234

Copy link
Copy Markdown
Contributor

your three commits are in #21025. the same launch does not restart the 15s deadline. the show still carries a finite duration and the launch serial, from #18678 and #16883. @dhh @omarchybot if 21025 lands, this can close as superseded.

@omarchybot

Copy link
Copy Markdown
Collaborator

I checked the December 1 reference to #21025. It closed without merging, and its diff gives differently named apps a fresh deadline like #13095. Codex High and Opus 5.5 High compared the source against current quattro. The deadline choice remains with the maintainer.

Opus 5.5 High also spotted that the fixture's require_quickshell call moves the whole icon-scan test out of the non-compositor suite. Codex High confirmed the grouping in test/shell:66,124. This follow-up was a source review.

omarchybot and others added 2 commits December 2, 2026 06:36
A launch late in the previous app's timeout can lose its toast before the delay elapses. Keep the deadline for repeat launches of the same desktop entry and start a fresh one for a different entry, including entries with the same display name.

Exercise a repeat before and after expiry and ensure each toast closes at its own deadline. Run the fixture with the dock's Quickshell tests so the icon scan stays in the non-compositor suite.

Co-Authored-By: Saurabh Suri <suritech@gmail.com>
Co-Authored-By: Codex High <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 High <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Dec 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

I folded #13095’s deadline for a different desktop entry into 62492b7. Codex High launched the same app twice from the Apps menu on an Omarchy worker. At 17.8 seconds after the first launch, the toast was still visible on quattro and with the fix reverted, and had closed on this head. A different app launched late kept its own deadline. The CLI, dock, and icon-scan tests passed. Opus 5.5 High found a missing expiry assertion in the fixture and reviewed the corrected test.

GitHub CI passed. The full worker shell suite had four failures that also occurred with the base launch code. Please update the description to match the deadline change and replace Fixes #12922 with Refs #12922. #9819 addressed the toast that stayed up indefinitely.

Quattro at 17.8 seconds with the toast still visible

62492b7 at the same time with the toast closed

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Launching… OSD toast can get stuck on screen indefinitely

5 participants