From 6368bde7e5c0997958837851b97827430ae9ed4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Sun, 12 Feb 2012 16:08:51 +0100 Subject: [PATCH] WindowMaker: Add Balloon to the clip Display a standard Window Maker balloon with the workspace name when the mouse enters the clip area. This complements commit 4954d4df2349 ("clip: Do not display balloon with workspace name") because now the balloon which appears on the clip is the same as in other parts of wmaker. Signed-off-by: Carlos R. Mafra --- src/balloon.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/balloon.c b/src/balloon.c index a4e8aaf5..517dc928 100644 --- a/src/balloon.c +++ b/src/balloon.c @@ -439,7 +439,15 @@ static void appiconBalloon(WObjDescriptor * object) WScreen *scr = aicon->icon->core->screen_ptr; char *tmp; - if (aicon->command && aicon->wm_class) { + /* Show balloon if it is the Clip and the workspace name is > 5 chars */ + if (object->parent == scr->clip_icon) { + if (strlen(scr->workspaces[scr->current_workspace]->name) > 5) { + scr->balloon->text = wstrdup(scr->workspaces[scr->current_workspace]->name); + } else { + wBalloonHide(scr); + return; + } + } else if (aicon->command && aicon->wm_class) { int len = strlen(aicon->command) + strlen(aicon->wm_class) + 8; tmp = wmalloc(len); snprintf(tmp, len, "%s\n(%s)", aicon->wm_class, aicon->command); @@ -510,24 +518,19 @@ void wBalloonEnteredObject(WScreen * scr, WObjDescriptor * object) balloon->ignoreTimer = 0; return; } + switch (object->parent_type) { case WCLASS_FRAME: - if (wPreferences.window_balloon) { + if (wPreferences.window_balloon) frameBalloon(object); - } break; - case WCLASS_DOCK_ICON: - if (object->parent != scr->clip_icon && wPreferences.appicon_balloon) + if (wPreferences.appicon_balloon) appiconBalloon(object); - else - wBalloonHide(scr); break; - case WCLASS_MINIWINDOW: - if (wPreferences.miniwin_balloon) { + if (wPreferences.miniwin_balloon) miniwindowBalloon(object); - } break; case WCLASS_APPICON: if (wPreferences.appicon_balloon) -- 2.11.4.GIT