comparison src/video/x11/SDL_x11window.c @ 2143:e906da4414a3

Fix for bug #447 merged from SDL 1.2
author Sam Lantinga <slouken@libsdl.org>
date Wed, 04 Jul 2007 08:01:04 +0000
parents ba0d62354872
children 2032348afed1
comparison
equal deleted inserted replaced
2142:ca80c942e69c 2143:e906da4414a3
427 _NET_WM_ICON_NAME = XInternAtom(display, "_NET_WM_ICON_NAME", False); 427 _NET_WM_ICON_NAME = XInternAtom(display, "_NET_WM_ICON_NAME", False);
428 } 428 }
429 #endif 429 #endif
430 430
431 if (title != NULL) { 431 if (title != NULL) {
432 char *title_latin1 = SDL_iconv_utf8_latin1((char *) title); 432 char *title_locale = SDL_iconv_utf8_locale(title);
433 if (!title_latin1) { 433 if (!title_locale) {
434 SDL_OutOfMemory(); 434 SDL_OutOfMemory();
435 return; 435 return;
436 } 436 }
437 status = XStringListToTextProperty(&title_latin1, 1, &titleprop); 437 status = XStringListToTextProperty(&title_locale, 1, &titleprop);
438 SDL_free(title_latin1); 438 SDL_free(title_locale);
439 if (status) { 439 if (status) {
440 XSetTextProperty(display, data->window, &titleprop, XA_WM_NAME); 440 XSetTextProperty(display, data->window, &titleprop, XA_WM_NAME);
441 XFree(titleprop.value); 441 XFree(titleprop.value);
442 } 442 }
443 #ifdef X_HAVE_UTF8_STRING 443 #ifdef X_HAVE_UTF8_STRING
452 } 452 }
453 } 453 }
454 #endif 454 #endif
455 } 455 }
456 if (icon != NULL) { 456 if (icon != NULL) {
457 char *icon_latin1 = SDL_iconv_utf8_latin1((char *) icon); 457 char *icon_locale = SDL_iconv_utf8_locale(icon);
458 if (!icon_latin1) { 458 if (!icon_locale) {
459 SDL_OutOfMemory(); 459 SDL_OutOfMemory();
460 return; 460 return;
461 } 461 }
462 status = XStringListToTextProperty(&icon_latin1, 1, &iconprop); 462 status = XStringListToTextProperty(&icon_locale, 1, &iconprop);
463 SDL_free(icon_latin1); 463 SDL_free(icon_locale);
464 if (status) { 464 if (status) {
465 XSetTextProperty(display, data->window, &iconprop, 465 XSetTextProperty(display, data->window, &iconprop,
466 XA_WM_ICON_NAME); 466 XA_WM_ICON_NAME);
467 XFree(iconprop.value); 467 XFree(iconprop.value);
468 } 468 }