From: "Rodolfo García Peñas (kix)" <[email protected]>
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.
---
src/appicon.c | 2 +-
src/icon.c | 29 ++++++++++-------------------
src/icon.h | 1 -
3 files changed, 11 insertions(+), 21 deletions(-)
diff --git a/src/appicon.c b/src/appicon.c
index 4426e7c..133aabc 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 c987565..ba059ad 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 48cf58b..dfa30bc 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 */
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].