Date: Thu, 02 Sep 2004 01:06:23 +0200
From: Ivo Danihelka Subject: [SDL] [PATCH] Fixed XLocaleNotSupported in utf8 code there exist X server configurations which does not support locales. They even does not support conversion from utf-8 textList to utf-8 textProperty. This patch fixes such situations. It is my bug because I submitted the previous support for utf-8. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40955
This commit is contained in:
parent
31f22de807
commit
a5a84be769
1 changed files with 14 additions and 8 deletions
|
@ -255,22 +255,28 @@ void X11_SetCaption(_THIS, const char *title, const char *icon)
|
||||||
SDL_Lock_EventThread();
|
SDL_Lock_EventThread();
|
||||||
|
|
||||||
if ( title != NULL ) {
|
if ( title != NULL ) {
|
||||||
|
int error = XLocaleNotSupported;
|
||||||
#ifdef X_HAVE_UTF8_STRING
|
#ifdef X_HAVE_UTF8_STRING
|
||||||
Xutf8TextListToTextProperty(SDL_Display, (char **)&title, 1,
|
error = Xutf8TextListToTextProperty(SDL_Display,
|
||||||
XUTF8StringStyle, &titleprop);
|
(char **)&title, 1, XUTF8StringStyle,
|
||||||
#else
|
&titleprop);
|
||||||
XStringListToTextProperty((char **)&title, 1, &titleprop);
|
|
||||||
#endif
|
#endif
|
||||||
|
if ( error != Success ) {
|
||||||
|
XStringListToTextProperty((char **)&title, 1,
|
||||||
|
&titleprop);
|
||||||
|
}
|
||||||
XSetWMName(SDL_Display, WMwindow, &titleprop);
|
XSetWMName(SDL_Display, WMwindow, &titleprop);
|
||||||
XFree(titleprop.value);
|
XFree(titleprop.value);
|
||||||
}
|
}
|
||||||
if ( icon != NULL ) {
|
if ( icon != NULL ) {
|
||||||
|
int error = XLocaleNotSupported;
|
||||||
#ifdef X_HAVE_UTF8_STRING
|
#ifdef X_HAVE_UTF8_STRING
|
||||||
Xutf8TextListToTextProperty(SDL_Display, (char **)&icon, 1,
|
error = Xutf8TextListToTextProperty(SDL_Display,
|
||||||
XUTF8StringStyle, &iconprop);
|
(char **)&icon, 1, XUTF8StringStyle, &iconprop);
|
||||||
#else
|
|
||||||
XStringListToTextProperty((char **)&icon, 1, &iconprop);
|
|
||||||
#endif
|
#endif
|
||||||
|
if ( error != Success ) {
|
||||||
|
XStringListToTextProperty((char **)&icon, 1, &iconprop);
|
||||||
|
}
|
||||||
XSetWMIconName(SDL_Display, WMwindow, &iconprop);
|
XSetWMIconName(SDL_Display, WMwindow, &iconprop);
|
||||||
XFree(iconprop.value);
|
XFree(iconprop.value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue