From: Rodolfo García Peñas (kix) Date: Wed, 14 Nov 2012 23:59:34 +0000 (+0100) Subject: applySettings icon set updated X-Git-Tag: wmaker-0.95.4~20 X-Git-Url: https://repo.or.cz/w/wmaker-crm.git/commitdiff_plain/2165faec5d368f66d6172c34c75e43b71aa3db6a applySettings icon set updated The function applySettings() set now the icons. Updated icons are: - Appicon: Always, with or without always_user_icon - Window: If the window is minimized, with or without always_user_icon. Window must be minimized to see the icon change, else, wwin->icon doesn't exist and therefore you won't see this change (no icon). There is a problem if the window is not minimized and is minimezed, because it will show the icon in the database, not the assigned icon. This problem must be updated not here, in the wIconifyWindow() function, at actions.c --- diff --git a/src/winspector.c b/src/winspector.c index 25e13b28..d3f49d03 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -778,20 +778,32 @@ static void applySettings(WMButton *button, InspectorPanel *panel) else paint_app_icon(wapp); - if (wapp->app_icon && wapp->main_window == wwin->client_win) { - char *file = WMGetTextFieldText(panel->fileText); + char *file = WMGetTextFieldText(panel->fileText); + if (file[0] == 0) { + wfree(file); + file = NULL; + } - if (file[0] == 0) { - wfree(file); - file = NULL; - } + if (WFLAGP(wwin, always_user_icon)) { + /* Change icon image if the app is minimized */ + if (wwin->icon) + wIconChangeImageFile(wwin->icon, file); - wIconChangeImageFile(wapp->app_icon->icon, file); - if (file) - wfree(file); + /* Change App Icon image */ + if (wapp->app_icon) + wIconChangeImageFile(wapp->app_icon->icon, file); + } else { + /* Change App Icon image */ + if (wapp->app_icon) + wIconUpdate(wapp->app_icon->icon, get_rimage_icon_from_wm_hints(wapp->app_icon->icon)); - wAppIconPaint(wapp->app_icon); + /* Change icon image if the app is minimized */ + if (wwin->icon) + wIconUpdate(wwin->icon, get_rimage_icon_from_wm_hints(wwin->icon)); } + + if (file) + wfree(file); } wNETFrameExtents(wwin);