Repository navigation
screenshot: bind the first wl_seat so the region selector receives input - #4049
Merged
Merged
Conversation
Compositors may advertise more than one wl_seat: niri exposes seat0 (real input) alongside a niri-agent automation seat. handleGlobal assigned every seat to r.seat and called setupInput() for each one, so the last seat won - the selector created its pointer and keyboard from a seat the user never types on, and the overlay was deaf (no drag, no click, no Esc). Keep the first seat, mirroring the guard the clipboard manager already uses (duxlabs-dev#3989). Verified on niri with two seats: before, the selector ignored drag/click/Esc and had to be killed; after, dragging a region saves a PNG and Esc returns {"status":"aborted"}.
Member
|
/claude review |
Contributor
Claude reviewLooks good: keeping the first Not part of this PR, but worth a follow-up: Checked: the seat guard in |
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.
Description
dms screenshot regionrenders its overlay but never receives input on compositors that advertise more than onewl_seat. niri with the agent seat is one: it exposesseat0plus aniri-agentautomation seat.RegionSelector.handleGlobalbinds everywl_seatglobal, assigns it tor.seatand callssetupInput()for each one, so the last seat wins. The selector creates its pointer and keyboard from a seat the user never types on: the surface maps, no events ever arrive, and drag/click/Escall do nothing — the process has to be killed.Window and full-screen captures are unaffected (they never open the selector).
dms screenshot scrolluses the same selector code path and is equally broken.The fix keeps the first seat, mirroring the guard the clipboard manager already uses (#3989, which fixed the same failure mode in #3812).
Type of change
Related issues
Fixes #4048
Screenshots / video
Not a visual change: the overlay already rendered, only input was dead. Verified locally on niri with
seat0+niri-agentusing a build of this branch:Escignored; process hangs until killed;1149×644in my test), andEscreturns{"status":"aborted","error":"User cancelled selection"}.Checklist
make fmtclean andmake testpasses locally; no unit test added because the selector has no test harness — verified on hardware instead. No dependency changes, sogo mod tidyis untouched.