From a4a6e65ca912fac7893809a9caa7f8944bb2b5f8 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Mon, 29 Dec 2025 09:32:31 -0500 Subject: [PATCH] Fix for ignore client supplied icon attributes As mentioned on the WMaker user mailing list some time ago https://groups.google.com/g/wmaker-user/c/95M_pb_Qlbs/m/6qJLJSqoAwAJ The Ignore client supplied icon from the windows attributes is not working. That's especially visible with firefox and thunderbird when they are using NET_WM_ICON to push the embedded icon. That patch is making sure to ignore the embedded icon if the user defined one. --- src/appicon.c | 15 +++++++++------ src/client.c | 17 +++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/appicon.c b/src/appicon.c index 6d6ddf22..b2f48ed6 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -1186,14 +1186,17 @@ static void create_appicon_from_dock(WWindow *wwin, WApplication *wapp, Window m wapp->app_icon->running = 1; wapp->app_icon->icon->owner = mainw; - if (mainw->wm_hints && (mainw->wm_hints->flags & IconWindowHint)) - wapp->app_icon->icon->icon_win = mainw->wm_hints->icon_window; - /* Update the icon images */ - wIconUpdate(wapp->app_icon->icon); + if (!WFLAGP(wwin, always_user_icon)) { + if (mainw->wm_hints && (mainw->wm_hints->flags & IconWindowHint)) + wapp->app_icon->icon->icon_win = mainw->wm_hints->icon_window; - /* Paint it */ - wAppIconPaint(wapp->app_icon); + /* Update the icon images */ + wIconUpdate(wapp->app_icon->icon); + + /* Paint it */ + wAppIconPaint(wapp->app_icon); + } } } diff --git a/src/client.c b/src/client.c index 68c82c52..2271f254 100644 --- a/src/client.c +++ b/src/client.c @@ -454,15 +454,16 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event) /* update icon */ if ((wwin->wm_hints->flags & IconPixmapHint) || (wwin->wm_hints->flags & IconWindowHint)) { - WApplication *wapp; + if (!WFLAGP(wwin, always_user_icon)) { + WApplication *wapp; + if (wwin->flags.miniaturized && wwin->icon) + wIconUpdate(wwin->icon); - if (wwin->flags.miniaturized && wwin->icon) - wIconUpdate(wwin->icon); - - wapp = wApplicationOf(wwin->main_window); - if (wapp && wapp->app_icon) { - wIconUpdate(wapp->app_icon->icon); - wAppIconPaint(wapp->app_icon); + wapp = wApplicationOf(wwin->main_window); + if (wapp && wapp->app_icon) { + wIconUpdate(wapp->app_icon->icon); + wAppIconPaint(wapp->app_icon); + } } }