summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP Cimalando <jp-dev@inbox.ru>2019-07-06 18:01:40 +0200
committerFilipe Coelho <falktx@falktx.com>2019-07-06 19:24:17 +0200
commitbcf84559a524a8100922804f040bf600fb2d894e (patch)
tree92699b6edda324db17523234b1f708851c4562c3
parent7a056bbcf84f9437d7a00a5659be5bb6008bfe1d (diff)
Set UTF8 window title using NetWM hints
-rw-r--r--dgl/src/Window.cpp3
-rw-r--r--dgl/src/pugl/pugl_x11.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp
index bb9db161..0eec7972 100644
--- a/dgl/src/Window.cpp
+++ b/dgl/src/Window.cpp
@@ -687,6 +687,9 @@ struct Window::PrivateData {
}
#else
XStoreName(xDisplay, xWindow, title);
+ Atom netWmName = XInternAtom(xDisplay, "_NET_WM_NAME", False);
+ Atom utf8String = XInternAtom(xDisplay, "UTF8_STRING", False);
+ XChangeProperty(xDisplay, xWindow, netWmName, utf8String, 8, PropModeReplace, (unsigned char *)title, strlen(title));
#endif
}
diff --git a/dgl/src/pugl/pugl_x11.c b/dgl/src/pugl/pugl_x11.c
index 3146cfcc..2783bbbf 100644
--- a/dgl/src/pugl/pugl_x11.c
+++ b/dgl/src/pugl/pugl_x11.c
@@ -274,6 +274,9 @@ puglCreateWindow(PuglView* view, const char* title)
if (title) {
XStoreName(impl->display, impl->win, title);
+ Atom netWmName = XInternAtom(impl->display, "_NET_WM_NAME", False);
+ Atom utf8String = XInternAtom(impl->display, "UTF8_STRING", False);
+ XChangeProperty(impl->display, impl->win, netWmName, utf8String, 8, PropModeReplace, (unsigned char *)title, strlen(title));
}
if (view->transient_parent > 0) {