diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-12-08 18:20:33 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-12-08 18:20:33 +0100 |
commit | 248fd276262358d0f2fa1a7daa6a4e19b7a40396 (patch) | |
tree | b9f590eafba6acd7fdf8be84e701fad8f6bd3453 | |
parent | b3c534bdeb82f31d1a30d609b2fe42c128d9b560 (diff) |
Set wm client machine
-rw-r--r-- | src/window/window.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/window/window.c b/src/window/window.c index ba4e8d5..9c82b3e 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -11,6 +11,7 @@ #include <string.h> #include <errno.h> #include <stdio.h> +#include <limits.h> #include <assert.h> #include <unistd.h> @@ -620,6 +621,17 @@ static int mgl_window_init(mgl_window *self, const char *title, const mgl_window 32, PropModeReplace, (const unsigned char*)&pid, 1); } + char host_name[HOST_NAME_MAX]; + if(gethostname(host_name, sizeof(host_name)) == 0) { + fprintf(stderr, "host name: %s\n", host_name); + XTextProperty txt_prop; + txt_prop.value = host_name; + txt_prop.encoding = XA_STRING; + txt_prop.format = 8; + txt_prop.nitems = strlen(host_name); + XSetWMClientMachine(context->connection, self->window, &txt_prop); + } + if(params && params->class_name) { XClassHint class_hint = { params->class_name, params->class_name }; XSetClassHint(context->connection, self->window, &class_hint); |