Skip to content

Commit

Permalink
Also set the _NET_WM_NAME. Window managers supporting this will take …
Browse files Browse the repository at this point in the history
…this value over the value set by XStoreName. This explicitly supports UTF-8 encoding, which fixes corrupt UTF-8 titles in KDE.
  • Loading branch information
jwyatt-feral committed May 5, 2015
1 parent 52df7f5 commit cad269b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/video/x11/SDL_x11messagebox.c
Expand Up @@ -376,7 +376,7 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data )
int x, y;
XSizeHints *sizehints;
XSetWindowAttributes wnd_attr;
Atom _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DIALOG;
Atom _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_NAME, UTF8_STRING;
Display *display = data->display;
SDL_WindowData *windowdata = NULL;
const SDL_MessageBoxData *messageboxdata = data->messageboxdata;
Expand Down Expand Up @@ -411,6 +411,11 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data )
}

X11_XStoreName( display, data->window, messageboxdata->title );
_NET_WM_NAME = X11_XInternAtom(display, "_NET_WM_NAME", False);
UTF8_STRING = X11_XInternAtom(display, "UTF8_STRING", False);
X11_XChangeProperty(display, data->window, _NET_WM_NAME, UTF8_STRING, 8,
PropModeReplace, (unsigned char *) messageboxdata->title,
strlen(messageboxdata->title) + 1 );

/* Let the window manager know this is a dialog box */
_NET_WM_WINDOW_TYPE = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
Expand Down

0 comments on commit cad269b

Please sign in to comment.