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 <[email protected]>
---
 src/window.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/window.c b/src/window.c
index a54c0ce..564e57b 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;
-- 
1.7.1


-- 
To unsubscribe, send mail to [email protected].

Reply via email to