Repository navigation
wlr: expose xdg activation - #13
Merged
Merged
Conversation
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.
Why
Kawa wants to support xdg-activation-v1 so that a window gets focus only when it presents a token tied to recent user input. Today a window started from a terminal never gets focus, and only windows opened through kawa's New are focused when they map. The kawa side is DeedleFake/kawa#18, stacked on DeedleFake/kawa#17. This PR adds only the wlroots bindings it needs.
Scope
All of these are plain 1:1 wrappers with no behavior of their own.
CreateXDGActivationV1wrapswlr_xdg_activation_v1_create.XDGActivationV1.OnRequestActivateandOnNewTokenattach to therequest_activateandnew_tokensignals.XDGActivationV1.CreateTokenwrapswlr_xdg_activation_token_v1_create, so the compositor can hand a token to programs it starts.XDGActivationV1RequestActivateEventexposes the event'stokenandsurface.XDGActivationTokenV1exposesValid, thesurface,seatandserialfields,Name(fromwlr_xdg_activation_token_v1_get_name) andOnDestroy.Seat.Validlets a caller tell whether a token came with a seat, which is how wlroots marks a token made from a real input serial.Tradeoffs
I left out bindings kawa doesn't use yet, such as
wlr_xdg_activation_v1_find_token, the token timeout fields and the app ID. Each is a one-line addition when something needs it.Blast Radius
These are new types and methods only. No existing binding changes, so other users of the package are unaffected.
Verification
go build ./...andgo vet ./...pass against wlroots 0.20. Kawa's xdg-activation branch builds against this branch, and I exercised it on a real Xvfb session. A token from a click is granted focus, both before and after the window maps. A token without a serial is refused and marked for attention. A token kawa creates for New is accepted.