diff --git a/src/appicon.c b/src/appicon.c index 6cc2bca2..6827c2f4 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -955,8 +955,6 @@ static WAppIcon *findDockIconFor(WDock *dock, Window main_window) void create_appicon_from_dock(WWindow *wwin, WApplication *wapp, Window main_window) { WScreen *scr = wwin->screen_ptr; - - /* Create the application icon */ wapp->app_icon = NULL; if (scr->last_dock) @@ -990,7 +988,5 @@ void create_appicon_from_dock(WWindow *wwin, WApplication *wapp, Window main_win wAppIconPaint(wapp->app_icon); wAppIconSave(wapp->app_icon); - } else { - makeAppIconFor(wapp); } } diff --git a/src/application.c b/src/application.c index f0122f0c..f08f435d 100644 --- a/src/application.c +++ b/src/application.c @@ -132,22 +132,24 @@ WApplication *wApplicationCreate(WWindow * wwin) #ifdef USER_MENU if (!wapp->menu) wapp->menu = wUserMenuGet(scr, wapp->main_window_desc); -#endif /* USER_MENU */ +#endif - /* - * Set application wide attributes from the leader. - */ + /* Set application wide attributes from the leader */ wapp->flags.hidden = WFLAGP(wapp->main_window_desc, start_hidden); wapp->flags.emulated = WFLAGP(wapp->main_window_desc, emulate_appicon); /* application descriptor */ XSaveContext(dpy, main_window, wAppWinContext, (XPointer) wapp); - /* Create the application icon using the icon from docks - * If not found in docks, create a new icon - * using the function wAppIconCreate() */ + /* First try to create an icon from the dock or clip */ create_appicon_from_dock(wwin, wapp, main_window); + /* + * In case it was not found in the dock, make it from scratch. + * Note: makeAppIconFor() returns early if wapp->app_icon exists + */ + makeAppIconFor(wapp); + /* Save the app_icon in a file */ save_app_icon(wapp);