From c24827474bc6e28058084e5984980500be4ad9fa Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Mon, 29 Dec 2014 04:32:23 +0000 Subject: [PATCH] Remove border width for toolbars --- sys-x11.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sys-x11.c b/sys-x11.c index 1a833da..7f17292 100644 --- a/sys-x11.c +++ b/sys-x11.c @@ -459,16 +459,17 @@ static void process_event(int type, XEvent *xe, win_t *root) cre->window, cre->value_mask, cre->height, cre->width, cre->x, cre->y); if ((win = win_find(dpy,cre->window,1))) { + int border_width = (win->type == TYPE_TOOLBAR ? 0 : border); XSendEvent(dpy, cre->window, False, StructureNotifyMask, &(XEvent){ - .xconfigure.type = ConfigureNotify, - .xconfigure.display = win->sys->dpy, - .xconfigure.event = win->sys->xid, - .xconfigure.window = win->sys->xid, - .xconfigure.x = win->x, - .xconfigure.y = win->y, - .xconfigure.width = win->w, - .xconfigure.height = win->h, - .xconfigure.border_width = border, + .xconfigure.type = ConfigureNotify, + .xconfigure.display = win->sys->dpy, + .xconfigure.event = win->sys->xid, + .xconfigure.window = win->sys->xid, + .xconfigure.x = win->x, + .xconfigure.y = win->y, + .xconfigure.width = win->w, + .xconfigure.height = win->h, + .xconfigure.border_width = border_width, }); XSync(win->sys->dpy, False); } @@ -608,10 +609,10 @@ void sys_show(win_t *win, state_t state) PropModeReplace, (unsigned char*)0, 0); /* Update border */ - if (state == ST_SHOW || state == ST_MAX || state == ST_SHADE) - XSetWindowBorderWidth(win->sys->dpy, win->sys->xid, border); - else if (state == ST_FULL) + if (win->type == TYPE_TOOLBAR || state == ST_FULL) XSetWindowBorderWidth(win->sys->dpy, win->sys->xid, 0); + else if (state == ST_SHOW || state == ST_MAX || state == ST_SHADE) + XSetWindowBorderWidth(win->sys->dpy, win->sys->xid, border); /* Map/Unmap window */ if (state == ST_SHOW || state == ST_FULL || state == ST_MAX || state == ST_SHADE) -- 2.43.2