Commit 564da8e6 authored by Sam Lantinga's avatar Sam Lantinga

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.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40914
parent dd48804e
...@@ -255,12 +255,22 @@ void X11_SetCaption(_THIS, const char *title, const char *icon) ...@@ -255,12 +255,22 @@ void X11_SetCaption(_THIS, const char *title, const char *icon)
SDL_Lock_EventThread(); SDL_Lock_EventThread();
if ( title != NULL ) { if ( title != NULL ) {
#ifdef X_HAVE_UTF8_STRING
Xutf8TextListToTextProperty(SDL_Display, (char **)&title, 1,
XUTF8StringStyle, &titleprop);
#else
XStringListToTextProperty((char **)&title, 1, &titleprop); XStringListToTextProperty((char **)&title, 1, &titleprop);
#endif
XSetWMName(SDL_Display, WMwindow, &titleprop); XSetWMName(SDL_Display, WMwindow, &titleprop);
XFree(titleprop.value); XFree(titleprop.value);
} }
if ( icon != NULL ) { if ( icon != NULL ) {
#ifdef X_HAVE_UTF8_STRING
Xutf8TextListToTextProperty(SDL_Display, (char **)&icon, 1,
XUTF8StringStyle, &iconprop);
#else
XStringListToTextProperty((char **)&icon, 1, &iconprop); XStringListToTextProperty((char **)&icon, 1, &iconprop);
#endif
XSetWMIconName(SDL_Display, WMwindow, &iconprop); XSetWMIconName(SDL_Display, WMwindow, &iconprop);
XFree(iconprop.value); XFree(iconprop.value);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment