dwm

[fork] dynamic window manager
Log | Files | Refs | README | LICENSE

commit 8dc87199b5b6f250fd2b19713c2174f905ace8e4
parent e633c0b5176ddd66fbf1ab190fa72ee0fefb99d4
Author: hhvn <hayden@haydenvh.com>
Date:   Sun,  3 Jan 2021 22:45:32 +0000

dwm.c: revert aa4a446 - the padding didn't always apply correctly with multiple monitors

Diffstat:
Mdwm.c | 18+++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/dwm.c b/dwm.c @@ -256,8 +256,6 @@ static int screen; static int sw, sh; /* X display screen geometry width, height */ static int bh, blw = 0; /* bar geometry */ static int lrpad; /* sum of left and right padding for text */ -static int sidepad; -static int vertpad; static int (*xerrorxlib)(Display *, XErrorEvent *); static unsigned int numlockmask = 0; static void (*handler[LASTEvent]) (XEvent *) = { @@ -552,7 +550,7 @@ configurenotify(XEvent *e) for (c = m->clients; c; c = c->next) if (c->isfullscreen) resizeclient(c, m->mx, m->my, m->mw, m->mh); - XMoveResizeWindow(dpy, m->barwin, m->wx + sidepad, m->by + vertpad, m->ww - 2*sidepad, bh); + XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); } focus(NULL); arrange(NULL); @@ -1592,11 +1590,8 @@ setup(void) for (i = 0; i < LENGTH(colors); i++) scheme[i] = drw_scm_create(drw, colors[i], 3); /* init bars */ - vertpad = gappx; - sidepad = gappx; updatebars(); updatestatus(); - updatebarpos(selmon); /* supporting window for NetWMCheck */ wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32, @@ -1833,12 +1828,13 @@ updatebars(void) for (m = mons; m; m = m->next) { if (m->barwin) continue; - m->barwin = XCreateWindow(dpy, root, m->wx + sidepad, m->by + vertpad, m->ww - 2*sidepad, bh, 0, DefaultDepth(dpy, screen), + m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); XMapRaised(dpy, m->barwin); XSetClassHint(dpy, m->barwin, &ch); + updatebarpos(m); } } @@ -1848,11 +1844,11 @@ updatebarpos(Monitor *m) m->wy = m->my; m->wh = m->mh; if (m->showbar) { - m->wh = m->wh - vertpad - bh; - m->by = m->topbar ? m->wy : m->wy + m->wh + vertpad; - m->wy = m->topbar ? m->wy + bh + vertpad : m->wy; + m->wh -= bh; + m->by = m->topbar ? m->wy : m->wy + m->wh; + m->wy = m->topbar ? m->wy + bh : m->wy; } else - m->by = -bh - vertpad; + m->by = -bh; } void