From dd6a54bba5a301284f5ffca7b14f84ab9ae51711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Fri, 1 Jun 2012 13:55:11 +0200 Subject: [PATCH] Check one time if no_appicon is set This patch checks if the no_appicon flag is set, then, the icon is not created, therefore cannot be painted neither saved. Some comments added to clarify the code. --- src/application.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/application.c b/src/application.c index 6508e091..4f9e6f66 100644 --- a/src/application.c +++ b/src/application.c @@ -316,17 +316,20 @@ WApplication *wApplicationCreate(WWindow * wwin) /* application descriptor */ XSaveContext(dpy, main_window, wAppWinContext, (XPointer) wapp); + /* Create the application icon */ wapp->app_icon = NULL; - - /* Create the application icon using the icon from docks */ - if (!WFLAGP(wapp->main_window_desc, no_appicon)) + if (!WFLAGP(wapp->main_window_desc, no_appicon)) { + /* Create the application icon using the icon from docks + * If not found in docks, create a new icon + * using the function wAppIconCreate() */ app_icon_create_from_docks(wwin, wapp, main_window); - /* Now, paint the icon */ - paint_app_icon(wapp); + /* Now, paint the icon */ + paint_app_icon(wapp); - /* Save the app_icon in a file */ - save_app_icon(wwin, wapp); + /* Save the app_icon in a file */ + save_app_icon(wwin, wapp); + } return wapp; }