mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 12:58:08 +01:00
Avoid icon change to default on winspector save
For a icon, the icon image is stored in icon->file_image. If we repaint the image, we we don't need search the icon again. We can continue using icon->file_image. Indeed, if launch the "window inspector" window (winspector), using a saved icon and "ignore client icon" set, then the database holds the name of the icon to draw on the screen. If we remove the icon info in the winspector (removing the file name or un-setting the "ignore client icon" flag, then the database losts the icon name and then the function wDefaultUpdateIcons() cannot find the icon to draw for the icon. In winspector, with this patch, the previous image set by "ApplySettings" and stored at icon->file_image is used.
This commit is contained in:
committed by
Carlos R. Mafra
parent
c164db31bf
commit
0a461416e3
@@ -1125,16 +1125,11 @@ void wDefaultUpdateIcons(WScreen *scr)
|
||||
{
|
||||
WAppIcon *aicon = scr->app_icon_list;
|
||||
WWindow *wwin = scr->focused_window;
|
||||
char *file;
|
||||
|
||||
while (aicon) {
|
||||
/* Get the application icon, default included */
|
||||
file = wDefaultGetIconFile(aicon->wm_instance, aicon->wm_class, True);
|
||||
if ((file && aicon->icon->file && strcmp(file, aicon->icon->file) != 0)
|
||||
|| (file && !aicon->icon->file)) {
|
||||
wIconChangeImageFile(aicon->icon, file);
|
||||
wAppIconPaint(aicon);
|
||||
}
|
||||
wIconChangeImageFile(aicon->icon, NULL);
|
||||
wAppIconPaint(aicon);
|
||||
aicon = aicon->next;
|
||||
}
|
||||
|
||||
@@ -1142,13 +1137,8 @@ void wDefaultUpdateIcons(WScreen *scr)
|
||||
wClipIconPaint(scr->clip_icon);
|
||||
|
||||
while (wwin) {
|
||||
if (wwin->icon && wwin->flags.miniaturized) {
|
||||
/* Get the application icon, default included */
|
||||
file = wDefaultGetIconFile(wwin->wm_instance, wwin->wm_class, True);
|
||||
if ((file && wwin->icon->file && strcmp(file, wwin->icon->file) != 0)
|
||||
|| (file && !wwin->icon->file))
|
||||
wIconChangeImageFile(wwin->icon, file);
|
||||
}
|
||||
if (wwin->icon && wwin->flags.miniaturized)
|
||||
wIconChangeImageFile(wwin->icon, NULL);
|
||||
wwin = wwin->prev;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user