--- ./src/balloon.h.orig-clipcaptions Tue Mar 9 09:43:02 1999 +++ ./src/balloon.h Sun Apr 11 01:05:57 1999 @@ -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-clipcaptions Tue Mar 9 09:43:02 1999 +++ ./src/balloon.c Sun Apr 11 01:05:57 1999 @@ -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) { @@ -433,6 +455,8 @@ free(scr->balloon->text); scr->balloon->text = NULL; + scr->flags.clip_balloon_mapped = 0; + if (!object) { wBalloonHide(scr); balloon->ignoreTimer = 0; @@ -446,8 +470,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: @@ -468,6 +495,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) { @@ -479,6 +519,7 @@ WMDeleteTimerHandler(scr->balloon->timer); scr->balloon->timer = NULL; } + scr->flags.clip_balloon_mapped = 0; scr->balloon->prevType = 0; } } --- ./src/dock.c.orig-clipcaptions Mon Mar 22 07:16:51 1999 +++ ./src/dock.c Sun Apr 11 01:08:15 1999 @@ -145,7 +145,9 @@ static void clipAutoLower(void *cdata); static void clipAutoRaise(void *cdata); +#if 0 static void showClipBalloon(WDock *dock, int workspace); +#endif #ifdef OFFIX_DND @@ -1169,6 +1171,8 @@ } +#define CLIP_CAPTION_SPACE_X (4) +#define CLIP_CAPTION_SPACE_Y (3) void wClipIconPaint(WAppIcon *aicon) { @@ -1178,6 +1182,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); @@ -1195,19 +1200,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, @@ -3042,7 +3058,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 + } } } @@ -3803,10 +3825,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"); @@ -3850,6 +3874,7 @@ } +#if 0 static void showClipBalloon(WDock *dock, int workspace) { @@ -3891,6 +3916,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 @@ -3930,6 +3956,7 @@ (void *)dock); } +#if 0 if (btn->xindex == 0 && btn->yindex == 0) showClipBalloon(dock, dock->screen_ptr->current_workspace); else { @@ -3938,9 +3965,9 @@ dock->screen_ptr->flags.clip_balloon_mapped = 0; } } +#endif } - static void clipLeave(WDock *dock) { @@ -4061,9 +4088,11 @@ if (dock->auto_raise_lower) wDockRaise(dock); +#if 0 if (dock->screen_ptr->flags.clip_balloon_mapped) { showClipBalloon(dock, dock->screen_ptr->current_workspace); } +#endif dock->auto_raise_magic = NULL; }