Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > a9f70cb64a7bf3036336edea5d8bb72b > files > 3

xfwm-4.4.1-9mdv2008.0.src.rpm

diff -Naur xfwm4-4.4.1/src/client.c xfwm4-4.4.1.tpg/src/client.c
--- xfwm4-4.4.1/src/client.c	2007-04-02 19:48:20.000000000 +0000
+++ xfwm4-4.4.1.tpg/src/client.c	2007-09-22 17:35:04.000000000 +0000
@@ -2376,7 +2376,7 @@
 }
 
 static void
-clientShowSingle (Client * c, gboolean change_state)
+clientShowSingle (Client * c, gboolean deiconify)
 {
     ScreenInfo *screen_info;
     DisplayInfo *display_info;
@@ -2398,7 +2398,7 @@
         /* Adjust to urgency state as the window is visible */
         clientUpdateUrgency (c);
     }
-    if (change_state)
+    if (deiconify)
     {
         FLAG_UNSET (c->flags, CLIENT_FLAG_ICONIFIED);
         setWMState (display_info, c->window, NormalState);
@@ -2407,16 +2407,14 @@
 }
 
 void
-clientShow (Client * c, gboolean change_state)
+clientShow (Client * c, gboolean deiconify)
 {
     Client *c2;
     GList *list_of_windows;
     GList *index;
 
     g_return_if_fail (c != NULL);
-    TRACE ("entering clientShow \"%s\" (0x%lx) [with %s]",
-           c->name, c->window,
-           change_state ? "state change" : "no state change");
+    TRACE ("entering clientShow \"%s\" (0x%lx)", c->name, c->window);
 
     list_of_windows = clientListTransientOrModal (c);
     for (index = g_list_last (list_of_windows); index; index = g_list_previous (index))
@@ -2428,7 +2426,7 @@
         {
             continue;
         }
-        clientShowSingle (c2, change_state);
+        clientShowSingle (c2, deiconify);
     }
     g_list_free (list_of_windows);
 
@@ -2437,7 +2435,7 @@
 }
 
 static void
-clientHideSingle (Client * c, gboolean change_state)
+clientHideSingle (Client * c, gboolean iconify)
 {
     ScreenInfo *screen_info;
     DisplayInfo *display_info;
@@ -2458,7 +2456,7 @@
     }
     XUnmapWindow (display_info->dpy, c->window);
     XUnmapWindow (display_info->dpy, c->frame);
-    if (change_state)
+    if (iconify)
     {
         FLAG_SET (c->flags, CLIENT_FLAG_ICONIFIED);
         setWMState (display_info, c->window, IconicState);
@@ -2467,14 +2465,14 @@
 }
 
 void
-clientHide (Client * c, int ws, gboolean change_state)
+clientHide (Client * c, int ws, gboolean iconify)
 {
     Client *c2;
     GList *list_of_windows;
     GList *index;
 
     g_return_if_fail (c != NULL);
-    TRACE ("entering clientHide");
+    TRACE ("entering clientHide \"%s\" (0x%lx)", c->name, c->window);
 
     list_of_windows = clientListTransientOrModal (c);
     for (index = list_of_windows; index; index = g_list_next (index))
@@ -2500,7 +2498,12 @@
              */
             continue;
         }
-        clientHideSingle (c2, change_state);
+
+        if (FLAG_TEST (c2->flags, CLIENT_FLAG_STICKY) && !iconify)
+        {
+            continue;
+        }
+        clientHideSingle (c2, iconify);
     }
     g_list_free (list_of_windows);
 
diff -Naur xfwm4-4.4.1/src/netwm.c xfwm4-4.4.1.tpg/src/netwm.c
--- xfwm4-4.4.1/src/netwm.c	2007-04-06 19:34:11.000000000 +0000
+++ xfwm4-4.4.1.tpg/src/netwm.c	2007-09-22 17:35:04.000000000 +0000
@@ -844,53 +844,56 @@
     display_info = screen_info->display_info;
     val = 0;
 
