mirror of
https://github.com/swaywm/sway.git
synced 2026-04-22 06:46:27 -04:00
Add a connection label for wayland clients lauched by sway
This adds a few arguments to exec that cause sway to create a wayland socket file descriptor and point the WAYLAND_SOCKET environment variable at the socket. This in turn allows sway to track all windows created by this client (in a more robust manner than the existing pid-based tracking). Note that this only works if the exec ends up launching a single wayland client (a script that launches multiple commands will not work correctly; a process that uses libwayland-client itself and runs other processes is fine). "exec --use-wayland-socket command" only sets WAYLAND_SOCKET and does nothing else. "exec --label <label> <program>" will associate the specified label with the wl_client and all windows it creates.
This commit is contained in:
parent
f614f35e73
commit
05a418c9fe
5 changed files with 132 additions and 5 deletions
4
include/sway/client_label.h
Normal file
4
include/sway/client_label.h
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#include <wayland-server-core.h>
|
||||
|
||||
char* wl_client_label_get(struct wl_client *client);
|
||||
void wl_client_label_set(struct wl_client *client, char* label);
|
||||
|
|
@ -231,6 +231,8 @@ const char *view_get_class(struct sway_view *view);
|
|||
|
||||
const char *view_get_instance(struct sway_view *view);
|
||||
|
||||
const char *view_get_conn_label(struct sway_view *view);
|
||||
|
||||
uint32_t view_get_x11_window_id(struct sway_view *view);
|
||||
|
||||
uint32_t view_get_x11_parent_id(struct sway_view *view);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue