mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
appearanceObserver doesn't create icon again
The function appearanceObserver() is now faster because it doesn't re-create the icon. Now it only draws the icon pixmap.
This commit is contained in:
committed by
Carlos R. Mafra
parent
cca2814afe
commit
fd9bb936aa
13
src/icon.c
13
src/icon.c
@@ -72,15 +72,18 @@ static void unset_icon_image(WIcon *icon);
|
|||||||
|
|
||||||
/****** Notification Observers ******/
|
/****** Notification Observers ******/
|
||||||
|
|
||||||
static void appearanceObserver(void *self, WMNotification * notif)
|
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) || (flags & WFontSettings))
|
if ((flags & WTextureSettings) || (flags & WFontSettings)) {
|
||||||
icon->force_paint = 1;
|
/* If the rimage exists, update the icon, else create it */
|
||||||
|
if (icon->file_image)
|
||||||
wIconPaint(icon);
|
update_icon_pixmap(icon);
|
||||||
|
else
|
||||||
|
wIconPaint(icon);
|
||||||
|
}
|
||||||
|
|
||||||
/* so that the appicon expose handlers will paint the appicon specific
|
/* so that the appicon expose handlers will paint the appicon specific
|
||||||
* stuff */
|
* stuff */
|
||||||
|
|||||||
Reference in New Issue
Block a user