1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 05:18:06 +01:00

_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.
This commit is contained in:
Iain Patterson
2012-08-24 17:59:30 +01:00
committed by Carlos R. Mafra
parent 39a5f3da0b
commit 9ab2b642a6
2 changed files with 8 additions and 2 deletions

View File

@@ -793,6 +793,8 @@ static void applySettings(WMButton *button, InspectorPanel *panel)
wAppIconPaint(wapp->app_icon);
}
}
wNETFrameExtents(wwin);
}
static void revertSettings(WMButton *button, InspectorPanel *panel)

View File

@@ -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);
}