[Xfce4-commits] <xfwm4:libxfce4ui> Avoid some updates to NET_WM_STATE

Jérôme Guelfucci noreply at xfce.org
Sat Feb 27 01:04:15 CET 2010


Updating branch refs/heads/libxfce4ui
         to 09e3177303833eb658ac3de6b7d57e1f88057bcd (commit)
       from bb2e9dd619e86d77c079cf0a3a007d142db2128b (commit)

commit 09e3177303833eb658ac3de6b7d57e1f88057bcd
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Tue Feb 23 18:46:32 2010 +0100

    Avoid some updates to NET_WM_STATE

 src/client.c |   21 ++++++++++++---------
 src/focus.c  |    2 +-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/client.c b/src/client.c
index 3addde6..ea26f70 100644
--- a/src/client.c
+++ b/src/client.c
@@ -2325,6 +2325,12 @@ clientShowSingle (Client * c, gboolean deiconify)
 
     g_return_if_fail (c != NULL);
 
+    if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE))
+    {
+        /* Should we map the window if it is visible? */
+        return;
+    }
+
     screen_info = c->screen_info;
     display_info = screen_info->display_info;
 
@@ -2864,24 +2870,22 @@ clientStick (Client * c, gboolean include_transients)
         for (list = list_of_windows; list; list = g_list_next (list))
         {
             c2 = (Client *) list->data;
-            TRACE ("sticking client \"%s\" (0x%lx)", c2->name, c2->window);
             c2->win_state |= WIN_STATE_STICKY;
+            TRACE ("Sticking client \"%s\" (0x%lx)", c2->name, c2->window);
             FLAG_SET (c2->flags, CLIENT_FLAG_STICKY);
             setHint (display_info, c2->window, NET_WM_DESKTOP, (unsigned long) ALL_WORKSPACES);
-            clientSetNetState (c2);
             frameQueueDraw (c2, FALSE);
         }
-        clientSetWorkspace (c, screen_info->current_ws, TRUE);
         g_list_free (list_of_windows);
     }
     else
     {
-        TRACE ("sticking client \"%s\" (0x%lx)", c->name, c->window);
+        TRACE ("Sticking client \"%s\" (0x%lx)", c->name, c->window);
         c->win_state |= WIN_STATE_STICKY;
         FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
         setHint (display_info, c->window, NET_WM_DESKTOP, (unsigned long) ALL_WORKSPACES);
-        clientSetWorkspace (c, screen_info->current_ws, TRUE);
     }
+    clientSetWorkspace (c, screen_info->current_ws, TRUE);
     clientSetNetState (c);
 }
 
@@ -2896,7 +2900,6 @@ clientUnstick (Client * c, gboolean include_transients)
 
     g_return_if_fail (c != NULL);
     TRACE ("entering clientUnstick");
-    TRACE ("unsticking client \"%s\" (0x%lx)", c->name, c->window);
 
     screen_info = c->screen_info;
     display_info = screen_info->display_info;
@@ -2908,21 +2911,21 @@ clientUnstick (Client * c, gboolean include_transients)
         {
             c2 = (Client *) list->data;
             c2->win_state &= ~WIN_STATE_STICKY;
+            TRACE ("Unsticking client \"%s\" (0x%lx)", c2->name, c2->window);
             FLAG_UNSET (c2->flags, CLIENT_FLAG_STICKY);
             setHint (display_info, c2->window, NET_WM_DESKTOP, (unsigned long) screen_info->current_ws);
-            clientSetNetState (c2);
             frameQueueDraw (c2, FALSE);
         }
-        clientSetWorkspace (c, screen_info->current_ws, TRUE);
         g_list_free (list_of_windows);
     }
     else
     {
+        TRACE ("Unsticking client \"%s\" (0x%lx)", c->name, c->window);
         c->win_state &= ~WIN_STATE_STICKY;
         FLAG_UNSET (c->flags, CLIENT_FLAG_STICKY);
         setHint (display_info, c->window, NET_WM_DESKTOP, (unsigned long) screen_info->current_ws);
-        clientSetWorkspace (c, screen_info->current_ws, TRUE);
     }
+    clientSetWorkspace (c, screen_info->current_ws, TRUE);
     clientSetNetState (c);
 }
 
diff --git a/src/focus.c b/src/focus.c
index a0daae5..ae69237 100644
--- a/src/focus.c
+++ b/src/focus.c
@@ -526,11 +526,11 @@ clientUpdateFocus (ScreenInfo *screen_info, Client * c, unsigned short flags)
         {
             TRACE ("Un-setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
             FLAG_UNSET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
+            clientSetNetState (c);
         }
         clientAdjustFullscreenLayer (c, TRUE);
         frameQueueDraw (c, FALSE);
         clientUpdateOpacity (c);
-        clientSetNetState (c);
     }
     if (c2)
     {



More information about the Xfce4-commits mailing list