1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 21:08:08 +01:00

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.
This commit is contained in:
Rodolfo García Peñas (kix)
2012-11-10 20:25:12 +01:00
committed by Carlos R. Mafra
parent 33ebded4f9
commit e192302bd7
3 changed files with 11 additions and 21 deletions

View File

@@ -381,7 +381,7 @@ void wAppIconPaint(WAppIcon *aicon, Bool update_icon)
wapp = NULL; wapp = NULL;
if (update_icon) if (update_icon)
aicon->icon->force_paint = 1; wIconUpdate(aicon->icon);
wIconPaint(aicon->icon); wIconPaint(aicon->icon);

View File

@@ -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); 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; WIcon *icon = (WIcon *) self;
icon->force_paint = 1; wIconUpdate(icon);
wIconPaint(icon);
XClearArea(dpy, icon->core->window, 0, 0, 1, 1, True); 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; icon->pixmap = pixmap;
} }
void wIconChangeTitle(WIcon * icon, char *new_title) void wIconChangeTitle(WIcon *icon, char *new_title)
{ {
int changed; int changed;
changed = (new_title == NULL && icon->icon_name != NULL) changed = (new_title == NULL && icon->icon_name != NULL) ||
|| (new_title != NULL && icon->icon_name == NULL); (new_title != NULL && icon->icon_name == NULL);
if (icon->icon_name != NULL) if (icon->icon_name != NULL)
XFree(icon->icon_name); XFree(icon->icon_name);
@@ -347,7 +346,8 @@ void wIconChangeTitle(WIcon * icon, char *new_title)
icon->icon_name = new_title; icon->icon_name = new_title;
if (changed) if (changed)
icon->force_paint = 1; wIconUpdate(icon);
else
wIconPaint(icon); wIconPaint(icon);
} }
@@ -762,25 +762,16 @@ static int get_rimage_icon_from_wm_hints(WIcon *icon)
return 0; return 0;
} }
void wIconPaint(WIcon * icon) void wIconPaint(WIcon *icon)
{ {
WScreen *scr = icon->core->screen_ptr; WScreen *scr = icon->core->screen_ptr;
int x; int x, l, w;
char *tmp; char *tmp;
if (icon->force_paint) {
icon->force_paint = 0;
wIconUpdate(icon);
return;
}
XClearWindow(dpy, icon->core->window); XClearWindow(dpy, icon->core->window);
/* draw the icon title */ /* draw the icon title */
if (icon->show_title && icon->icon_name != NULL) { 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); tmp = ShrinkString(scr->icon_title_font, icon->icon_name, wPreferences.icon_size - 4);
w = WMWidthOfString(scr->icon_title_font, tmp, l = strlen(tmp)); w = WMWidthOfString(scr->icon_title_font, tmp, l = strlen(tmp));

View File

@@ -41,7 +41,6 @@ typedef struct WIcon {
unsigned int tile_type:4; unsigned int tile_type:4;
unsigned int show_title:1; unsigned int show_title:1;
unsigned int force_paint:1; /* True for icon update and repaint */
unsigned int selected:1; unsigned int selected:1;
unsigned int step:3; /* selection cycle step */ unsigned int step:3; /* selection cycle step */
unsigned int shadowed:1; /* If the icon is to be blured */ unsigned int shadowed:1; /* If the icon is to be blured */