diff --git a/src/appicon.c b/src/appicon.c index 322ee619..117fddb4 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -154,7 +154,7 @@ void create_appicon_for_application(WApplication *wapp, WWindow *wwin) if (!wapp->app_icon) { /* Create the icon */ wapp->app_icon = wAppIconCreate(wapp->main_window_desc); - wIconUpdate(wapp->app_icon->icon, NULL); + wIconUpdate(wapp->app_icon->icon); /* Now, paint the icon */ if (!WFLAGP(wapp->main_window_desc, no_appicon)) @@ -999,7 +999,7 @@ static void create_appicon_from_dock(WWindow *wwin, WApplication *wapp, Window m wapp->app_icon->icon->icon_win = mainw->wm_hints->icon_window; /* Update the icon images */ - wIconUpdate(wapp->app_icon->icon, NULL); + wIconUpdate(wapp->app_icon->icon); /* Paint it */ wAppIconPaint(wapp->app_icon); diff --git a/src/client.c b/src/client.c index ab87ecbb..9e7eb6af 100644 --- a/src/client.c +++ b/src/client.c @@ -472,12 +472,12 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event) || (wwin->wm_hints->flags & IconWindowHint)) { WApplication *wapp; - if (wwin->flags.miniaturized && wwin->icon) { - wIconUpdate(wwin->icon, NULL); - } + if (wwin->flags.miniaturized && wwin->icon) + wIconUpdate(wwin->icon); + wapp = wApplicationOf(wwin->main_window); if (wapp && wapp->app_icon) { - wIconUpdate(wapp->app_icon->icon, NULL); + wIconUpdate(wapp->app_icon->icon); wAppIconPaint(wapp->app_icon); } } diff --git a/src/dock.c b/src/dock.c index 0140bd19..7b5d08d8 100644 --- a/src/dock.c +++ b/src/dock.c @@ -542,7 +542,7 @@ static void keepIconsCallback(WMenu *menu, WMenuEntry *entry) aicon->icon->shadowed = 0; /* Update the icon images */ - wIconUpdate(aicon->icon, NULL); + wIconUpdate(aicon->icon); /* Paint it */ wAppIconPaint(aicon); @@ -1942,7 +1942,7 @@ Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y, Bool update_icon /* Update the icon images */ if (lupdate_icon) - wIconUpdate(icon->icon, NULL); + wIconUpdate(icon->icon); /* Paint it */ wAppIconPaint(icon); @@ -2096,7 +2096,7 @@ static Bool moveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int x, /* Update the icon images */ if (update_icon) - wIconUpdate(icon->icon, NULL); + wIconUpdate(icon->icon); /* Paint it */ wAppIconPaint(icon); @@ -2173,7 +2173,7 @@ void wDockDetach(WDock *dock, WAppIcon *icon) /* Update the icon images */ if (update_icon) - wIconUpdate(icon->icon, NULL); + wIconUpdate(icon->icon); /* Paint it */ wAppIconPaint(icon); diff --git a/src/icon.c b/src/icon.c index a2cb8356..32d3fd53 100644 --- a/src/icon.c +++ b/src/icon.c @@ -93,7 +93,7 @@ static void tileObserver(void *self, WMNotification *notif) { WIcon *icon = (WIcon *) self; - wIconUpdate(icon, NULL); + wIconUpdate(icon); XClearArea(dpy, icon->core->window, 0, 0, 1, 1, True); } @@ -314,7 +314,7 @@ void wIconChangeTitle(WIcon *icon, char *new_title) icon->icon_name = new_title; if (changed) - wIconUpdate(icon, NULL); + wIconUpdate(icon); else wIconPaint(icon); } @@ -573,35 +573,31 @@ void set_icon_image_from_image(WIcon *icon, RImage *image) icon->file_image = image; } -void wIconUpdate(WIcon *icon, RImage *image) +void wIconUpdate(WIcon *icon) { WWindow *wwin = NULL; - if (image) { - icon->file_image = image; - } else { - if (icon && icon->owner) - wwin = icon->owner; + if (icon && icon->owner) + wwin = icon->owner; - if (wwin && WFLAGP(wwin, always_user_icon)) { - /* Forced use user_icon */ + if (wwin && WFLAGP(wwin, always_user_icon)) { + /* Forced use user_icon */ + get_rimage_icon_from_user_icon(icon); + } else if (icon->icon_win != None) { + /* Get the Pixmap from the WIcon */ + get_rimage_icon_from_icon_win(icon); + } else if (wwin && wwin->net_icon_image) { + /* Use _NET_WM_ICON icon */ + get_rimage_icon_from_x11(icon); + } else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags & IconPixmapHint)) { + /* Get the Pixmap from the wm_hints, else, from the user */ + unset_icon_image(icon); + icon->file_image = get_rimage_icon_from_wm_hints(icon); + if (!icon->file_image) get_rimage_icon_from_user_icon(icon); - } else if (icon->icon_win != None) { - /* Get the Pixmap from the WIcon */ - get_rimage_icon_from_icon_win(icon); - } else if (wwin && wwin->net_icon_image) { - /* Use _NET_WM_ICON icon */ - get_rimage_icon_from_x11(icon); - } else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags & IconPixmapHint)) { - /* Get the Pixmap from the wm_hints, else, from the user */ - unset_icon_image(icon); - icon->file_image = get_rimage_icon_from_wm_hints(icon); - if (!icon->file_image) - get_rimage_icon_from_user_icon(icon); - } else { - /* Get the Pixmap from the user */ - get_rimage_icon_from_user_icon(icon); - } + } else { + /* Get the Pixmap from the user */ + get_rimage_icon_from_user_icon(icon); } update_icon_pixmap(icon); @@ -897,5 +893,5 @@ void set_icon_image_from_database(WIcon *icon, char *wm_instance, char *wm_class wfree(file); } - wIconUpdate(icon, NULL); + wIconUpdate(icon); } diff --git a/src/icon.h b/src/icon.h index 93b81458..22e81f30 100644 --- a/src/icon.h +++ b/src/icon.h @@ -59,7 +59,7 @@ WIcon *icon_create_for_wwindow(WWindow *wwin); void set_icon_image_from_database(WIcon *icon, char *wm_instance, char *wm_class, char *command); void wIconDestroy(WIcon *icon); void wIconPaint(WIcon *icon); -void wIconUpdate(WIcon *icon, RImage *image); +void wIconUpdate(WIcon *icon); void wIconSelect(WIcon *icon); void wIconChangeTitle(WIcon *icon, char *new_title); void update_icon_pixmap(WIcon *icon); diff --git a/src/winspector.c b/src/winspector.c index acd20577..08066da0 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -769,7 +769,7 @@ static void applySettings(WMButton *button, InspectorPanel *panel) set_icon_image_from_image(wapp->app_icon->icon, image); update_icon_pixmap(wapp->app_icon->icon); } else { - wIconUpdate(wapp->app_icon->icon, NULL); + wIconUpdate(wapp->app_icon->icon); } } @@ -781,7 +781,7 @@ static void applySettings(WMButton *button, InspectorPanel *panel) set_icon_image_from_image(wwin->icon, image); update_icon_pixmap(wwin->icon); } else { - wIconUpdate(wwin->icon, NULL); + wIconUpdate(wwin->icon); } } } else { diff --git a/src/wmspec.c b/src/wmspec.c index 515b66ca..c894fab3 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -468,12 +468,12 @@ static void updateIconImage(WWindow *wwin) /* Refresh the Window Icon */ if (wwin->icon) - wIconUpdate(wwin->icon, NULL); + wIconUpdate(wwin->icon); /* Refresh the application icon */ WApplication *app = wApplicationOf(wwin->main_window); if (app && app->app_icon) { - wIconUpdate(app->app_icon->icon, NULL); + wIconUpdate(app->app_icon->icon); wAppIconPaint(app->app_icon); } }