From ca86f5594d3f474d1995e271622278209fc0ff06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Mon, 8 Apr 2013 19:40:49 +0200 Subject: [PATCH] New function update_icon_title The function update_icon_title() updates the icon title. The code comes from the function wIconPaint(). --- src/icon.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/icon.c b/src/icon.c index a6bba718..e9e9c89c 100644 --- a/src/icon.c +++ b/src/icon.c @@ -734,14 +734,13 @@ RImage *get_rimage_icon_from_wm_hints(WIcon *icon) return image; } -void wIconPaint(WIcon *icon) +/* This function updates in the screen the icon title */ +static void update_icon_title(WIcon *icon) { WScreen *scr = icon->core->screen_ptr; int x, l, w; char *tmp; - XClearWindow(dpy, icon->core->window); - /* draw the icon title */ if (icon->show_title && icon->icon_name != NULL) { tmp = ShrinkString(scr->icon_title_font, icon->icon_name, wPreferences.icon_size - 4); @@ -756,6 +755,16 @@ void wIconPaint(WIcon *icon) scr->icon_title_font, x, 1, tmp, l); wfree(tmp); } +} + + +void wIconPaint(WIcon *icon) +{ + WScreen *scr = icon->core->screen_ptr; + + XClearWindow(dpy, icon->core->window); + + update_icon_title(icon); if (icon->selected) XDrawRectangle(dpy, icon->core->window, scr->icon_select_gc, 0, 0,