[Xfce4-commits] r27081 - xfwm4/trunk/src

Olivier Fourdan olivier at xfce.org
Thu Jun 19 09:18:24 CEST 2008


Author: olivier
Date: 2008-06-19 07:18:24 +0000 (Thu, 19 Jun 2008)
New Revision: 27081

Modified:
   xfwm4/trunk/src/client.c
   xfwm4/trunk/src/client.h
   xfwm4/trunk/src/focus.c
   xfwm4/trunk/src/settings.c
Log:
Make focused opacity more efficient (although much simpler, but I don't really like this feture anyway)

Modified: xfwm4/trunk/src/client.c
===================================================================
--- xfwm4/trunk/src/client.c	2008-06-18 20:43:00 UTC (rev 27080)
+++ xfwm4/trunk/src/client.c	2008-06-19 07:18:24 UTC (rev 27081)
@@ -3123,12 +3123,38 @@
 }
 
 void
-clientUpdateOpacity (ScreenInfo *screen_info, Client *focus)
+clientUpdateOpacity (Client *c)
 {
+    ScreenInfo *screen_info;
     DisplayInfo *display_info;
+    Client *focused;
+    gboolean opaque;
+
+    g_return_if_fail (c != NULL);
+
+    screen_info = c->screen_info;
+    display_info = screen_info->display_info;
+    if (!compositorIsUsable (display_info))
+    {
+        return;
+    }
+
+    focused = clientGetFocus ();
+    opaque = (FLAG_TEST(c->type, WINDOW_TYPE_DONT_PLACE | WINDOW_TYPE_DONT_FOCUS)
+              || (focused == c));
+
+    clientSetOpacity (c, c->opacity, OPACITY_INACTIVE, opaque ? 0 : OPACITY_INACTIVE);
+}
+
+void
+clientUpdateAllOpacity (ScreenInfo *screen_info)
+{
+    DisplayInfo *display_info;
     Client *c;
     int i;
 
+    g_return_if_fail (screen_info != NULL);
+
     display_info = screen_info->display_info;
     if (!compositorIsUsable (display_info))
     {
@@ -3137,12 +3163,7 @@
 
     for (c = screen_info->clients, i = 0; i < screen_info->client_count; c = c->next, ++i)
     {
-        gboolean o = FLAG_TEST(c->type, WINDOW_TYPE_DONT_PLACE | WINDOW_TYPE_DONT_FOCUS)
-                     || (focus == c)
-                     || (focus && ((focus->transient_for == c->window) || (focus->window == c->transient_for)))
-                     || (focus && (clientIsModalFor (c, focus) || clientIsModalFor (focus, c)));
-
-        clientSetOpacity (c, c->opacity, OPACITY_INACTIVE, o ? 0 : OPACITY_INACTIVE);
+        clientUpdateOpacity (c);
     }
 }
 

Modified: xfwm4/trunk/src/client.h
===================================================================
--- xfwm4/trunk/src/client.h	2008-06-18 20:43:00 UTC (rev 27080)
+++ xfwm4/trunk/src/client.h	2008-06-19 07:18:24 UTC (rev 27081)
@@ -392,8 +392,8 @@
                                                                  gboolean);
 void                     clientFill                             (Client *,
                                                                  int);
-void                     clientUpdateOpacity                    (ScreenInfo *,
-                                                                 Client *);
+void                     clientUpdateOpacity                    (Client *);
+void                     clientUpdateAllOpacity                 (ScreenInfo *);
 void                     clientSetOpacity                       (Client *,
                                                                  guint,
                                                                  guint, guint);

Modified: xfwm4/trunk/src/focus.c
===================================================================
--- xfwm4/trunk/src/focus.c	2008-06-18 20:43:00 UTC (rev 27080)
+++ xfwm4/trunk/src/focus.c	2008-06-19 07:18:24 UTC (rev 27081)
@@ -533,6 +533,8 @@
         }
         clientAdjustFullscreenLayer (c, TRUE);
         frameQueueDraw (c, FALSE);
+        clientUpdateOpacity (c);
+
     }
     if (c2)
     {
@@ -541,6 +543,7 @@
             clientAdjustFullscreenLayer (c2, FALSE);
         }
         frameQueueDraw (c2, FALSE);
+        clientUpdateOpacity (c2);
     }
     clientSetNetActiveWindow (screen_info, c, 0);
     clientClearDelayedFocus ();
@@ -601,7 +604,6 @@
             {
                 XSetInputFocus (myScreenGetXDisplay (screen_info), c->window, RevertToPointerRoot, timestamp);
             }
-            clientUpdateOpacity (screen_info, c);
         }
         else
         {
@@ -628,7 +630,6 @@
         client_focus = NULL;
         clientFocusNone (screen_info, c2, timestamp);
         clientClearDelayedFocus ();
-        clientUpdateOpacity (screen_info, c);
     }
 }
 

Modified: xfwm4/trunk/src/settings.c
===================================================================
--- xfwm4/trunk/src/settings.c	2008-06-18 20:43:00 UTC (rev 27080)
+++ xfwm4/trunk/src/settings.c	2008-06-19 07:18:24 UTC (rev 27081)
@@ -428,7 +428,7 @@
                     {
                         screen_info->params->inactive_opacity = setting->data.v_int;
                         reloadScreenSettings (screen_info, UPDATE_FRAME);
-                        clientUpdateOpacity (screen_info, clientGetFocus ());
+                        clientUpdateAllOpacity (screen_info);
                     }
                     else if (!strcmp (name, "Xfwm/MoveOpacity"))
                     {



More information about the Xfce4-commits mailing list