Skip to content

hyprland/ipc: seed activeToplevel from j/clients on init#795

Open
nemalex wants to merge 1 commit into
quickshell-mirror:masterfrom
nemalex:fix/seed-active-toplevel-on-init
Open

hyprland/ipc: seed activeToplevel from j/clients on init#795
nemalex wants to merge 1 commit into
quickshell-mirror:masterfrom
nemalex:fix/seed-active-toplevel-on-init

Conversation

@nemalex
Copy link
Copy Markdown

@nemalex nemalex commented May 8, 2026

The Hyprland event socket only emits activewindowv2 on focus changes, so on shell startup activeToplevel stays null until the user manually switches focus. j/clients already includes focusHistoryID for every entry (0 = currently focused), so refreshToplevels can identify the focused window and seed bActiveToplevel without an extra IPC roundtrip.

The seed is gated on bActiveToplevel being null to avoid clobbering a value already set by a live activewindowv2 event.

The Hyprland event socket only emits activewindowv2 on focus changes,
so on shell startup activeToplevel stays null until the user manually
switches focus. j/clients already includes focusHistoryID for every
entry (0 = currently focused), so refreshToplevels can identify the
focused window and seed bActiveToplevel without an extra IPC roundtrip.

The seed is gated on bActiveToplevel being null to avoid clobbering a
value already set by a live activewindowv2 event.
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