# HG changeset patch # User Sam Lantinga # Date 1094925641 0 # Node ID 3acd16ea01803e42c43afddb2fad9b3e3cd10709 # Parent cb5e1d0cad316d39a02749fe6dfa887054c575b4 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. diff -r cb5e1d0cad31 -r 3acd16ea0180 src/video/x11/SDL_x11wm.c --- a/src/video/x11/SDL_x11wm.c Sat Sep 11 17:48:41 2004 +0000 +++ b/src/video/x11/SDL_x11wm.c Sat Sep 11 18:00:41 2004 +0000 @@ -255,22 +255,28 @@ SDL_Lock_EventThread(); if ( title != NULL ) { + int error = XLocaleNotSupported; #ifdef X_HAVE_UTF8_STRING - Xutf8TextListToTextProperty(SDL_Display, (char **)&title, 1, - XUTF8StringStyle, &titleprop); -#else - XStringListToTextProperty((char **)&title, 1, &titleprop); + error = Xutf8TextListToTextProperty(SDL_Display, + (char **)&title, 1, XUTF8StringStyle, + &titleprop); #endif + if ( error != Success ) { + XStringListToTextProperty((char **)&title, 1, + &titleprop); + } XSetWMName(SDL_Display, WMwindow, &titleprop); XFree(titleprop.value); } if ( icon != NULL ) { + int error = XLocaleNotSupported; #ifdef X_HAVE_UTF8_STRING - Xutf8TextListToTextProperty(SDL_Display, (char **)&icon, 1, - XUTF8StringStyle, &iconprop); -#else - XStringListToTextProperty((char **)&icon, 1, &iconprop); + error = Xutf8TextListToTextProperty(SDL_Display, + (char **)&icon, 1, XUTF8StringStyle, &iconprop); #endif + if ( error != Success ) { + XStringListToTextProperty((char **)&icon, 1, &iconprop); + } XSetWMIconName(SDL_Display, WMwindow, &iconprop); XFree(iconprop.value); }