Skip to content

Focus existing windows after no-op app launches - #8570

Open
npenza wants to merge 2 commits into
omacom:quattrofrom
npenza:fix/launcher-focus-existing-app
Open

npenza wants to merge 2 commits into
omacom:quattrofrom
npenza:fix/launcher-focus-existing-app

Conversation

@npenza

@npenza npenza commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

Relaunching an already-running single-instance app such as Telegram or Aether can succeed without creating a new window or activating the existing one. Omarchy currently interprets the lack of window activity as an app still starting, so it displays a misleading Launching… OSD until the timeout.

Before

screenrecording-2026-08-27_21-27-36.mp4

After

screenrecording-2026-08-27_21-24-41.mp4

Summary

  • remember a matching top-level window before launching a desktop entry
  • if the launch produces no new window or activation within the existing two-second feedback delay, activate that window instead of showing a misleading Launching… OSD
  • match exact desktop IDs case-insensitively, with StartupWMClass as a fallback

This preserves normal multi-window behavior because Omarchy still launches the desktop entry first. The focus fallback only runs when that launch has no visible effect, as happens when relaunching single-instance apps such as Telegram and Aether.

Testing

  • bash test/shell.d/app-search-test.sh
  • qmllint -I shell shell/services/AppLibrary.qml
  • git diff --check
  • ./test/all (unrelated environment failures: three packaging-coverage tests require an omarchy-pkgs checkout; launch-about-test.sh reports its existing a roomy window animates failure on this machine)

Copilot AI balanced review requested due to automatic review settings August 27, 2026 11:07

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 fallback focusing for single-instance apps whose relaunch produces no visible window activity.

Changes:

  • Matches existing windows by desktop ID or StartupWMClass.
  • Activates a remembered window after the two-second delay.
  • Adds matching and source-structure tests.

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 3 comments.

File Description
shell/services/AppSearch.js Adds app-ID matching helpers.
shell/services/AppLibrary.qml Implements existing-window focus fallback.
test/shell.d/app-search-test.sh Tests matching and fallback structure.

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

Comment thread shell/services/AppSearch.js Resolved
Comment thread shell/services/AppLibrary.qml Resolved
Comment thread test/shell.d/app-search-test.sh Resolved
@npenza
npenza marked this pull request as draft August 27, 2026 11:17
@paulogeyer

Copy link
Copy Markdown
Contributor

On my laptop this conflicts with quattro only in two hunks of AppLibrary.qml (the new omarchy-launch-tui branch and the i18n'd OSD string); keeping both sides and calling beginLaunchFeedback(id, name) resolves it, and app-search-test.sh passes after that. #16097 isn't a replacement: it only helps apps that request activation themselves, while this covers single-instance apps that don't. #15962 overlaps the OSD half.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants