commit bcf84559a524a8100922804f040bf600fb2d894e
parent 7a056bbcf84f9437d7a00a5659be5bb6008bfe1d
Author: JP Cimalando <jp-dev@inbox.ru>
Date: Sat, 6 Jul 2019 18:01:13 +0200
Set UTF8 window title using NetWM hints
Diffstat:
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git 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
@@ -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) {