Skip to content

Commit

Permalink
(x_set_name_internal): Undo last change.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chong Yidong committed Jun 2, 2007
1 parent a214f1e commit 481573e
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/xfns.c
Expand Up @@ -1607,20 +1607,22 @@ x_set_name_internal (f, name)
BLOCK_INPUT;
#ifdef HAVE_X11R4
{
XTextProperty text, icon;
int bytes, stringp;
int do_free_icon_value = 0, do_free_text_value = 0;
Lisp_Object coding_system;
#ifdef USE_GTK
Lisp_Object encoded_name;
struct gcpro gcpro1;

/* As ENCODE_UTF_8 may cause GC and relocation of string data,
we use it before x_encode_text that may return string data. */
GCPRO1 (name);
encoded_name = ENCODE_UTF_8 (name);
UNGCPRO;
#endif

gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
(char *) SDATA (encoded_name));
#else /* not USE_GTK */
XTextProperty text, icon;
int bytes, stringp;
int do_free_icon_value = 0, do_free_text_value = 0;
Lisp_Object coding_system;
coding_system = Qcompound_text;

/* Note: Encoding strategy
We encode NAME by compound-text and use "COMPOUND-TEXT" in
Expand Down Expand Up @@ -1657,15 +1659,19 @@ x_set_name_internal (f, name)
icon.nitems = bytes;
}

#ifdef USE_GTK
gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
(char *) SDATA (encoded_name));
#else /* not USE_GTK */
XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
#endif /* not USE_GTK */

XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &icon);

if (do_free_icon_value)
xfree (icon.value);
if (do_free_text_value)
xfree (text.value);
#endif /* not USE_GTK */
}
#else /* not HAVE_X11R4 */
XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
Expand Down

0 comments on commit 481573e

Please sign in to comment.