From: "Rodolfo García Peñas (kix)" <k...@kix.es>

This patch removes the wIconDestroy and the window always has icon.
This patch doesn't create the icon at the window creation! so yet
WWindow icon could be null.
---
 src/actions.c |    6 +-----
 src/window.c  |    8 +++++++-
 src/wmspec.c  |   16 +---------------
 3 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/src/actions.c b/src/actions.c
index a79de8a..e1e6aaa 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1318,12 +1318,8 @@ void wDeiconifyWindow(WWindow *wwin)
        }
 
        if (!wPreferences.disable_miniwindows && wwin->icon != NULL
-           && !wwin->flags.net_handle_icon) {
+           && !wwin->flags.net_handle_icon)
                RemoveFromStackList(wwin->icon->core);
-               /*    removeIconGrabs(wwin->icon); */
-               wIconDestroy(wwin->icon);
-               wwin->icon = NULL;
-       }
 
        if (!netwm_hidden) {
                XUngrabServer(dpy);
diff --git a/src/window.c b/src/window.c
index 1cb384a..da17334 100644
--- a/src/window.c
+++ b/src/window.c
@@ -235,11 +235,17 @@ void wWindowDestroy(WWindow *wwin)
                wFrameWindowDestroy(wwin->frame);
 
        if (wwin->icon) {
-               RemoveFromStackList(wwin->icon->core);
+               /* If minimized, remove it form the stacking list */
+               if (!wPreferences.disable_miniwindows &&
+                   !wwin->flags.net_handle_icon &&
+                   wwin->flags.miniaturized)
+                       RemoveFromStackList(wwin->icon->core);
+
                wIconDestroy(wwin->icon);
                if (wPreferences.auto_arrange_icons)
                        wArrangeIcons(wwin->screen_ptr, True);
        }
+
        if (wwin->net_icon_image)
                RReleaseImage(wwin->net_icon_image);
 
diff --git a/src/wmspec.c b/src/wmspec.c
index c758f0a..f8e0029 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -1053,18 +1053,6 @@ static void doStateAtom(WWindow *wwin, Atom state, int 
set, Bool init)
        }
 }
 
-static void removeIcon(WWindow *wwin)
-{
-       if (wwin->icon == NULL)
-               return;
-       if (wwin->flags.miniaturized && wwin->icon->mapped) {
-               XUnmapWindow(dpy, wwin->icon->core->window);
-               RemoveFromStackList(wwin->icon->core);
-               wIconDestroy(wwin->icon);
-               wwin->icon = NULL;
-       }
-}
-
 static Bool handleWindowType(WWindow *wwin, Atom type, int *layer)
 {
        Bool ret = True;
@@ -1282,9 +1270,7 @@ static Bool updateNetIconInfo(WWindow *wwin)
        }
 
        if (wwin->flags.miniaturized && old_state != 
wwin->flags.net_handle_icon) {
-               if (wwin->flags.net_handle_icon) {
-                       removeIcon(wwin);
-               } else {
+               if (!wwin->flags.net_handle_icon) {
                        wwin->flags.miniaturized = False;
                        wwin->flags.skip_next_animation = True;
                        wIconifyWindow(wwin);
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to