Author: olivier
Date: 2006-08-24 17:08:39 +0000 (Thu, 24 Aug 2006)
New Revision: 22871

Modified:
   xfwm4/trunk/src/compositor.c
   xfwm4/trunk/src/compositor.h
   xfwm4/trunk/src/netwm.c
Log:
Restore the compositorDamageWindow() hook, use it when the NET_WM_STATE_BELOW 
is updated to ensure that the shadow gets updated too.

Modified: xfwm4/trunk/src/compositor.c
===================================================================
--- xfwm4/trunk/src/compositor.c        2006-08-24 15:28:45 UTC (rev 22870)
+++ xfwm4/trunk/src/compositor.c        2006-08-24 17:08:39 UTC (rev 22871)
@@ -1627,6 +1627,30 @@
 }
 
 static void
+update_extents (CWindow *cw)
+{
+    DisplayInfo *display_info;
+    ScreenInfo *screen_info;
+
+    g_return_if_fail (cw != NULL);
+    TRACE ("entering update_extents");
+
+    screen_info = cw->screen_info;
+    display_info = screen_info->display_info;
+
+    if (WIN_IS_VISIBLE(cw))
+    {
+        damage_win (cw);
+    }
+
+    if (cw->extents)
+    {
+        XFixesDestroyRegion (display_info->dpy, cw->extents);
+        cw->extents = None;
+    }
+}
+
+static void
 determine_mode(CWindow *cw)
 {
     DisplayInfo *display_info;
@@ -2469,17 +2493,7 @@
     {
         if (cw->c != c)
         {
-            if (WIN_IS_VISIBLE(cw))
-            {
-                damage_win (cw);
-            }
-
-            if (cw->extents)
-            {
-                XFixesDestroyRegion (display_info->dpy, cw->extents);
-                cw->extents = None;
-            }
-
+            update_extents (cw);
             cw->c = c;
         }
         return TRUE;
@@ -2506,6 +2520,30 @@
 }
 
 void
+compositorDamageWindow (DisplayInfo *display_info, Window id)
+{
+#ifdef HAVE_COMPOSITOR
+    CWindow *cw;
+
+    g_return_if_fail (display_info != NULL);
+    g_return_if_fail (id != None);
+    TRACE ("entering compositorDamageWindow: 0x%lx", id);
+
+    if (!compositorIsUsable (display_info))
+    {
+        return;
+    }
+
+    cw = find_cwindow_in_display (display_info, id);
+    if (cw)
+    {
+        /* that will also damage the window */
+        update_extents (cw);
+    }
+#endif /* HAVE_COMPOSITOR */
+}
+
+void
 compositorHandleEvent (DisplayInfo *display_info, XEvent *ev)
 {
 #ifdef HAVE_COMPOSITOR

Modified: xfwm4/trunk/src/compositor.h
===================================================================
--- xfwm4/trunk/src/compositor.h        2006-08-24 15:28:45 UTC (rev 22870)
+++ xfwm4/trunk/src/compositor.h        2006-08-24 17:08:39 UTC (rev 22871)
@@ -41,6 +41,8 @@
                                        Client *);
 void     compositorRemoveWindow       (DisplayInfo *,
                                        Window);
+void     compositorDamageWindow       (DisplayInfo *, 
+                                       Window);
 void     compositorHandleEvent        (DisplayInfo *,
                                        XEvent *);
 void     compositorInitDisplay        (DisplayInfo *);

Modified: xfwm4/trunk/src/netwm.c
===================================================================
--- xfwm4/trunk/src/netwm.c     2006-08-24 15:28:45 UTC (rev 22870)
+++ xfwm4/trunk/src/netwm.c     2006-08-24 17:08:39 UTC (rev 22871)
@@ -31,16 +31,17 @@
 #include <gtk/gtk.h>
 #include <libxfce4util/libxfce4util.h> 
 
+#include "client.h"
+#include "compositor.h"
 #include "display.h"
-#include "screen.h"
-#include "netwm.h"
-#include "misc.h"
-#include "client.h"
 #include "frame.h"
 #include "hints.h"
+#include "misc.h"
+#include "netwm.h"
+#include "screen.h"
+#include "stacking.h"
+#include "transients.h"
 #include "workspaces.h"
-#include "transients.h"
-#include "stacking.h"
 
 void
 clientSetNetState (Client * c)
@@ -482,16 +483,19 @@
         {
             if ((action == NET_WM_STATE_ADD) && !FLAG_TEST (c->flags, 
CLIENT_FLAG_BELOW))
             {
+                compositorDamageWindow (display_info, c->frame);
                 FLAG_SET (c->flags, CLIENT_FLAG_BELOW);
                 clientUpdateBelowState (c);
             }
             else if ((action == NET_WM_STATE_REMOVE) && FLAG_TEST (c->flags, 
CLIENT_FLAG_BELOW))
             {
+                compositorDamageWindow (display_info, c->frame);
                 FLAG_UNSET (c->flags, CLIENT_FLAG_BELOW);
                 clientUpdateBelowState (c);
             }
             else if (action == NET_WM_STATE_TOGGLE)
             {
+                compositorDamageWindow (display_info, c->frame);
                 FLAG_TOGGLE (c->flags, CLIENT_FLAG_BELOW);
                 clientUpdateBelowState (c);
             }

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

Reply via email to