backend/x11: Implement a few useful window properties

It is currently impossible to tell if an X11 window is created by
wlroots, or what process / client it belongs to.

The following properties are now added to the window:
* WM_CLASS
* WM_CLIENT_MACHINE
*  _NET_WM_PID

Sample xprop output:
WM_CLASS(STRING) = "X11-1", "wlroots"
WM_CLIENT_MACHINE(STRING) = "My-Desktop"
_NET_WM_PID(CARDINAL) = 3629306
This commit is contained in:
Tasos Sahanidis 2024-10-19 16:25:13 +03:00
parent 47fb00f66d
commit 727d407f3d
No known key found for this signature in database
GPG key ID: 01A1DCBA22E005C4
3 changed files with 35 additions and 0 deletions

View file

@ -424,6 +424,9 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_event_loop *loop,
{ .name = "_NET_WM_NAME", .atom = &x11->atoms.net_wm_name },
{ .name = "UTF8_STRING", .atom = &x11->atoms.utf8_string },
{ .name = "_VARIABLE_REFRESH", .atom = &x11->atoms.variable_refresh },
{ .name = "_NET_WM_PID", .atom = &x11->atoms.net_wm_pid },
{ .name = "WM_CLIENT_MACHINE", .atom = &x11->atoms.wm_client_machine },
{ .name = "WM_CLASS", .atom = &x11->atoms.wm_class },
};
for (size_t i = 0; i < sizeof(atom) / sizeof(atom[0]); ++i) {