Skip to content

Bar mode + ephemeral popup spawn (NON_UNIQUE)#4

Open
heath-toby wants to merge 1 commit into
destructatron:mainfrom
heath-toby:feat/bar-mode
Open

Bar mode + ephemeral popup spawn (NON_UNIQUE)#4
heath-toby wants to merge 1 commit into
destructatron:mainfrom
heath-toby:feat/bar-mode

Conversation

@heath-toby

Copy link
Copy Markdown

Summary

Adds a persistent top-bar mode for WayTray, enabled by passing --bar to the client. In bar mode the window 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.

Test plan

  • Run waytray --bar — a top bar appears, anchored, with the styled background, never closes on focus loss.
  • Press Escape on a focused bar — keyboard releases, bar stays visible.
  • Run waytray (no flag) repeatedly — each invocation spawns its own process, opens a popup, closes cleanly on Escape or focus loss without leaving zombies.
  • After dozens of popup open/close cycles, no killall waytray is needed.

🤖 Generated with Claude Code

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>
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