-    /* This is to make sure that transient are shown with their "ancestor" window */
-    c2 = clientGetTransient (c);
-    if (c2)
+    if (!FLAG_TEST (c->xfwm_flags, XFWM_FLAG_SESSION_MANAGED)
+        &&  !FLAG_TEST (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET))
     {
         FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
-        c->win_workspace = c2->win_workspace;
-        if (FLAG_TEST (c2->flags, CLIENT_FLAG_STICKY))
-        {
-            FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
-            c->win_state |= WIN_STATE_STICKY;
-        }
+        c->win_workspace = c->screen_info->current_ws;
     }
-    else
+    if (getHint (display_info, c->window, NET_WM_DESKTOP, &val))
     {
-        if (!FLAG_TEST (c->xfwm_flags, XFWM_FLAG_SESSION_MANAGED)
-            &&  !FLAG_TEST (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET))
+        TRACE ("atom net_wm_desktop detected");
+        if (val == (int) ALL_WORKSPACES)
         {
-            FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
-            c->win_workspace = c->screen_info->current_ws;
-        }
-        if (getHint (display_info, c->window, NET_WM_DESKTOP, &val))
-        {
-            TRACE ("atom net_wm_desktop detected");
-            if (val == (int) ALL_WORKSPACES)
+            if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_STICK) && !FLAG_TEST (c->flags, CLIENT_FLAG_STICKY))
             {
-                if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_STICK) && !FLAG_TEST (c->flags, CLIENT_FLAG_STICKY))
-                {
-                    TRACE ("atom net_wm_desktop specifies window \"%s\" is sticky", c->name);
-                    FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
-                    c->win_state |= WIN_STATE_STICKY;
-                }
-                c->win_workspace = c->screen_info->current_ws;
+                TRACE ("atom net_wm_desktop specifies window \"%s\" is sticky", c->name);
+                FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
+                c->win_state |= WIN_STATE_STICKY;
             }
-            else
-            {
-                TRACE ("atom net_wm_desktop specifies window \"%s\" is on desk %i", c->name, (int) val);
-                c->win_workspace = (int) val;
-            }
-            FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
+            c->win_workspace = c->screen_info->current_ws;
         }
-        else if (getHint (display_info, c->window, WIN_WORKSPACE, &val))
+        else
         {
-            TRACE ("atom win_workspace specifies window \"%s\" is on desk %i", c->name, (int) val);
+            TRACE ("atom net_wm_desktop specifies window \"%s\" is on desk %i", c->name, (int) val);
             c->win_workspace = (int) val;
+        }
+        FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
+    }
+    else if (getHint (display_info, c->window, WIN_WORKSPACE, &val))
+    {
+        TRACE ("atom win_workspace specifies window \"%s\" is on desk %i", c->name, (int) val);
+        c->win_workspace = (int) val;
+        FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
+    }
+
+    /* This is to make sure that transient are shown with their "ancestor" window */
+    if (!FLAG_TEST (c->flags, CLIENT_FLAG_STICKY))
+    {
+        c2 = clientGetTransient (c);
+        if (c2)
+        {
             FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
+            c->win_workspace = c2->win_workspace;
+            if (FLAG_TEST (c2->flags, CLIENT_FLAG_STICKY))
+            {
+                FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
+                c->win_state |= WIN_STATE_STICKY;
+                c->win_workspace = c->screen_info->current_ws;
+            }
         }
     }
+
     TRACE ("initial desktop for window \"%s\" is %i", c->name, c->win_workspace);
     if (c->win_workspace > c->screen_info->workspace_count - 1)
     {
@@ -1259,8 +1262,7 @@
             c->initial_layer = c2->win_layer;
             TRACE ("Applied layer is %i", c->initial_layer);
         }
-        FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_HAS_HIDE | XFWM_FLAG_HAS_STICK);
-        FLAG_UNSET (c->flags, CLIENT_FLAG_STICKY);
+        FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_HAS_HIDE);
     }
     if ((old_type != c->type) || (c->initial_layer != c->win_layer))
     {