From b305eb84fb16b41658650b06ec9abc2b571b3a1c Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 28 Sep 2010 14:08:52 -0400 Subject: [PATCH] Ignore shared_appicon if an appicon already exists An appicon is created for each group of windows, as specified by the WM_HINTS window_group or the WM_CLIENT_LEADER. The "shared_appicon" feature ignores the group leader specified by the application, replacing it with a dummy leader matching the window's WM_CLASS. This causes issues for dockapps, since each instance of a dockapp needs its own appicon to display the different icon_windows, so shared_appicon is automatically disabled for dockapp windows. If the application creates some dockapp windows (no shared_appicon) and some regular windows (with shared_appicon) with the same leader, it can unexpectedly end up with two different appicons: one for the real group leader it set and one for the fake leader created for shared_appicons. Both of these appicons will try to use the same icon_window, which may cause the dockapp window to suddenly lose its contents as they are moved to the fake leader's appicon. There is a simple fix: if a WApplication already exists (and has an appicon) for the app-specified group leader window, disable shared_appicon. Signed-off-by: Brad Jorsch --- src/window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/window.c b/src/window.c index a54c0ce1..564e57b1 100644 --- a/src/window.c +++ b/src/window.c @@ -770,6 +770,12 @@ WWindow *wManageWindow(WScreen *scr, Window window) if (wwin->flags.is_dockapp) WSETUFLAG(wwin, shared_appicon, 0); + if (wwin->main_window) { + WApplication *app = wApplicationOf(wwin->main_window); + if (app && app->app_icon) + WSETUFLAG(wwin, shared_appicon, 0); + } + if (!withdraw && wwin->main_window && WFLAGP(wwin, shared_appicon)) { char *buffer, *instance, *class; WFakeGroupLeader *fPtr;