Author: olivier
Date: 2007-03-15 22:29:49 +0000 (Thu, 15 Mar 2007)
New Revision: 25175

Modified:
   xfwm4/branches/xfce_4_4/src/stacking.c
   xfwm4/branches/xfce_4_4/src/workspaces.c
Log:
Check only visible windows to see if client is on top of stack (bug #2960)

Modified: xfwm4/branches/xfce_4_4/src/stacking.c
===================================================================
--- xfwm4/branches/xfce_4_4/src/stacking.c      2007-03-15 22:28:43 UTC (rev 
25174)
+++ xfwm4/branches/xfce_4_4/src/stacking.c      2007-03-15 22:29:49 UTC (rev 
25175)
@@ -154,7 +154,8 @@
 clientIsTopMost (Client *c)
 {
     ScreenInfo *screen_info;
-    GList *index;
+    GList *index, *index2;
+    Client *c2;
 
     g_return_val_if_fail (c != NULL, FALSE);
     TRACE ("entering clientIsTopMost");
@@ -164,18 +165,18 @@
     index = g_list_find (screen_info->windows_stack, (gconstpointer) c);
     if (index)
     {
-        GList *index2 = g_list_next (index);
-        if (index2)
+        index2 = g_list_next (index);
+        while (index2)
         {
-            Client *c2 = (Client *) index2->data;
-            return (c2->win_layer > c->win_layer);
+            c2 = (Client *) index2->data;
+            if (FLAG_TEST (c2->xfwm_flags, XFWM_FLAG_VISIBLE) && 
(c2->win_layer == c->win_layer))
+            {
+                return FALSE;
+            }
+            index2 = g_list_next (index2);
         }
-        else
-        {
-            return TRUE;
-        }
     }
-    return FALSE;
+    return TRUE;
 }
 
 Client *

Modified: xfwm4/branches/xfce_4_4/src/workspaces.c
===================================================================
--- xfwm4/branches/xfce_4_4/src/workspaces.c    2007-03-15 22:28:43 UTC (rev 
25174)
+++ xfwm4/branches/xfce_4_4/src/workspaces.c    2007-03-15 22:29:49 UTC (rev 
25175)
@@ -385,7 +385,7 @@
         {
             if ((screen_info->params->click_to_focus) && 
(screen_info->params->raise_on_click))
             {
-                if (!clientIsTopMost (new_focus))
+                if (!(screen_info->params->raise_on_focus) && !clientIsTopMost 
(new_focus))
                 {
                     clientRaise (new_focus, None);
                 }

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to