Repository navigation
Conversation
[Medium impact] The change reaches the desktop-app launch paths across Omarchy’s launcher and dock. The launch changes have no established blocking behavior bug, but the test organization requirement must be met before merging. Findings
SummaryThe launcher now requests an activation token without blocking and passes it to a new desktop-entry helper.
The earlier unnumbered finding about stale launch assertions is addressed: those assertions are absent from the current The previous-review range was not used because its merge base differs from the current PR's merge base. The full PR changes were reviewed. Reviews (4) · Last reviewed commit: "Wait for the launcher's activation token..." · Reviewed by Greptile |
The old patch waited for the token with a Wayland roundtrip on the UI thread, which can block for as long as the compositor takes, and a roundtrip doesn't guarantee the token has arrived. Upstream review rejected that approach. The patch is now the upstream commits on top of the pinned commit: quickshell-mirror/quickshell#1166 (merged: shared activation helper and tray tokens), and omacom#1351 and omacom#1353 (notification tokens and Quickshell.requestActivationToken(), both async). Quickshell. activationToken() is gone; omacom/omarchy#16097 moves to the callback.
The old patch waited for the token with a Wayland roundtrip on the UI thread, which can block for as long as the compositor takes, and a roundtrip doesn't guarantee the token has arrived. Upstream review rejected that approach. The patch is now the upstream commits on top of the pinned commit: quickshell-mirror/quickshell#1166 (merged: shared activation helper and tray tokens), and omacom#1351 and omacom#1353 (notification tokens and Quickshell.requestActivationToken(), both async). Quickshell.activationToken() is gone; omacom/omarchy#16097 moves to the callback.
The old patch waited for the token with a Wayland roundtrip on the UI thread, which can block for as long as the compositor takes, and a roundtrip doesn't guarantee the token has arrived. Upstream review rejected that approach. The patch is now the upstream commits on top of the pinned commit: quickshell-mirror/quickshell#1166 (merged: shared activation helper and tray tokens), and omacom#1351 and omacom#1353 (notification tokens and Quickshell.requestActivationToken(), both async). omacom#1351 also gives each token request its own callback, so overlapping requests get their own tokens and a request survives its window closing. Quickshell.activationToken() is gone; omacom/omarchy#16097 moves to the callback.
Hyprland refuses an xdg-activation request whose token carries no input serial since hyprwm/Hyprland#16427. The launcher ran apps through gtk-launch, which replaces the token with one of its own that carries none whenever the entry asks for startup notification, so picking an app that is already running no longer raised its window. Ask quickshell for a token tied to the click and launch through omarchy-launch-desktop-entry, which passes it on: gio launch keeps the caller's XDG_ACTIVATION_TOKEN, and a D-Bus activatable app is activated over D-Bus with the token, since GLib's D-Bus activation only sends a token of its own. gtk-launch stays as the fallback for ids that don't map to a file.
Quickshell.activationToken() blocked the UI thread until the compositor answered, so quickshell#1353 replaced it with requestActivationToken(), which passes the token to a callback. Launch from that callback.
d4f3d2a to
bbd0a6f
Compare
|
Rebased on quattro. #16334 removed the |
|
|
||
| set -euo pipefail | ||
|
|
||
| source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" |
There was a problem hiding this comment.
This new test file breaks the repository's instruction to extend the area's existing tests rather than add another *-test.sh. Move these helper checks into test/shell.d/desktop-entry-launch-test.sh, which already covers desktop-entry launches. This repository requirement must be met before merging.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Still happens on Hyprland 0.57.1 (Try Omarchy, aarch64): asking for an app that's already open on another workspace (Nautilus, Chromium) doesn't switch to it. One path this PR doesn't cover: plugin panels that open windows with |
Part of #16078. Needs omacom/omarchy-pkgs#1367 for the token; without it the launcher works as before.
What changed
Hyprland refuses an xdg-activation request whose token carries no input serial since hyprwm/Hyprland#16427 (unreleased, and in omacom/omarchy-pkgs's Hyprland once that carries it). The Apps launcher ran
gtk-launch, which replaces the caller's token with a fresh one that has no serial whenever the entry setsStartupNotify=true. So picking an app that's already running (Nautilus, for example) would no longer bring its window forward. Hyprland would only mark it urgent.AppLibrary.launchasks quickshell for a token tied to the click (Quickshell.requestActivationToken(), added in omarchy-pkgs#1367), and launches from the callback with the token asXDG_ACTIVATION_TOKEN. On a quickshell without the call it launches at once with no token.omarchy-launch-desktop-entryfinds the entry's file in the XDG data dirs and runsgio launchon it, which keeps the caller's token. ADBusActivatable=trueapp is activated withorg.freedesktop.Application.Activateand the token instead, because GLib's D-Bus activation only sends a token from its own launch context. IDs that don't map to a file fall back togtk-launch, as before.uwsm-app, so apps keep their own scope.How it was verified
test/shell.d/launch-desktop-entry-test.sh(new): token passed throughgio launch, the user's copy of an entry first, IDs with spaces or ending in.desktop, D-Bus activation with the token, and thegtk-launchfallback../test/cli: 125 ok, 0 failed.app-search-test.shupdated for the new launch path (it asserted the oldgtk-launchcall), plus a check that the token is passed. It and the other launcher tests (dock-test.sh,desktop-entry-launch-test.sh,app-icon-scan-test.sh) pass.gtk-launchkeeps it only withoutStartupNotify=true;gio launchanduwsm appalways keep it.uwsm-app -- gtk-launch org.gnome.Nautilus.desktop(today's path):invalid serial 0 … rejecting, focus stays on foot.omarchy-launch-desktop-entry→ D-BusActivatewith the token → focus moves to Nautilus.Not verified: the full Omarchy shell running the new
AppLibrary.launch(tested with a panel that runs the same code), and the full./test/shellsuite (it brings up a second bar on a live desktop).Update: async token
Quickshell review rejected the blocking
Quickshell.activationToken(): it waited on a Wayland roundtrip on the UI thread. quickshell-mirror/quickshell#1353 replaces it withQuickshell.requestActivationToken(callback), andAppLibrary.launchnow launches from the callback.The launcher closes its window before
launch()runs. With the first version of the quickshell helper that dropped the token (it was tied to the window), so quickshell-mirror/quickshell#1351 now gives each request its own token object. No change was needed here for that.app-search-test.shpasses.XDG_ACTIVATION_TOKEN.AppLibrary.launchpath).