From 4bce0e64c6e7909a80a59ef199c6adea13d0d281 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Mon, 6 Jul 2026 21:52:38 +0200 Subject: [PATCH] wmaker: prefer per-window _NET_WM_ICON in the switch panel addIconForWindow() tried the shared application icon before the per-window net_icon_image, so every window under one group leader showed whatever the appicon had derived for the leader and a secondary window's own _NET_WM_ICON never appeared in Alt-Tab. Swap the order so a window that supplies its own icon shows it, falling back to the appicon only when the window has none, which keeps the original intent of preferring the appicon over the generic default for clients that set nothing. --- src/switchpanel.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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);