I noticed that when compton is running it still draws parts of windows designated as decoration with _NET_FRAME_EXTENTS in a different opacity after Window Maker exits. The attached patch removes _NET_FRAME_EXTENTS from all windows when unmanaging them so that windows which survive after Window Maker's death don't look wrong.
From dfaf92852cccaec9e2991cdd55c8b65dc9339d4d Mon Sep 17 00:00:00 2001
From: Iain Patterson <[email protected]>
Date: Fri, 14 Sep 2012 15:31:14 +0100
Subject: [PATCH] Remove _NET_FRAME_EXTENTS on shutdown.

After we exit there are no window decorations therefore frame extents
are meaningless.

We could be left with parts of the window being the wrong opacity if the
property is left intact and a compositing manager configured to draw
decorations with a different opacity to the rest of the window is still
running.

Remove the _NET_FRAME_EXTENTS property from all windows when we shut
down to prevent windows from being drawn incorrectly after we're gone.
---
 src/window.c | 2 ++
 src/wmspec.c | 5 +++++
 src/wmspec.h | 1 +
 3 files changed, 8 insertions(+)

diff --git a/src/window.c b/src/window.c
index e7b1036..12f276a 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1617,6 +1617,8 @@ void wUnmanageWindow(WWindow *wwin, Bool restore, Bool 
destroyed)
                wApplicationDeactivate(oapp);
        }
 
+       wNETCleanupFrameExtents(wwin);
+
        wWindowDestroy(wwin);
        XFlush(dpy);
 }
diff --git a/src/wmspec.c b/src/wmspec.c
index 56cab82..db3526f 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -1642,3 +1642,8 @@ void wNETFrameExtents(WWindow *wwin)
 
        XChangeProperty(dpy, wwin->client_win, net_frame_extents, XA_CARDINAL, 
32, PropModeReplace, (unsigned char *) extents, 4);
 }
+
+void wNETCleanupFrameExtents(WWindow *wwin)
+{
+       XDeleteProperty(dpy, wwin->client_win, net_frame_extents);
+}
diff --git a/src/wmspec.h b/src/wmspec.h
index 47c4c76..0337684 100644
--- a/src/wmspec.h
+++ b/src/wmspec.h
@@ -45,4 +45,5 @@ int wNETWMGetCurrentDesktopFromHint(WScreen *scr);
 char *wNETWMGetIconName(Window window);
 char *wNETWMGetWindowName(Window window);
 void wNETFrameExtents(WWindow *wwin);
+void wNETCleanupFrameExtents(WWindow *wwin);
 #endif
-- 
1.7.11.4

Reply via email to