From 8a2ee131a5cb2b0fd86aa2371e3f9474643f8926 Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Sat, 6 Jul 2019 18:01:40 +0200 Subject: [PATCH] Set UTF8 window title using NetWM hints --- dgl/src/Window.cpp | 3 +++ dgl/src/pugl/pugl_x11.c | 3 +++ 2 files changed, 6 insertions(+) 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) {