Also set the _NET_WM_NAME. Window managers supporting this will take this value over the value set by XStoreName. This explicitly supports UTF-8 encoding, which fixes corrupt UTF-8 titles in KDE.
authorJason Wyatt <jwyatt@feralinteractive.com>
Tue, 05 May 2015 09:16:12 +0100
changeset 9698bf0257e323d2
parent 9697 152b686b9a75
child 9699 8e0e18edb270
Also set the _NET_WM_NAME. Window managers supporting this will take this value over the value set by XStoreName. This explicitly supports UTF-8 encoding, which fixes corrupt UTF-8 titles in KDE.
src/video/x11/SDL_x11messagebox.c
     1.1 --- a/src/video/x11/SDL_x11messagebox.c	Sun May 31 23:53:10 2015 -0400
     1.2 +++ b/src/video/x11/SDL_x11messagebox.c	Tue May 05 09:16:12 2015 +0100
     1.3 @@ -376,7 +376,7 @@
     1.4      int x, y;
     1.5      XSizeHints *sizehints;
     1.6      XSetWindowAttributes wnd_attr;
     1.7 -    Atom _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DIALOG;
     1.8 +    Atom _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_NAME, UTF8_STRING;
     1.9      Display *display = data->display;
    1.10      SDL_WindowData *windowdata = NULL;
    1.11      const SDL_MessageBoxData *messageboxdata = data->messageboxdata;
    1.12 @@ -411,6 +411,11 @@
    1.13      }
    1.14  
    1.15      X11_XStoreName( display, data->window, messageboxdata->title );
    1.16 +    _NET_WM_NAME = X11_XInternAtom(display, "_NET_WM_NAME", False);
    1.17 +    UTF8_STRING = X11_XInternAtom(display, "UTF8_STRING", False);
    1.18 +    X11_XChangeProperty(display, data->window, _NET_WM_NAME, UTF8_STRING, 8,
    1.19 +                    PropModeReplace, (unsigned char *) messageboxdata->title,
    1.20 +                    strlen(messageboxdata->title) + 1 );
    1.21  
    1.22      /* Let the window manager know this is a dialog box */
    1.23      _NET_WM_WINDOW_TYPE = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);