--- src/dock.c.orig	Sat Jan  9 09:45:12 1999
+++ src/dock.c	Sat Jan  9 09:52:06 1999
@@ -143,7 +143,9 @@
 static void clipAutoLower(void *cdata);
 static void clipAutoRaise(void *cdata);
 
+#if 0
 static void showClipBalloon(WDock *dock, int workspace);
+#endif
 
 #ifdef OFFIX_DND
 
@@ -1158,6 +1160,8 @@
 }
 
 
+#define CLIP_CAPTION_SPACE_X	(4)
+#define CLIP_CAPTION_SPACE_Y	(3)
 void
 wClipIconPaint(WAppIcon *aicon)
 {
@@ -1167,6 +1171,7 @@
     Window win = aicon->icon->core->window;
     int length, nlength;
     char *ws_name, ws_number[10];
+    char *shrunk_ws_name;
     int ty, tx;
 
     wIconPaint(aicon->icon);
@@ -1184,19 +1189,30 @@
     else
         XSetForeground(dpy, gc, scr->clip_title_pixel[CLIP_COLLAPSED]);
 
-    ty = ICON_SIZE - scr->clip_title_font->height - 3;
+    tx = CLIP_CAPTION_SPACE_X;
+    ty = CLIP_CAPTION_SPACE_Y;
     
-    tx = CLIP_BUTTON_SIZE*ICON_SIZE/64;
+    shrunk_ws_name = ShrinkString(scr->clip_title_font, ws_name,
+				  ICON_SIZE -
+				  (CLIP_BUTTON_SIZE * ICON_SIZE/64)
+				  /* - CLIP_CAPTION_SPACE_X */
+				  );
+    length = strlen(shrunk_ws_name);
     
     wDrawString(win, scr->clip_title_font, gc, tx,
-		ty + scr->clip_title_font->y, ws_name, length);
+		ty + scr->clip_title_font->y, shrunk_ws_name, length);
+    
+    free(shrunk_ws_name);
+    free(ws_name);
 
-    tx = (ICON_SIZE/2 - wTextWidth(scr->clip_title_font->font, ws_number, nlength))/2;
+    tx = (ICON_SIZE - 
+	  wTextWidth(scr->clip_title_font->font, ws_number, nlength) -
+	  CLIP_CAPTION_SPACE_X);
+    
+    ty = ICON_SIZE - scr->clip_title_font->height - CLIP_CAPTION_SPACE_Y - 1;
 
     wDrawString(win, scr->clip_title_font, gc, tx, 
-		scr->clip_title_font->y + 2, ws_number, nlength);
-
-    free(ws_name);
+		ty + scr->clip_title_font->y, ws_number, nlength);
 
     if (aicon->launching) {
 	XFillRectangle(dpy, aicon->icon->core->window, scr->stipple_gc, 
@@ -3022,7 +3038,13 @@
             wDockShowIcons(scr->workspaces[workspace]->clip);
         }
 	if (scr->flags.clip_balloon_mapped)
+	{
+#if 1
+	   wBalloonChangeText(scr, scr->workspaces[workspace]->name);
+#else
 	    showClipBalloon(scr->clip_icon->dock, workspace);
+#endif
+	}
     }
 }
 
@@ -3774,10 +3796,12 @@
         }
     }
     
+#if 0
     if (dock->type == WM_CLIP && scr->flags.clip_balloon_mapped) {
 	XUnmapWindow(dpy, scr->clip_balloon);
 	scr->flags.clip_balloon_mapped = 0;
     }
+#endif
     
 #ifdef DEBUG
     puts("handling dock");
@@ -3821,6 +3845,7 @@
 }
 
 
+#if 0
 static void
 showClipBalloon(WDock *dock, int workspace)
 {
@@ -3862,6 +3887,7 @@
     wDrawString(scr->clip_balloon, scr->clip_title_font, scr->clip_title_gc,
 		0, scr->clip_title_font->y, text, strlen(text));
 }
+#endif
 
 
 static void
@@ -3889,6 +3915,7 @@
                                                    (void *)dock);
     }
 
+#if 0
     if (btn->xindex == 0 && btn->yindex == 0)
 	showClipBalloon(dock, dock->screen_ptr->current_workspace);
     else {
@@ -3897,6 +3924,7 @@
 	    dock->screen_ptr->flags.clip_balloon_mapped = 0;
 	}
     }
+#endif
     if (dock->auto_collapse) {
         if (dock->auto_collapse_magic) {
             WMDeleteTimerHandler(dock->auto_collapse_magic);

--- ./src/balloon.h.orig	Fri Aug 21 21:58:54 1998
+++ ./src/balloon.h	Thu Sep 24 01:22:41 1998
@@ -26,6 +26,8 @@
 
 void wBalloonEnteredObject(WScreen *scr, WObjDescriptor *object);
 
+void wBalloonChangeText(WScreen *scr, char *text);
+
 void wBalloonHide(WScreen *scr);
 
 #endif
--- ./src/balloon.c.orig	Sat Sep 19 13:48:15 1998
+++ ./src/balloon.c	Thu Sep 24 01:24:43 1998
@@ -386,6 +386,28 @@
 
 
 
+static void
+clipiconBalloon(WObjDescriptor *object)
+{
+    WAppIcon *aicon = (WAppIcon*)object->parent;
+    WScreen *scr = aicon->icon->core->screen_ptr;
+    int workspace = scr->current_workspace;
+
+    scr->balloon->text = wstrdup(scr->workspaces[workspace]->name);
+    scr->balloon->h = aicon->icon->core->height;
+    scr->balloon->objectWindow = aicon->icon->core->window;
+    if (scr->balloon->prevType != 0) {
+	XUnmapWindow(dpy, scr->balloon->window);
+	showBalloon(scr);
+    } else {
+	scr->balloon->timer = WMAddTimerHandler(BALLOON_DELAY,
+						(WMCallback*)showBalloon, scr);
+    }
+    scr->flags.clip_balloon_mapped = 1;
+}
+
+
+
 void
 wBalloonInitialize(WScreen *scr)
 {
@@ -430,6 +452,8 @@
 	free(scr->balloon->text);
     scr->balloon->text = NULL;
 
+    scr->flags.clip_balloon_mapped = 0;
+    
     if (!object) {
 	wBalloonHide(scr);
 	balloon->ignoreTimer = 0;
@@ -443,8 +467,11 @@
 	break;
 
      case WCLASS_DOCK_ICON:
-	if (object->parent != scr->clip_icon && wPreferences.appicon_balloon)
+	if (wPreferences.appicon_balloon)
+	if (object->parent != scr->clip_icon)
 	    appiconBalloon(object);
+        else
+	    clipiconBalloon(object);
 	break;
 
      case WCLASS_MINIWINDOW:
@@ -465,6 +492,19 @@
 
 
 
+void wBalloonChangeText(WScreen *scr, char *text)
+{
+   if (scr->balloon->text) {
+       free(scr->balloon->text);
+   }
+   scr->balloon->text = wstrdup(text);
+   if (scr->balloon->mapped) {
+       showBalloon(scr);
+   }
+}
+
+
+
 void
 wBalloonHide(WScreen *scr)
 {
@@ -476,6 +516,7 @@
 	    WMDeleteTimerHandler(scr->balloon->timer);
 	    scr->balloon->timer = NULL;
 	}
+        scr->flags.clip_balloon_mapped = 0;
 	scr->balloon->prevType = 0;
     }
 }
