Skip to content

Commit 9b8ffb5

Browse files
committed
x11 : Add support for NET_WM_NAME
1 parent 31e192f commit 9b8ffb5

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

gfx/common/x11_common.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -810,11 +810,24 @@ void x11_update_title(void *data)
810810
{
811811
size_t _len;
812812
char title[128];
813-
title[0] = '\0';
814-
_len = video_driver_get_window_title(title, sizeof(title));
813+
title[0] = '\0';
814+
_len = video_driver_get_window_title(title, sizeof(title));
815+
Atom XA_NET_WM_NAME = XInternAtom(g_x11_dpy, "_NET_WM_NAME", False);
816+
Atom XA_UTF8_STRING = XInternAtom(g_x11_dpy, "UTF8_STRING", False);
817+
815818
if (title[0])
816-
XChangeProperty(g_x11_dpy, g_x11_win, XA_WM_NAME, XA_STRING,
819+
{
820+
if (XA_NET_WM_NAME != None && XA_UTF8_STRING != None)
821+
{
822+
XChangeProperty(g_x11_dpy, g_x11_win, XA_NET_WM_NAME, XA_UTF8_STRING,
823+
8, PropModeReplace, (const unsigned char*)title, _len);
824+
}
825+
else
826+
{
827+
XChangeProperty(g_x11_dpy, g_x11_win, XA_WM_NAME, XA_STRING,
817828
8, PropModeReplace, (const unsigned char*)title, _len);
829+
}
830+
}
818831
}
819832

820833
bool x11_input_ctx_new(bool true_full)

0 commit comments

Comments
 (0)