1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 21:38:00 +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

@@ -364,7 +364,6 @@ WApplication *wApplicationCreate(WWindow * wwin)
if (wapp->app_icon) {
char *tmp, *path;
struct stat dummy;
RImage *image;
tmp = wDefaultGetIconFile(scr, wapp->app_icon->wm_instance, wapp->app_icon->wm_class, True);
@@ -377,16 +376,8 @@ WApplication *wApplicationCreate(WWindow * wwin)
if (path) {
wfree(path);
}
image = wDefaultGetImage(scr, wapp->app_icon->wm_instance, wapp->app_icon->wm_class);
if (image) {
wIconChangeImage(wapp->app_icon->icon, image);
wAppIconPaint(wapp->app_icon);
/* TODO:
* wIconChangeImage() should be rewriten to use retain/release
* The way it is now is too confusing about where the icon is
* finally released. -Dan */
/* --this is wrong at the moment-- RReleaseImage(image); */
}
wIconUpdate(wapp->app_icon->icon);
wAppIconPaint(wapp->app_icon);
}
/* if the displayed icon was supplied by the client, save the icon */