Date: Mon, 28 Jun 2004 23:15:55 +0200
authorSam Lantinga <slouken@libsdl.org>
Sun, 25 Jul 2004 17:33:33 +0000
changeset 913a7a8c282d62e
parent 912 bc0b95b02235
child 914 bbf8dcc8aed6
Date: Mon, 28 Jun 2004 23:15:55 +0200
From: Ivo Danihelka
Subject: [SDL] [PATCH] SDL_WM_SetCaption with UTF-8

This patch enables UTF-8 suport for SDL_WM_SetCaption() in x11.

XFree86 >= 4.0.2 supports text strings in UTF-8. Presence of this
feature is indicated by the macro X_HAVE_UTF8_STRING.
src/video/x11/SDL_x11wm.c
     1.1 --- a/src/video/x11/SDL_x11wm.c	Wed Jul 21 04:53:26 2004 +0000
     1.2 +++ b/src/video/x11/SDL_x11wm.c	Sun Jul 25 17:33:33 2004 +0000
     1.3 @@ -255,12 +255,22 @@
     1.4  	SDL_Lock_EventThread();
     1.5  
     1.6  	if ( title != NULL ) {
     1.7 +#ifdef X_HAVE_UTF8_STRING
     1.8 +		Xutf8TextListToTextProperty(SDL_Display, (char **)&title, 1,
     1.9 +			XUTF8StringStyle, &titleprop);
    1.10 +#else
    1.11  		XStringListToTextProperty((char **)&title, 1, &titleprop);
    1.12 +#endif
    1.13  		XSetWMName(SDL_Display, WMwindow, &titleprop);
    1.14  		XFree(titleprop.value);
    1.15  	}
    1.16  	if ( icon != NULL ) {
    1.17 +#ifdef X_HAVE_UTF8_STRING
    1.18 +		Xutf8TextListToTextProperty(SDL_Display, (char **)&icon, 1,
    1.19 +			XUTF8StringStyle, &iconprop);
    1.20 +#else
    1.21  		XStringListToTextProperty((char **)&icon, 1, &iconprop);
    1.22 +#endif
    1.23  		XSetWMIconName(SDL_Display, WMwindow, &iconprop);
    1.24  		XFree(iconprop.value);
    1.25  	}