diff --git a/src/switchpanel.c b/src/switchpanel.c index af6de524..297ce8df 100644 --- a/src/switchpanel.c +++ b/src/switchpanel.c @@ -192,14 +192,20 @@ static void addIconForWindow(WSwitchPanel *panel, WMWidget *parent, WWindow *wwi WMResizeWidget(icon, icon_tile_size, icon_tile_size); WMMoveWidget(icon, x, y); + /* Prefer the per-window _NET_WM_ICON so windows that share a + * group leader but ship distinct icons (a browser and its addon + * windows for instance) each show their own image, then fall + * back to the shared application icon so a client with no + * _NET_WM_ICON still picks up whatever the appicon derived from + * WM_HINTS or the user icon database. */ + if (!WFLAGP(wwin, always_user_icon) && wwin->net_icon_image) + image = RRetainImage(wwin->net_icon_image); + wapp = wApplicationOf(wwin->main_window); - if (!WFLAGP(wwin, always_user_icon) && wapp && wapp->app_icon && + if (!image && !WFLAGP(wwin, always_user_icon) && wapp && wapp->app_icon && wapp->app_icon->icon && wapp->app_icon->icon->file_image) image = RRetainImage(wapp->app_icon->icon->file_image); - if (!image && !WFLAGP(wwin, always_user_icon) && wwin->net_icon_image) - image = RRetainImage(wwin->net_icon_image); - /* get_icon_image() includes the default icon image */ if (!image) image = get_icon_image(panel->scr, wwin->wm_instance, wwin->wm_class, icon_tile_size);