From: Rodolfo García Peñas (kix) Date: Sat, 10 Nov 2012 19:25:12 +0000 (+0100) Subject: force_paint removed X-Git-Tag: wmaker-0.95.4~50 X-Git-Url: https://repo.or.cz/w/wmaker-crm.git/commitdiff_plain/e192302bd72d88b0b1d6b236b54c14e3e97dc3ef force_paint removed The WIcon variable force_paint can be removed, because now is possible update the icon directly in the function wAppIconPaint. Now wAppIconPaint creates the RImage file if needed, and then paint it. --- diff --git a/src/appicon.c b/src/appicon.c index 4426e7c2..133aabcf 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -381,7 +381,7 @@ void wAppIconPaint(WAppIcon *aicon, Bool update_icon) wapp = NULL; if (update_icon) - aicon->icon->force_paint = 1; + wIconUpdate(aicon->icon); wIconPaint(aicon->icon); diff --git a/src/icon.c b/src/icon.c index c9875658..ba059ade 100644 --- a/src/icon.c +++ b/src/icon.c @@ -90,12 +90,11 @@ static void appearanceObserver(void *self, WMNotification *notif) XClearArea(dpy, icon->core->window, 0, 0, icon->core->width, icon->core->height, True); } -static void tileObserver(void *self, WMNotification * notif) +static void tileObserver(void *self, WMNotification *notif) { WIcon *icon = (WIcon *) self; - icon->force_paint = 1; - wIconPaint(icon); + wIconUpdate(icon); XClearArea(dpy, icon->core->window, 0, 0, 1, 1, True); } @@ -334,12 +333,12 @@ static void icon_update_pixmap(WIcon *icon, RImage *image) icon->pixmap = pixmap; } -void wIconChangeTitle(WIcon * icon, char *new_title) +void wIconChangeTitle(WIcon *icon, char *new_title) { int changed; - changed = (new_title == NULL && icon->icon_name != NULL) - || (new_title != NULL && icon->icon_name == NULL); + changed = (new_title == NULL && icon->icon_name != NULL) || + (new_title != NULL && icon->icon_name == NULL); if (icon->icon_name != NULL) XFree(icon->icon_name); @@ -347,8 +346,9 @@ void wIconChangeTitle(WIcon * icon, char *new_title) icon->icon_name = new_title; if (changed) - icon->force_paint = 1; - wIconPaint(icon); + wIconUpdate(icon); + else + wIconPaint(icon); } RImage *wIconValidateIconSize(RImage *icon, int max_size) @@ -762,25 +762,16 @@ static int get_rimage_icon_from_wm_hints(WIcon *icon) return 0; } -void wIconPaint(WIcon * icon) +void wIconPaint(WIcon *icon) { WScreen *scr = icon->core->screen_ptr; - int x; + int x, l, w; char *tmp; - if (icon->force_paint) { - icon->force_paint = 0; - wIconUpdate(icon); - return; - } - XClearWindow(dpy, icon->core->window); /* draw the icon title */ if (icon->show_title && icon->icon_name != NULL) { - int l; - int w; - tmp = ShrinkString(scr->icon_title_font, icon->icon_name, wPreferences.icon_size - 4); w = WMWidthOfString(scr->icon_title_font, tmp, l = strlen(tmp)); diff --git a/src/icon.h b/src/icon.h index 48cf58b7..dfa30bcd 100644 --- a/src/icon.h +++ b/src/icon.h @@ -41,7 +41,6 @@ typedef struct WIcon { unsigned int tile_type:4; unsigned int show_title:1; - unsigned int force_paint:1; /* True for icon update and repaint */ unsigned int selected:1; unsigned int step:3; /* selection cycle step */ unsigned int shadowed:1; /* If the icon is to be blured */