Update docked icon after kill dockapp
commitd7fe9a5bcd9e4f1946692f5c9c9fd4de0fac5a31
authorRodolfo García Peñas (kix) <kix@kix.es>
Tue, 22 Jan 2013 20:18:13 +0000 (22 21:18 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Tue, 22 Jan 2013 21:46:39 +0000 (22 21:46 +0000)
tree0583982bce8a29d5d6819afa806ebe0e71d0f75d
parent74aa65abebd6f35480f92f6d6d6d43a574975f18
Update docked icon after kill dockapp

This patch sets the correct icon after kill a docked application.
To reproduce the problem (as Carlos reported to me), follow these
steps:

1. With a docked application, not running, set the icon image.
2. Launch the docked application.
3. Kill the application, using for example the app dock menu.

The icon is lost. But if wmaker is restarted, the icon backs again.

The problem is because when the application is closed, the function
removeAppIconFor() calls wIconUpdate(), but this function doesn't
find the icon in the file system again. The icon is loaded from the
filesystem only when the application is created.

This patch creates the icon image again, then calls wIconUpdate() to
set the icon image or the default icon image if the icon image was
not found, then wPaint it.

These lines comes from the create_appicon_from_* functions, used
to set the icon image for docks and applications. Are copy/pasted.
src/appicon.c