Skip to content

wlr: expose XwaylandSurface pid - #7

Merged
DeedleFake merged 1 commit into
masterfrom
xwayland-surface-pid
Sep 29, 2026
Merged

DeedleFake merged 1 commit into
masterfrom
xwayland-surface-pid

Conversation

@DeedleFake

Copy link
Copy Markdown
Owner

Adds XwaylandSurface.PID, a plain accessor for the existing wlr_xwayland_surface.pid field. wlroots fills that field in when the surface is created by asking the X server for the owning client's PID through the XRes extension.

There was no other way to get an X client's PID through the bindings. The wl_client behind an Xwayland surface is Xwayland itself, so wl_client_get_credentials returns the Xwayland server's PID, not the X client's. kawa needs the real PID to match a newly mapped X window to the process it started from the New menu.

Verified with go build ./... and go vet ./... against wlroots 0.20.2, and by running kawa against this branch: an xclock started from New now maps with its own PID (map view title="xclock" pid=491447, matching the child kawa started) instead of -1.

@DeedleFake
DeedleFake merged commit 0470b66 into master Sep 29, 2026
2 checks passed
@DeedleFake
DeedleFake deleted the xwayland-surface-pid branch September 29, 2026 17:59
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