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 <anomie@users.sourceforge.net>