Use wide-char API when available. (#311079, Peter Zelezny)

2005-07-21  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_title): Use
	wide-char API when available. (#311079, Peter Zelezny)
This commit is contained in:
Tor Lillqvist 2005-07-21 07:29:36 +00:00 committed by Tor Lillqvist
parent c0775d1c70
commit aa49bb5089
4 changed files with 28 additions and 13 deletions

View File

@ -1,9 +1,13 @@
2005-07-21 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c (gdk_window_set_title): Use
wide-char API when available. (#311079, Peter Zelezny)
2005-07-21 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_bg, gtk_widget_modify_base):
Add hints on how to handle "no window" widgets. (#136347)
2005-07-20 Keith Packard <keithp@keithp.com>
* gdk/x11/gdkdrawable-x11.c: (gdk_x11_ref_cairo_surface):

View File

@ -1,9 +1,13 @@
2005-07-21 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c (gdk_window_set_title): Use
wide-char API when available. (#311079, Peter Zelezny)
2005-07-21 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_bg, gtk_widget_modify_base):
Add hints on how to handle "no window" widgets. (#136347)
2005-07-20 Keith Packard <keithp@keithp.com>
* gdk/x11/gdkdrawable-x11.c: (gdk_x11_ref_cairo_surface):

View File

@ -1,9 +1,13 @@
2005-07-21 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c (gdk_window_set_title): Use
wide-char API when available. (#311079, Peter Zelezny)
2005-07-21 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_bg, gtk_widget_modify_base):
Add hints on how to handle "no window" widgets. (#136347)
2005-07-20 Keith Packard <keithp@keithp.com>
* gdk/x11/gdkdrawable-x11.c: (gdk_x11_ref_cairo_surface):

View File

@ -1723,12 +1723,12 @@ void
gdk_window_set_title (GdkWindow *window,
const gchar *title)
{
char *mbtitle;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (title != NULL);
if (GDK_WINDOW_DESTROYED (window))
return;
/* Empty window titles not allowed, so set it to just a period. */
if (!title[0])
title = ".";
@ -1736,14 +1736,17 @@ gdk_window_set_title (GdkWindow *window,
GDK_NOTE (MISC, g_print ("gdk_window_set_title: %p: %s\n",
GDK_WINDOW_HWND (window), title));
if (!GDK_WINDOW_DESTROYED (window))
if (G_WIN32_HAVE_WIDECHAR_API ())
{
/* As the title is in UTF-8 we must translate it
* to the system codepage.
*/
mbtitle = g_locale_from_utf8 (title, -1, NULL, NULL, NULL);
API_CALL (SetWindowText, (GDK_WINDOW_HWND (window), mbtitle));
g_free (mbtitle);
wchar_t *wtitle = g_utf8_to_utf16 (title, -1, NULL, NULL, NULL);
API_CALL (SetWindowTextW, (GDK_WINDOW_HWND (window), wtitle));
g_free (wtitle);
}
else
{
char *cptitle = g_locale_from_utf8 (title, -1, NULL, NULL, NULL);
API_CALL (SetWindowTextA, (GDK_WINDOW_HWND (window), cptitle));
g_free (cptitle);
}
}