Fixes missing appicons after restarting Window Maker
commitc89ec25c80446b7e6d5cbe1e677c5edffe43e6b7
authorBad Sector <badsector@runtimeterror.com>
Wed, 18 Apr 2018 01:33:53 +0000 (18 04:33 +0300)
committerCarlos R. Mafra <crmafra@gmail.com>
Wed, 18 Apr 2018 09:09:38 +0000 (18 10:09 +0100)
tree08e73b626ff41fd87f35660dad388a0474615b1a
parent569fbff07cc3956e2c05e321856213dfbf0c26d0
Fixes missing appicons after restarting Window Maker

Fixes the bug where if the icon image is accidentally set to
nothing or the image file is deleted, the appicon keeps losing
its icon (it resets to the default cube icon) when Window Maker
exits/restarts (depending on how the user cleared the icon this
may persist even after redocking the application if information
about the application window is still in the WM).  One way to
easily see this bug is to open the main window's attributes and
press the Save button (no need to do anything else) as this
clears the icon file (this is a separate bug that needs to be
fixed but it is more of a minor UI bug since clearing the image
should simply reset the icon to the application provided one if
the Ignore client supplied icon is not set).  Another way to
see it is to open the properties box in a docked application
that is not running and clear the image field.  After either of
these two actions are performed, restart Window Maker and see
that the icons are missing.

This patch fixes the above bug by calling save_appicon when the
appicon object is created and the application provided icon is
already available (window maker actually tries to save the icon
at an earlier stage but this is done as a side effect of
"painting" the dock icon - which also saves the icon - but this
is done too early, before ownership information is available).

Note that this bug seems to be a regression introduced from
commit 9c4b19d8aaee2f80f03853e62c753298edf12ceb (or one of the
related commits around the same time, they seem to be a bit too
aggressive in not saving icons).  This patch addresses the
concern in that commit about only saving the icon for docked
applications.
src/appicon.c