Skip to content

wlr: expose xdg activation - #13

Merged
DeedleFake merged 2 commits into
masterfrom
xdg-activation
Oct 1, 2026
Merged

DeedleFake merged 2 commits into
masterfrom
xdg-activation

Conversation

@DeedleFake

@DeedleFake DeedleFake commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

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.

  • CreateXDGActivationV1 wraps wlr_xdg_activation_v1_create.
  • XDGActivationV1.OnRequestActivate and OnNewToken attach to the request_activate and new_token signals.
  • XDGActivationV1.CreateToken wraps wlr_xdg_activation_token_v1_create, so the compositor can hand a token to programs it starts.
  • XDGActivationV1RequestActivateEvent exposes the event's token and surface.
  • XDGActivationTokenV1 exposes Valid, the surface, seat and serial fields, Name (from wlr_xdg_activation_token_v1_get_name) and OnDestroy.
  • Seat.Valid lets 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 ./... and go 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.

@DeedleFake
DeedleFake merged commit fb0cc1b into master Oct 1, 2026
2 checks passed
@DeedleFake
DeedleFake deleted the xdg-activation branch October 1, 2026 20:08
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