Bar mode + ephemeral popup spawn (NON_UNIQUE)#4
Open
heath-toby wants to merge 1 commit into
Open
Conversation
Adds a persistent top-bar mode for WayTray, enabled by passing `--bar` to the client. The window then anchors to the top edge using layer-shell's Top layer with auto-exclusive zone, runs without keyboard focus by default (picking it up on demand), skips the close-on-focus-loss logic that the popup uses, and ships its own dark CSS theme. Escape releases keyboard focus instead of closing. Also flips the popup spawn model to `gio::ApplicationFlags::NON_UNIQUE`: Previously, each Ctrl+Alt+Tab launch shared the same GApplication instance via D-Bus uniqueness. If the popup process ever ended up in a state where its layer-shell surface had been unmapped but `app.active_window()` still returned the destroyed window, subsequent `present()` calls became no-ops and the only fix was `killall waytray`. NON_UNIQUE makes every popup invocation its own short-lived process — no carry-over state, no stuck instance, and the existing focus-loss logic cleanly tears it down when dismissed. Bar mode keeps `FLAGS_NONE` so it remains a singleton. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a persistent top-bar mode for WayTray, enabled by passing
--barto the client. In bar mode the window anchors to the top edge using layer-shell'sToplayer withauto_exclusive_zone, runs without keyboard focus by default (picking it up on demand), skips the close-on-focus-loss logic that the popup uses, and ships its own dark CSS theme. Escape releases keyboard focus instead of closing.Also flips the popup spawn model to
gio::ApplicationFlags::NON_UNIQUE:Previously, each Ctrl+Alt+Tab launch shared the same GApplication instance via D-Bus uniqueness. If the popup process ever ended up in a state where its layer-shell surface had been unmapped but
app.active_window()still returned the destroyed window, subsequentpresent()calls became no-ops and the only fix waskillall waytray. NON_UNIQUE makes every popup invocation its own short-lived process — no carry-over state, no stuck instance, and the existing focus-loss logic cleanly tears it down when dismissed. Bar mode keepsFLAGS_NONEso it remains a singleton.Test plan
waytray --bar— a top bar appears, anchored, with the styled background, never closes on focus loss.waytray(no flag) repeatedly — each invocation spawns its own process, opens a popup, closes cleanly on Escape or focus loss without leaving zombies.killall waytrayis needed.🤖 Generated with Claude Code