Skip to content

fix(hub): a tree opened in a program comes to the front on Windows - #183

Merged
7schmiede merged 1 commit into
mainfrom
fix/open-in-foreground
Oct 21, 2026
Merged

7schmiede merged 1 commit into
mainfrom
fix/open-in-foreground

Conversation

@7schmiede

Copy link
Copy Markdown
Member

Problem

When you open a stack's or lane's tree in a program (Explorer, Windows Terminal, PowerShell, VS Code and its forks, Claude, Orca), the window opens behind the browser. The hub runs in the background, and Windows lets a background process neither take the foreground nor give it. ADR-0046 named this as a consequence.

Fix

  • The folder dialog's owner window moves from dialog.rs to a new foreground::Front. It is an invisible topmost window brought to the front with a synthetic Alt key event and then SetForegroundWindow. It now also calls AllowSetForegroundWindow(ASFW_ANY), so the next process to ask may take the foreground. That permission lasts until the user's next input. It covers both a program the hub starts and a running program a link is handed to (VS Code, Orca).
  • open::open holds a Front while it starts the program or hands it the link.
  • ADR-0046 is amended (consequence and Enforced by), and CHANGELOG has a new entry.

Linux is unchanged. A desktop there that prevents focus stealing may still open the program behind.

Tests

  • cargo clippy -p devstack-hub --all-targets -- -D warnings and cargo fmt --check pass.
  • cargo test -p devstack-hub --lib open passes.
  • Not tried on the desktop yet: each opener should be clicked once from the dashboard with a hub built from this branch.

🤖 Generated with Claude Code

The hub runs in the background, and Windows lets a background process
neither take the foreground nor give it: Explorer, the terminals, the
editors and Orca opened behind the browser that asked for them.

The folder dialog's owner window (a synthetic Alt key event, then
SetForegroundWindow) moves to `foreground::Front`, which also lets any
process take the foreground next (AllowSetForegroundWindow(ASFW_ANY)).
`open::open` holds one while it starts the program or hands it the link.
ADR-0046's consequence is amended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 73fab04 into main Oct 21, 2026
@7schmiede
7schmiede deleted the fix/open-in-foreground branch October 21, 2026 15:27
@7schmiede 7schmiede mentioned this pull request Oct 21, 2026
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.

1 participant