This patch moves the code witout screen to the top, and leave the
code screen dependent below.

This code doesn't need the screen to create the icon info:

 icon = icon_create_core();
 set_icon_image_from_database(icon, wwin->wm_instance, wwin->wm_class, NULL);
 icon->tile_type = TILE_NORMAL;

Signed-off-by: Rodolfo García Peñas (kix) <[email protected]>
---
 src/icon.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index adecb48..f4d4856 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -118,6 +118,9 @@ WIcon *icon_create_for_wwindow(WWindow *wwin)
        WIcon *icon;
 
        icon = icon_create_core();
+       set_icon_image_from_database(icon, wwin->wm_instance, wwin->wm_class, 
NULL);
+       icon->tile_type = TILE_NORMAL;
+
        wcore_map_toplevel(icon->core, scr, wwin->icon_x, wwin->icon_y, 0, 
scr->w_depth,
                           scr->w_visual, scr->w_colormap, scr->white_pixel);
 
@@ -140,9 +143,7 @@ WIcon *icon_create_for_wwindow(WWindow *wwin)
 #endif
 
        wIconChangeTitle(icon, wwin);
-       icon->tile_type = TILE_NORMAL;
 
-       set_icon_image_from_database(icon, wwin->wm_instance, wwin->wm_class, 
NULL);
        icon->file_image = RDrawImage(scr->rcontext, icon->file_image);
        icon->file_image = wIconValidateIconSize(icon->file_image, 
wPreferences.icon_size);
 
@@ -160,11 +161,12 @@ WIcon *icon_create_for_dock(WScreen *scr, const char 
*command, const char *wm_in
        WIcon *icon;
 
        icon = icon_create_core();
+       set_icon_image_from_database(icon, wm_instance, wm_class, command);
+       icon->tile_type = tile;
+
        wcore_map_toplevel(icon->core, scr, 0, 0, 0, scr->w_depth,
                           scr->w_visual, scr->w_colormap, scr->white_pixel);
-       icon->tile_type = tile;
 
-       set_icon_image_from_database(icon, wm_instance, wm_class, command);
        icon->file_image = RDrawImage(scr->rcontext, icon->file_image);
        icon->file_image = wIconValidateIconSize(icon->file_image, 
wPreferences.icon_size);
 
-- 
1.8.4.rc3


-- 
To unsubscribe, send mail to [email protected].

Reply via email to