Add niri compositor support#97
Open
abloch wants to merge 3 commits intoAlfredoSequeida:mainfrom
Open
Conversation
Adds a WindowSystem implementation for the niri scrollable-tiling Wayland compositor. Uses niri's IPC (niri msg) to query focused window metadata and output geometry for hint overlay positioning. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
See #68 and niri-wm/niri#2381 |
tile_pos_in_workspace_view is only populated for floating windows; for tiled windows niri IPC does not expose the screen position (upstream issue niri-wm/niri#2381). The previous heuristic (centering a single column) was unreliable for multi-column layouts. Fall back to the full output geometry so hints still scans the screen correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Good catch, thanks! You're right — is only populated for floating windows. I've replaced the unreliable centering heuristic with a fallback to the full output geometry when is null. For tiled windows, hints will now scan the entire output rather than guessing an incorrect window position. Tracking the upstream fix at niri-wm/niri#2381 — once niri exposes tiled window positions we can tighten this up. |
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
WindowSystemimplementation for the niri scrollable-tiling Wayland compositorniri msg -j focused-window/focused-output) to query window metadata and output geometryDetails
Niri supports the wlr-layer-shell protocol required by hints for overlay positioning. The implementation queries niri's JSON IPC for:
Window position is derived from
tile_pos_in_workspace_viewwhen available (multi-column layouts), falling back to computing position from output geometry and tile offsets for single-column layouts.Files changed
hints/window_systems/niri.py— newNiri(WindowSystem)classhints/window_systems/window_system_type.py— added"niri"toSupportedWindowSystemshints/hints.py— added niri to detection set and import matchTest plan
niri msg -j focused-windowreturns expected data (pid, app_id, layout with tile/window sizes)Niri()class instantiates and returns correct extents on a live niri session (niri 25.11)niriprocess and routes to the correct classhints -v— AT-SPI backend invoked, overlay coordinates passed correctly