Quoth I,

I've just seen that _NET_FRAME_EXTENTS isn't updated when
disabling or enabling the titlebar, resizebar and border of a window,
so that needs to be fixed.

The attached patch fixes _NET_FRAME_EXTENTS not updating when using the inspector to disable or enable the titlebar, resizebar or border. It also fixes not taking the border width into account when calculating the top and bottom extents.

With the patch the window's border is drawn for 32bpp urxvt windows with compton. The border still isn't black, however. That's because the border is taken from the screen's colormap rather than the window's. I'll have a fix for that soon.
From 303b69fd4cc236c52488e62d5ec93fbb148d1f4f Mon Sep 17 00:00:00 2001
From: Iain Patterson <[email protected]>
Date: Fri, 24 Aug 2012 17:59:30 +0100
Subject: [PATCH 2/2] _NET_FRAME_EXTENTS fixes.

Recalculate frame extents when the titlebar, resize bar or border are
enabled/disabled.

Account for border when calculating top and bottom frame extents.
---
 src/winspector.c | 2 ++
 src/wmspec.c     | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/winspector.c b/src/winspector.c
index 65b21fa..184aec7 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -793,6 +793,8 @@ static void applySettings(WMButton *button, InspectorPanel 
*panel)
                        wAppIconPaint(wapp->app_icon);
                }
        }
+
+  wNETFrameExtents(wwin);
 }
 
 static void revertSettings(WMButton *button, InspectorPanel *panel)
diff --git a/src/wmspec.c b/src/wmspec.c
index b416fdb..56cab82 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -1629,12 +1629,16 @@ void wNETFrameExtents(WWindow *wwin)
         *       2 = top
         *       3 = bottom
         */
-       if (!wwin->client_flags.no_border)
-               extents[0] = extents[1] = FRAME_BORDER_WIDTH;
        if (wwin->frame->titlebar)
                extents[2] = wwin->frame->titlebar->height;
        if (wwin->frame->resizebar)
                extents[3] = wwin->frame->resizebar->height;
+       if (HAS_BORDER(wwin)) {
+               extents[0] += FRAME_BORDER_WIDTH;
+               extents[1] += FRAME_BORDER_WIDTH;
+               extents[2] += FRAME_BORDER_WIDTH;
+               extents[3] += FRAME_BORDER_WIDTH;
+       }
 
        XChangeProperty(dpy, wwin->client_win, net_frame_extents, XA_CARDINAL, 
32, PropModeReplace, (unsigned char *) extents, 4);
 }
-- 
1.7.11.4

Reply via email to