aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pugl/detail/x11.c5
-rw-r--r--pugl/detail/x11.h2
-rw-r--r--test/pugl_test.c4
3 files changed, 10 insertions, 1 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index a076d6f..32f1393 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -75,8 +75,10 @@ puglCreateWindow(PuglView* view, const char* title)
impl->screen = DefaultScreen(display);
// Intern the various atoms we will need
+ impl->atoms.UTF8_STRING = XInternAtom(display, "UTF8_STRING", 0);
impl->atoms.WM_PROTOCOLS = XInternAtom(display, "WM_PROTOCOLS", 0);
impl->atoms.WM_DELETE_WINDOW = XInternAtom(display, "WM_DELETE_WINDOW", 0);
+ impl->atoms.NET_WM_NAME = XInternAtom(display, "_NET_WM_NAME", 0);
impl->atoms.NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", 0);
impl->atoms.NET_WM_STATE_DEMANDS_ATTENTION =
XInternAtom(display, "_NET_WM_STATE_DEMANDS_ATTENTION", 0);
@@ -132,6 +134,9 @@ puglCreateWindow(PuglView* view, const char* title)
if (title) {
XStoreName(display, win, title);
+ XChangeProperty(display, win,
+ impl->atoms.NET_WM_NAME, impl->atoms.UTF8_STRING, 8,
+ PropModeReplace, (const uint8_t*)title, strlen(title));
}
if (!view->parent) {
diff --git a/pugl/detail/x11.h b/pugl/detail/x11.h
index 98f42b0..1ead119 100644
--- a/pugl/detail/x11.h
+++ b/pugl/detail/x11.h
@@ -33,8 +33,10 @@ struct PuglInternalsImpl {
PuglSurface* surface;
struct {
+ Atom UTF8_STRING;
Atom WM_PROTOCOLS;
Atom WM_DELETE_WINDOW;
+ Atom NET_WM_NAME;
Atom NET_WM_STATE;
Atom NET_WM_STATE_DEMANDS_ATTENTION;
} atoms;
diff --git a/test/pugl_test.c b/test/pugl_test.c
index f81cf99..af93caf 100644
--- a/test/pugl_test.c
+++ b/test/pugl_test.c
@@ -182,7 +182,9 @@ main(int argc, char** argv)
puglIgnoreKeyRepeat(view, ignoreKeyRepeat);
puglSetEventFunc(view, onEvent);
- if (puglCreateWindow(view, "Pugl Test")) {
+ const uint8_t title[] = { 'P', 'u', 'g', 'l', ' ',
+ 'P', 'r', 0xC3, 0xBC, 'f', 'u', 'n', 'g' };
+ if (puglCreateWindow(view, (const char*)title)) {
return 1;
}