From 9ab2b642a6bf030c375a51ca9b2b27b6d51f1411 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 24 Aug 2012 17:59:30 +0100 Subject: [PATCH] _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. 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. --- 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 65b21fa5..184aec7a 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 b416fdb2..56cab826 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); } -- 2.11.4.GIT