Use UTF8 window title for X where possible.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@22165 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2005-12-10 17:41:06 +00:00
parent ef4347670f
commit 684c01e984
2 changed files with 21 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2005-12-10 Fred Kiefer <FredKiefer@gmx.de>
* Source/x11/XGServerWindow.m (-titlewindow::): Use UTF8 window
title where possible.
2005-11-20 Adam Fedor <fedor@gnu.org>
* configure.ac: Check for winlib as well so we don't get invalid

View file

@ -1488,7 +1488,6 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
- (void) titlewindow: (NSString *)window_title : (int) win
{
XTextProperty windowName;
gswindow_device_t *window;
window = WINDOW_WITH_TAG(win);
@ -1498,8 +1497,22 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
NSDebugLLog(@"XGTrace", @"DPStitlewindow: %@ : %d", window_title, win);
if (window_title && window->ident)
{
const char *title = [window_title lossyCString];
XStringListToTextProperty((char**)&title, 1, &windowName);
XTextProperty windowName;
const char *title;
int error = XLocaleNotSupported;
#ifdef X_HAVE_UTF8_STRING
title = [window_title UTF8String];
error = Xutf8TextListToTextProperty(dpy, (char **)&title, 1,
XUTF8StringStyle,
&windowName);
#endif
if (error != Success)
{
title = [window_title lossyCString];
XStringListToTextProperty((char **)&title, 1,
&windowName);
}
XSetWMName(dpy, window->ident, &windowName);
XSetWMIconName(dpy, window->ident, &windowName);
XFree(windowName.value);