Browse Source

Set UTF8 window title using NetWM hints

pull/158/head
JP Cimalando Filipe Coelho <falktx@falktx.com> 5 years ago
parent
commit
bcf84559a5
2 changed files with 6 additions and 0 deletions
  1. +3
    -0
      dgl/src/Window.cpp
  2. +3
    -0
      dgl/src/pugl/pugl_x11.c

+ 3
- 0
dgl/src/Window.cpp View File

@@ -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
}



+ 3
- 0
dgl/src/pugl/pugl_x11.c View File

@@ -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) {


Loading…
Cancel
Save