changeset 12074:111aadc2521a

(x_text_icon): Do call XSetIconName or XSetWMIconName. Don't save ICON_NAME anywhere.
author Karl Heuer <kwzh@gnu.org>
date Mon, 05 Jun 1995 12:38:46 +0000
parents 1b0018c43060
children 4e06c01054aa
files src/xterm.c
diffstat 1 files changed, 19 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Mon Jun 05 12:38:20 1995 +0000
+++ b/src/xterm.c	Mon Jun 05 12:38:46 1995 +0000
@@ -4315,7 +4315,8 @@
 }
 
 
-/* Make the x-window of frame F use a rectangle with text.  */
+/* Make the x-window of frame F use a rectangle with text.
+   Use ICON_NAME as the text.  */
 
 int
 x_text_icon (f, icon_name)
@@ -4325,16 +4326,23 @@
   if (FRAME_X_WINDOW (f) == 0)
     return 1;
 
-  if (icon_name)
-    f->display.x->icon_label = icon_name;
-  else
-    if (! f->display.x->icon_label)
-      f->display.x->icon_label = " *emacs* ";
-
-#if 0
-  XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-		(char *) f->display.x->icon_label);
-#endif
+#ifdef HAVE_X11R4
+  {
+    XTextProperty text;
+    text.value = (unsigned char *) icon_name;
+    text.encoding = XA_STRING;
+    text.format = 8;
+    text.nitems = strlen (icon_name);
+#ifdef USE_X_TOOLKIT
+    XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->display.x->widget),
+		    &text);
+#else /* not USE_X_TOOLKIT */
+    XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text);
+#endif /* not USE_X_TOOLKIT */
+  }
+#else /* not HAVE_X11R4 */
+  XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), icon_name);
+#endif /* not HAVE_X11R4 */
 
   if (f->display.x->icon_bitmap > 0)
     x_destroy_bitmap (f, f->display.x->icon_bitmap);