1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 14:08:06 +01:00

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.
This commit is contained in:
Rodolfo García Peñas (kix)
2013-01-22 21:18:13 +01:00
committed by Carlos R. Mafra
parent 74aa65abeb
commit d7fe9a5bcd

View File

@@ -240,6 +240,8 @@ void paint_app_icon(WApplication *wapp)
void removeAppIconFor(WApplication *wapp)
{
char *file = NULL;
if (!wapp->app_icon)
return;
@@ -256,6 +258,14 @@ void removeAppIconFor(WApplication *wapp)
wapp->app_icon->icon->icon_win = None;
/* Update the icon images */
/* Search the icon using instance and class, without default icon */
file = get_icon_filename(wapp->app_icon->icon->core->screen_ptr, wapp->app_icon->wm_instance, wapp->app_icon->wm_class, wapp->app_icon->command, False);
if (file) {
wapp->app_icon->icon->file = wstrdup(file);
wapp->app_icon->icon->file_image = get_rimage_from_file(wapp->app_icon->icon->core->screen_ptr, wapp->app_icon->icon->file, wPreferences.icon_size);
wfree(file);
}
wIconUpdate(wapp->app_icon->icon, NULL);
/* Paint it */