From bc0700e016c67791d3e3eab855543d849f4ce786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Mon, 18 Jun 2012 11:15:19 +0200 Subject: [PATCH] Create WAppIcon always When the application is created, the WAppIcon now is created always, but it is only painted if the flag is not set. The icon initialization to NULL can be done now at app_icon_create_from_docks because it is always called. --- src/appicon.c | 3 +++ src/application.c | 21 +++++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/appicon.c b/src/appicon.c index cccfa6b6..b46bf72c 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -975,6 +975,9 @@ void app_icon_create_from_docks(WWindow *wwin, WApplication *wapp, Window main_w { WScreen *scr = wwin->screen_ptr; + /* Create the application icon */ + wapp->app_icon = NULL; + if (scr->last_dock) wapp->app_icon = findDockIconFor(scr->last_dock, main_window); diff --git a/src/application.c b/src/application.c index be305b2e..f29e90fc 100644 --- a/src/application.c +++ b/src/application.c @@ -158,21 +158,18 @@ WApplication *wApplicationCreate(WWindow * wwin) /* application descriptor */ XSaveContext(dpy, main_window, wAppWinContext, (XPointer) wapp); - /* Create the application icon */ - wapp->app_icon = NULL; - 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); + /* 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 */ + /* Save the app_icon in a file */ + save_app_icon(wwin, wapp); + + /* Now, paint the icon */ + if (!WFLAGP(wapp->main_window_desc, no_appicon)) paint_app_icon(wapp); - /* Save the app_icon in a file */ - save_app_icon(wwin, wapp); - } - return wapp; }