mirror of
https://github.com/gryf/wmaker.git
synced 2026-08-20 18:11:48 +02:00
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.
This commit is contained in:
committed by
Carlos R. Mafra
parent
774e696270
commit
4bce0e64c6
+10
-4
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user