mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 22:52:34 +01:00
icon.c code cleanup
This commit is contained in:
committed by
Carlos R. Mafra
parent
6110610f5e
commit
0e671d3683
16
src/icon.c
16
src/icon.c
@@ -69,16 +69,8 @@ static void appearanceObserver(void *self, WMNotification * notif)
|
|||||||
WIcon *icon = (WIcon *) self;
|
WIcon *icon = (WIcon *) self;
|
||||||
uintptr_t flags = (uintptr_t)WMGetNotificationClientData(notif);
|
uintptr_t flags = (uintptr_t)WMGetNotificationClientData(notif);
|
||||||
|
|
||||||
if (flags & WTextureSettings) {
|
if ((flags & WTextureSettings) || (flags & WFontSettings))
|
||||||
icon->force_paint = 1;
|
icon->force_paint = 1;
|
||||||
}
|
|
||||||
if (flags & WFontSettings) {
|
|
||||||
icon->force_paint = 1;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
if (flags & WColorSettings) {
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
wIconPaint(icon);
|
wIconPaint(icon);
|
||||||
|
|
||||||
@@ -164,9 +156,8 @@ WIcon *wIconCreateWithIconFile(WScreen * scr, char *iconfile, int tile)
|
|||||||
|
|
||||||
if (iconfile) {
|
if (iconfile) {
|
||||||
icon->file_image = RLoadImage(scr->rcontext, iconfile, 0);
|
icon->file_image = RLoadImage(scr->rcontext, iconfile, 0);
|
||||||
if (!icon->file_image) {
|
if (!icon->file_image)
|
||||||
wwarning(_("error loading image file \"%s\": %s"), iconfile, RMessageForError(RErrorCode));
|
wwarning(_("error loading image file \"%s\": %s"), iconfile, RMessageForError(RErrorCode));
|
||||||
}
|
|
||||||
|
|
||||||
icon->file_image = wIconValidateIconSize(scr, icon->file_image, wPreferences.icon_size);
|
icon->file_image = wIconValidateIconSize(scr, icon->file_image, wPreferences.icon_size);
|
||||||
|
|
||||||
@@ -638,7 +629,6 @@ void get_pixmap_icon_from_user_icon(WScreen *scr, WIcon * icon)
|
|||||||
} else {
|
} else {
|
||||||
wwarning(_("could not find default icon \"%s\""), file);
|
wwarning(_("could not find default icon \"%s\""), file);
|
||||||
}
|
}
|
||||||
/* FIXME: Probably wfree(file) here! */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
image = wIconValidateIconSize(scr, image, wPreferences.icon_size);
|
image = wIconValidateIconSize(scr, image, wPreferences.icon_size);
|
||||||
@@ -725,7 +715,7 @@ int get_pixmap_icon_from_wm_hints(WScreen *scr, WWindow *wwin, WIcon *icon)
|
|||||||
|
|
||||||
if (!XGetGeometry(dpy, wwin->wm_hints->icon_pixmap, &jw, &ji, &ji, &w, &h, &ju, &d)) {
|
if (!XGetGeometry(dpy, wwin->wm_hints->icon_pixmap, &jw, &ji, &ji, &w, &h, &ju, &d)) {
|
||||||
icon->owner->wm_hints->flags &= ~IconPixmapHint;
|
icon->owner->wm_hints->flags &= ~IconPixmapHint;
|
||||||
return(1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pixmap = XCreatePixmap(dpy, icon->core->window, wPreferences.icon_size,
|
pixmap = XCreatePixmap(dpy, icon->core->window, wPreferences.icon_size,
|
||||||
|
|||||||
Reference in New Issue
Block a user