aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/window/window.c12
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);