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

Fix wIconUpdate logic

This patch changes the logic for choosing the icon, and gets rid of
wIconChangeImage in favor of wIconChangeImageFile.

Old logic:
* On create, load either NET_WM_ICON or the file from disk.
* On update, choose (in order):
  1. WM_HINTS icon_window
  2. WM_HINTS icon_pixmap
  3. Whatever was loaded on creation, unless wIconChangeImage or
	 wIconChangeImageFile was called.
  4. Default icon.

New logic:
* On update, choose (in order):
  1. WM_HINTS icon_window
  2. NET_WM_ICON
  3. WM_HINTS icon_pixmap
  4. Icon file from disk.
  5. Default icon.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
This commit is contained in:
Brad Jorsch
2010-10-08 15:08:32 -04:00
committed by Carlos R. Mafra
parent 7aff3b6e44
commit ee1f13da45
4 changed files with 37 additions and 69 deletions

View File

@@ -1139,17 +1139,8 @@ void wDefaultUpdateIcons(WScreen * scr)
file = wDefaultGetIconFile(scr, aicon->wm_instance, aicon->wm_class, False);
if ((file && aicon->icon->file && strcmp(file, aicon->icon->file) != 0)
|| (file && !aicon->icon->file)) {
RImage *new_image;
if (aicon->icon->file)
wfree(aicon->icon->file);
aicon->icon->file = wstrdup(file);
new_image = wDefaultGetImage(scr, aicon->wm_instance, aicon->wm_class);
if (new_image) {
wIconChangeImage(aicon->icon, new_image);
wAppIconPaint(aicon);
}
wIconChangeImageFile(aicon->icon, file);
wAppIconPaint(aicon);
}
aicon = aicon->next;
}
@@ -1162,15 +1153,7 @@ void wDefaultUpdateIcons(WScreen * scr)
file = wDefaultGetIconFile(scr, wwin->wm_instance, wwin->wm_class, False);
if ((file && wwin->icon->file && strcmp(file, wwin->icon->file) != 0)
|| (file && !wwin->icon->file)) {
RImage *new_image;
if (wwin->icon->file)
wfree(wwin->icon->file);
wwin->icon->file = wstrdup(file);
new_image = wDefaultGetImage(scr, wwin->wm_instance, wwin->wm_class);
if (new_image)
wIconChangeImage(wwin->icon, new_image);
wIconChangeImageFile(wwin->icon, file);
}
}
wwin = wwin->prev;