From 8f401e1d81862333b453bb1b184caded6ee643f8 Mon Sep 17 00:00:00 2001 From: Utkarsh Verma Date: Sun, 26 Dec 2021 18:29:55 +0530 Subject: [PATCH 01/16] Add a new patch to integrate vanity gaps with bar padding --- dwm.c | 9 ++++++++- patch/vanitygaps.c | 10 ++++++++++ patches.def.h | 6 ++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/dwm.c b/dwm.c index 70ef5e7..938ba0e 100644 --- a/dwm.c +++ b/dwm.c @@ -4319,7 +4319,14 @@ updatebarpos(Monitor *m) m->ww = m->mw; m->wh = m->mh; Bar *bar; - #if BAR_PADDING_PATCH + #if BAR_GAPS_PADDING_PATCH + int y_pad = 0; + int x_pad = 0; + if (enablegaps) { + y_pad = gappov; + x_pad = gappoh; + } + #elif BAR_PADDING_PATCH int y_pad = vertpad; int x_pad = sidepad; #else diff --git a/patch/vanitygaps.c b/patch/vanitygaps.c index be2ef08..757aa4d 100644 --- a/patch/vanitygaps.c +++ b/patch/vanitygaps.c @@ -86,6 +86,16 @@ togglegaps(const Arg *arg) #else enablegaps = !enablegaps; #endif // PERTAG_VANITYGAPS_PATCH + + #if BAR_GAPS_PADDING_PATCH + updatebarpos(selmon); + Bar *bar = selmon->bar; + XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw + gappoh, bar->bh); + + #if BAR_SYSTRAY_PATCH + drawbarwin(systray->bar); + #endif // BAR_SYSTRAY_PATCH + #endif // BAR_GAPS_PADDING_PATCH arrange(NULL); } diff --git a/patches.def.h b/patches.def.h index 022a4a6..037c5ee 100644 --- a/patches.def.h +++ b/patches.def.h @@ -347,6 +347,12 @@ */ #define BAR_PADDING_PATCH 0 +/* Same as barpadding patch but specifically written for the vanitygaps patch. It adds the same + * outer horizontal and vertical padding as vanity gaps. Moreover, the padding is toggled whenever + * vanitygaps are toggled. + */ +#define BAR_GAPS_PADDING_PATCH 0 + /* This patch adds simple markup for status messages using pango markup. * This depends on the pango library v1.44 or greater. * You need to uncomment the corresponding lines in config.mk to use the pango libraries From 0cd25db5af3d376c1ccbe3485a01f8cdd86d6bd4 Mon Sep 17 00:00:00 2001 From: Utkarsh Verma Date: Sun, 26 Dec 2021 18:53:53 +0530 Subject: [PATCH 02/16] Fix resizing of bar --- patch/vanitygaps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch/vanitygaps.c b/patch/vanitygaps.c index 757aa4d..ed9e983 100644 --- a/patch/vanitygaps.c +++ b/patch/vanitygaps.c @@ -90,7 +90,7 @@ togglegaps(const Arg *arg) #if BAR_GAPS_PADDING_PATCH updatebarpos(selmon); Bar *bar = selmon->bar; - XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw + gappoh, bar->bh); + XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); #if BAR_SYSTRAY_PATCH drawbarwin(systray->bar); From 3d081ef5f928bfbf07f67975f4acced1f18e6661 Mon Sep 17 00:00:00 2001 From: Utkarsh Verma Date: Sun, 26 Dec 2021 19:30:01 +0530 Subject: [PATCH 03/16] Loop through all bars --- patch/vanitygaps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/patch/vanitygaps.c b/patch/vanitygaps.c index ed9e983..880bf4a 100644 --- a/patch/vanitygaps.c +++ b/patch/vanitygaps.c @@ -89,8 +89,9 @@ togglegaps(const Arg *arg) #if BAR_GAPS_PADDING_PATCH updatebarpos(selmon); - Bar *bar = selmon->bar; - XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + Bar *bar; + for (bar = selmon->bar; bar; bar = bar->next) + XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); #if BAR_SYSTRAY_PATCH drawbarwin(systray->bar); From 6667f1030bcb43716c81867eecf6efcb070c2c3d Mon Sep 17 00:00:00 2001 From: Utkarsh Verma Date: Sun, 26 Dec 2021 21:26:32 +0530 Subject: [PATCH 04/16] Make sure it plays well with pertag patch --- dwm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dwm.c b/dwm.c index 938ba0e..bd57193 100644 --- a/dwm.c +++ b/dwm.c @@ -4319,10 +4319,15 @@ updatebarpos(Monitor *m) m->ww = m->mw; m->wh = m->mh; Bar *bar; - #if BAR_GAPS_PADDING_PATCH + #if BAR_GAPS_PADDING_PATCH && VANITYGAPS_PATCH int y_pad = 0; int x_pad = 0; + + #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH + if (!selmon || selmon->pertag->enablegaps[selmon->pertag->curtag]) { + #else if (enablegaps) { + #endif // PERTAG_VANITYGAPS_PATCH y_pad = gappov; x_pad = gappoh; } From aa1a7ff708572535c1e952e6318128b69142a893 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Fri, 7 Jan 2022 22:27:08 +0100 Subject: [PATCH 05/16] Fix for infinite loop when there is only one client and pushup is run twice --- patch/push.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/patch/push.c b/patch/push.c index 9410e61..68123a6 100644 --- a/patch/push.c +++ b/patch/push.c @@ -40,9 +40,11 @@ pushup(const Arg *arg) } else { /* move to the end */ for (c = sel; c->next; c = c->next); - detach(sel); - sel->next = NULL; - c->next = sel; + if (sel != c) { + detach(sel); + sel->next = NULL; + c->next = sel; + } } focus(sel); arrange(selmon); From 1920595795be273d36584e3fa884b9abcf85a92c Mon Sep 17 00:00:00 2001 From: bakkeby Date: Mon, 10 Jan 2022 17:16:09 +0100 Subject: [PATCH 06/16] drawbar: Don't expend effort drawing bar if it is occluded I noticed that a non-trivial amount of dwm's work on my machine was from drw_text, which seemed weird, because I have the bar disabled and we only use drw_text as part of bar drawing. Looking more closely, I realised that while we use m->showbar when updating the monitor bar margins, but don't skip actually drawing the bar if it is hidden. This patch skips drawing it entirely if that is the case. On my machine, this takes 10% of dwm's on-CPU time, primarily from restack() and focus(). When the bar is toggled on again, the X server will generate an Expose event, and we'll redraw the bar as normal as part of expose(). Ref. https://git.suckless.org/dwm/commit/8657affa2a61e85ca8df76b62e43cb02897d1d80.html --- dwm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dwm.c b/dwm.c index bd57193..a376707 100644 --- a/dwm.c +++ b/dwm.c @@ -1753,8 +1753,10 @@ void drawbar(Monitor *m) { Bar *bar; - for (bar = m->bar; bar; bar = bar->next) - drawbarwin(bar); + + if (m->showbar) + for (bar = m->bar; bar; bar = bar->next) + drawbarwin(bar); } void @@ -3948,6 +3950,10 @@ togglebar(const Arg *arg) updatebarpos(selmon); for (bar = selmon->bar; bar; bar = bar->next) XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + #if BAR_SYSTRAY_PATCH + if (!selmon->showbar && systray) + XMoveWindow(dpy, systray->win, -32000, -32000); + #endif // BAR_SYSTRAY_PATCH arrange(selmon); } From 094c8ff363fbea645e65185c671ec9af4df1d333 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Mon, 10 Jan 2022 17:18:45 +0100 Subject: [PATCH 07/16] Add a configuration option for fullscreen locking Some people are annoyed to have this new behaviour forced for some application which use fake fullscreen. Ref. https://git.suckless.org/dwm/commit/138b405f0c8aa24d8a040cc1a1cf6e3eb5a0ebc7.html --- config.def.h | 1 + dwm.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 61dd14a..469f70f 100644 --- a/config.def.h +++ b/config.def.h @@ -567,6 +567,7 @@ static const int nmaster = 1; /* number of clients in master area */ static const int nstack = 0; /* number of clients in primary stack area */ #endif // FLEXTILE_DELUXE_LAYOUT static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ +static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ #if DECORATION_HINTS_PATCH static const int decorhints = 1; /* 1 means respect decoration hints */ #endif // DECORATION_HINTS_PATCH diff --git a/dwm.c b/dwm.c index a376707..803f77a 100644 --- a/dwm.c +++ b/dwm.c @@ -2018,7 +2018,7 @@ focusstack(const Arg *arg) if (!selmon->sel || (selmon->sel->isfullscreen && !selmon->sel->fakefullscreen)) return; #else - if (!selmon->sel || selmon->sel->isfullscreen) + if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen)) return; #endif // LOSEFULLSCREEN_PATCH #if BAR_WINTITLEACTIONS_PATCH From 2771f3d1c918a1c89691292e64787711ebdc7f7f Mon Sep 17 00:00:00 2001 From: bakkeby Date: Mon, 10 Jan 2022 17:24:12 +0100 Subject: [PATCH 08/16] bump version to 6.3 --- README.md | 2 +- config.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dcc4f9c..3fc48f5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -This dwm 6.2 (67d76bd, 2021-03-29) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0). +This dwm 6.3 (d39e2f3, 2022-01-07) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0). For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dwm-flexipatch/blob/master/patches.def.h): ```c diff --git a/config.mk b/config.mk index 62d1c84..fb2310c 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # dwm version -VERSION = 6.2 +VERSION = 6.3 # Customize below to fit your system From a0d5ba9369fce6736dcf8e01966c6bb5a77973aa Mon Sep 17 00:00:00 2001 From: bakkeby Date: Fri, 14 Jan 2022 21:12:36 +0100 Subject: [PATCH 09/16] tags bar module: fix for wrong click offset ref. #215 --- patch/bar_tags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch/bar_tags.c b/patch/bar_tags.c index c618ff5..8b9092d 100644 --- a/patch/bar_tags.c +++ b/patch/bar_tags.c @@ -70,7 +70,7 @@ draw_tags(Bar *bar, BarArg *a) int click_tags(Bar *bar, Arg *arg, BarArg *a) { - int i = 0, x = lrpad / 2; + int i = 0, x = 0; #if BAR_HIDEVACANTTAGS_PATCH Client *c; unsigned int occ = 0; From b17ea8e2de2846b4a2dd8593cf181275854577a7 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Tue, 18 Jan 2022 11:04:35 +0100 Subject: [PATCH 10/16] Refactoring window title drawing with regards to icons ref. #216 --- patch/bar_awesomebar.c | 49 +++++++++++++++++++++++++++------ patch/bar_fancybar.c | 57 ++++++++++++++++++++++++-------------- patch/bar_flexwintitle.c | 59 ++++++++++++++++++++++++++++++---------- patch/bar_tabgroups.c | 57 ++++++++++++++++++++++++++++---------- patch/bar_wintitle.c | 47 ++++++++++++++++++++++++++------ 5 files changed, 201 insertions(+), 68 deletions(-) diff --git a/patch/bar_awesomebar.c b/patch/bar_awesomebar.c index b02c6e7..81711f3 100644 --- a/patch/bar_awesomebar.c +++ b/patch/bar_awesomebar.c @@ -7,8 +7,14 @@ width_awesomebar(Bar *bar, BarArg *a) int draw_awesomebar(Bar *bar, BarArg *a) { - int n = 0, scm, remainder = 0, tabw, pad; + int n = 0, scm, remainder = 0, tabw, tpad, tx, tw; unsigned int i; + #if BAR_CENTEREDWINDOWNAME_PATCH + int cpad; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + #if BAR_WINICON_PATCH + int ipad; + #endif // BAR_WINICON_PATCH #if BAR_TITLE_LEFT_PAD_PATCH && BAR_TITLE_RIGHT_PAD_PATCH int x = a->x + lrpad / 2, w = a->w - lrpad; #elif BAR_TITLE_LEFT_PAD_PATCH @@ -39,22 +45,49 @@ draw_awesomebar(Bar *bar, BarArg *a) else scm = SchemeTitleNorm; - pad = lrpad / 2; + tpad = lrpad / 2; #if BAR_CENTEREDWINDOWNAME_PATCH + cpad = 0; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + #if BAR_WINICON_PATCH + ipad = c->icon ? c->icon->width + ICONSPACING : 0; + #endif // BAR_WINICON_PATCH + + tx = x; + tw = tabw; + + #if BAR_WINICON_PATCH && BAR_CENTEREDWINDOWNAME_PATCH + if (TEXTW(c->name) + ipad < tabw) + cpad = (tabw - TEXTW(c->name) - ipad) / 2; + #elif BAR_CENTEREDWINDOWNAME_PATCH if (TEXTW(c->name) < tabw) - pad = (tabw - TEXTW(c->name) + lrpad) / 2; + cpad = (tabw - TEXTW(c->name)) / 2; #endif // BAR_CENTEREDWINDOWNAME_PATCH drw_setscheme(drw, scheme[scm]); + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, tx, a->y, tw, a->h); + + #if BAR_CENTEREDWINDOWNAME_PATCH + /* Apply center padding, if any */ + tx += cpad; + tw -= cpad; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + tx += tpad; + tw -= lrpad; + #if BAR_WINICON_PATCH - drw_text(drw, x, a->y, tabw + (i < remainder ? 1 : 0), a->h, pad + (c->icon ? c->icon->width + ICONSPACING : 0), c->name, 0, False); - if (c->icon) - drw_img(drw, x + pad, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); - #else - drw_text(drw, x, a->y, tabw + (i < remainder ? 1 : 0), a->h, pad, c->name, 0, False); + if (ipad) { + drw_img(drw, tx, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); + tx += ipad; + tw -= ipad; + } #endif // BAR_WINICON_PATCH + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + drawstateindicator(c->mon, c, 1, x, a->y, tabw + (i < remainder ? 1 : 0), a->h, 0, 0, c->isfixed); x += tabw + (i < remainder ? 1 : 0); } diff --git a/patch/bar_fancybar.c b/patch/bar_fancybar.c index 10bac83..623d1c3 100644 --- a/patch/bar_fancybar.c +++ b/patch/bar_fancybar.c @@ -7,7 +7,10 @@ width_fancybar(Bar *bar, BarArg *a) int draw_fancybar(Bar *bar, BarArg *a) { - int ftw, mw, ew = 0, n = 0; + int tabw, mw, ew = 0, n = 0, tx, tw; + #if BAR_WINICON_PATCH + int ipad; + #endif // BAR_WINICON_PATCH unsigned int i; Client *c; Monitor *m = bar->mon; @@ -28,25 +31,25 @@ draw_fancybar(Bar *bar, BarArg *a) } if (n > 0) { - ftw = TEXTW(m->sel->name); + tabw = TEXTW(m->sel->name); #if BAR_WINICON_PATCH if (m->sel->icon) - ftw += m->sel->icon->width + ICONSPACING; + tabw += m->sel->icon->width + ICONSPACING; #endif // BAR_WINICON_PATCH - mw = (ftw >= w || n == 1) ? 0 : (w - ftw) / (n - 1); + mw = (tabw >= w || n == 1) ? 0 : (w - tabw) / (n - 1); i = 0; for (c = m->clients; c; c = c->next) { if (!ISVISIBLE(c) || c == m->sel) continue; - ftw = TEXTW(c->name); + tabw = TEXTW(c->name); #if BAR_WINICON_PATCH if (c->icon) - ftw += c->icon->width + ICONSPACING; + tabw += c->icon->width + ICONSPACING; #endif // BAR_WINICON_PATCH - if (ftw < mw) - ew += (mw - ftw); + if (tabw < mw) + ew += (mw - tabw); else i++; } @@ -57,24 +60,36 @@ draw_fancybar(Bar *bar, BarArg *a) for (c = m->clients; c; c = c->next) { if (!ISVISIBLE(c)) continue; - ftw = MIN(m->sel == c ? w : mw, TEXTW(c->name)); + tabw = MIN(m->sel == c ? w : mw, TEXTW(c->name)); + #if BAR_WINICON_PATCH + ipad = c->icon ? c->icon->width + ICONSPACING : 0; + tabw += ipad; + #endif // BAR_WINICON_PATCH + tx = x; + tw = tabw; drw_setscheme(drw, scheme[m->sel == c ? SchemeTitleSel : SchemeTitleNorm]); - if (ftw > 0) { /* trap special handling of 0 in drw_text */ - drw_text(drw, x, a->y, ftw, a->h, lrpad / 2, c->name, 0, False); + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, tx, a->y, tw, a->h); - #if BAR_WINICON_PATCH - drw_text(drw, x, a->y, ftw, a->h, lrpad / 2 + (c->icon ? c->icon->width + ICONSPACING : 0), c->name, 0, False); - if (c->icon) - drw_img(drw, x + lrpad / 2, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); - #else - drw_text(drw, x, a->y, ftw, a->h, lrpad / 2, c->name, 0, False); - #endif // BAR_WINICON_PATCH + if (tabw <= 0) /* trap special handling of 0 in drw_text */ + continue; + tx += lrpad / 2; + tw -= lrpad; + + #if BAR_WINICON_PATCH + if (ipad) { + drw_img(drw, tx, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); + tx += ipad; + tw -= ipad; } - drawstateindicator(c->mon, c, 1, x, a->y, ftw, a->h, 0, 0, c->isfixed); - x += ftw; - w -= ftw; + #endif // BAR_WINICON_PATCH + + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + drawstateindicator(c->mon, c, 1, x, a->y, tabw, a->h, 0, 0, c->isfixed); + x += tabw; + w -= tabw; } } return n; diff --git a/patch/bar_flexwintitle.c b/patch/bar_flexwintitle.c index 0e17443..b5d77b0 100644 --- a/patch/bar_flexwintitle.c +++ b/patch/bar_flexwintitle.c @@ -166,11 +166,21 @@ getselschemefor(int scheme) } void -flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Arg *arg, BarArg *barg) +flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Arg *arg, BarArg *a) { if (!c) return; - int i, nclienttags = 0, nviewtags = 0, pad = lrpad / 2; + int i, nclienttags = 0, nviewtags = 0; + int tpad = lrpad / 2; + #if BAR_WINICON_PATCH + int ipad = c->icon ? c->icon->width + ICONSPACING : 0; + #endif // BAR_WINICON_PATCH + #if BAR_CENTEREDWINDOWNAME_PATCH + int cpad = 0; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + int tx = x; + int tw = w; + int clientscheme = ( c == selmon->sel && HIDDEN(c) ? SchemeHidSel @@ -182,30 +192,49 @@ flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Ar ? SchemeUrg : tabscheme ); + drw_setscheme(drw, scheme[clientscheme]); XSetWindowBorder(dpy, c->win, scheme[clientscheme][ColBorder].pixel); - if (w <= TEXTW("A") - lrpad + pad) // reduce text padding if wintitle is too small - pad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); - #if BAR_CENTEREDWINDOWNAME_PATCH + + if (w <= TEXTW("A") - lrpad + tpad) // reduce text padding if wintitle is too small + tpad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); + #if BAR_WINICON_PATCH && BAR_CENTEREDWINDOWNAME_PATCH + else if (TEXTW(c->name) + ipad < w) + cpad = (w - TEXTW(c->name) - ipad) / 2; + #elif BAR_CENTEREDWINDOWNAME_PATCH else if (TEXTW(c->name) < w) - pad = (w - TEXTW(c->name) + lrpad) / 2; + cpad = (w - TEXTW(c->name)) / 2; #endif // BAR_CENTEREDWINDOWNAME_PATCH + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, w, a->h); + + #if BAR_CENTEREDWINDOWNAME_PATCH + /* Apply center padding, if any */ + tx += cpad; + tw -= cpad; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + tx += tpad; + tw -= lrpad; + #if BAR_WINICON_PATCH - drw_text(drw, x, barg->y, w, barg->h, pad + (c->icon ? c->icon->width + ICONSPACING : 0), c->name, 0, False); - if (c->icon) - drw_img(drw, x + pad, barg->y + (barg->h - c->icon->height) / 2, c->icon, tmpicon); - #else - drw_text(drw, x, barg->y, w, barg->h, pad, c->name, 0, False); + if (ipad) { + drw_img(drw, tx, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); + tx += ipad; + tw -= ipad; + } #endif // BAR_WINICON_PATCH - drawstateindicator(m, c, 1, x + 2, barg->y, w, barg->h, 0, 0, 0); + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + drawstateindicator(m, c, 1, x + 2, a->y, w, a->h, 0, 0, 0); if (FLEXWINTITLE_BORDERS) { XSetForeground(drw->dpy, drw->gc, scheme[SchemeSel][ColBorder].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, barg->y, 1, barg->h); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w - (x + w >= barg->w ? 1 : 0), barg->y, 1, barg->h); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, 1, a->h); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w - (x + w >= a->w ? 1 : 0), a->y, 1, a->h); } + /* Optional tags icons */ for (i = 0; i < NUMTAGS; i++) { if ((m->tagset[m->seltags] >> i) & 1) @@ -215,7 +244,7 @@ flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Ar } if (TAGSINDICATOR == 2 || nclienttags > 1 || nviewtags > 1) - drawindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); + drawindicator(m, c, 1, x, a->y, w, a->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); } #ifndef HIDDEN diff --git a/patch/bar_tabgroups.c b/patch/bar_tabgroups.c index 1498bc2..b89d348 100644 --- a/patch/bar_tabgroups.c +++ b/patch/bar_tabgroups.c @@ -36,11 +36,21 @@ click_bartabgroups(Bar *bar, Arg *arg, BarArg *a) } void -bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg *arg, BarArg *barg) +bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg *arg, BarArg *a) { if (!c) return; - int i, nclienttags = 0, nviewtags = 0, pad = lrpad / 2; + int i, nclienttags = 0, nviewtags = 0; + int tpad = lrpad / 2; + #if BAR_WINICON_PATCH + int ipad = c->icon ? c->icon->width + ICONSPACING : 0; + #endif // BAR_WINICON_PATCH + #if BAR_CENTEREDWINDOWNAME_PATCH + int cpad = 0; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + int tx = x; + int tw = w; + drw_setscheme(drw, scheme[ m->sel == c #ifdef HIDDEN @@ -55,27 +65,44 @@ bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg ? SchemeTitleSel : SchemeTitleNorm ]); - if (w <= TEXTW("A") - lrpad + pad) // reduce text padding if wintitle is too small - pad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); - #if BAR_CENTEREDWINDOWNAME_PATCH + if (w <= TEXTW("A") - lrpad + tpad) // reduce text padding if wintitle is too small + tpad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); + #if BAR_WINICON_PATCH && BAR_CENTEREDWINDOWNAME_PATCH + else if (TEXTW(c->name) + ipad < w) + cpad = (w - TEXTW(c->name) - ipad) / 2; + #elif BAR_CENTEREDWINDOWNAME_PATCH else if (TEXTW(c->name) < w) - pad = (w - TEXTW(c->name) + lrpad) / 2; + cpad = (w - TEXTW(c->name)) / 2; #endif // BAR_CENTEREDWINDOWNAME_PATCH + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, w, a->h); + + #if BAR_CENTEREDWINDOWNAME_PATCH + /* Apply center padding, if any */ + tx += cpad; + tw -= cpad; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + tx += tpad; + tw -= lrpad; + #if BAR_WINICON_PATCH - drw_text(drw, x, barg->y, w, barg->h, pad + (c->icon ? c->icon->width + ICONSPACING : 0), c->name, 0, False); - if (c->icon) - drw_img(drw, x + pad, barg->y + (barg->h - c->icon->height) / 2, c->icon, tmpicon); - #else - drw_text(drw, x, barg->y, w, barg->h, pad, c->name, 0, False); + if (ipad) { + drw_img(drw, tx, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); + tx += ipad; + tw -= ipad; + } #endif // BAR_WINICON_PATCH - drawstateindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, c->isfixed); + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + + drawstateindicator(m, c, 1, x, a->y, w, a->h, 0, 0, c->isfixed); if (BARTAB_BORDERS) { XSetForeground(drw->dpy, drw->gc, scheme[SchemeSel][ColBorder].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, barg->y, 1, barg->h); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w - (x + w >= barg->w ? 1 : 0), barg->y, 1, barg->h); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, 1, a->h); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w - (x + w >= a->w ? 1 : 0), a->y, 1, a->h); } /* Optional tags icons */ for (i = 0; i < NUMTAGS; i++) { @@ -86,7 +113,7 @@ bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg } if (TAGSINDICATOR == 2 || nclienttags > 1 || nviewtags > 1) - drawindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); + drawindicator(m, c, 1, x, a->y, w, a->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); } #ifndef HIDDEN diff --git a/patch/bar_wintitle.c b/patch/bar_wintitle.c index d2241d2..72926f2 100644 --- a/patch/bar_wintitle.c +++ b/patch/bar_wintitle.c @@ -18,7 +18,6 @@ draw_wintitle(Bar *bar, BarArg *a) #endif // BAR_TITLE_LEFT_PAD_PATCH | BAR_TITLE_RIGHT_PAD_PATCH Monitor *m = bar->mon; Client *c = m->sel; - int pad = lrpad / 2; if (!c) { drw_setscheme(drw, scheme[SchemeTitleNorm]); @@ -26,23 +25,53 @@ draw_wintitle(Bar *bar, BarArg *a) return 0; } + int tpad = lrpad / 2; + #if BAR_WINICON_PATCH + int ipad = c->icon ? c->icon->width + ICONSPACING : 0; + #endif // BAR_WINICON_PATCH + #if BAR_CENTEREDWINDOWNAME_PATCH + int cpad = 0; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + int tx = x; + int tw = w; + drw_setscheme(drw, scheme[m == selmon ? SchemeTitleSel : SchemeTitleNorm]); #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH XSetErrorHandler(xerrordummy); #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH - #if BAR_CENTEREDWINDOWNAME_PATCH - if (TEXTW(c->name) < w) - pad = (w - TEXTW(c->name) + lrpad) / 2; + + if (w <= TEXTW("A") - lrpad + tpad) // reduce text padding if wintitle is too small + tpad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); + #if BAR_WINICON_PATCH && BAR_CENTEREDWINDOWNAME_PATCH + else if (TEXTW(c->name) + ipad < w) + cpad = (w - TEXTW(c->name) - ipad) / 2; + #elif BAR_CENTEREDWINDOWNAME_PATCH + else if (TEXTW(c->name) < w) + cpad = (w - TEXTW(c->name)) / 2; #endif // BAR_CENTEREDWINDOWNAME_PATCH + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, w, a->h); + + #if BAR_CENTEREDWINDOWNAME_PATCH + /* Apply center padding, if any */ + tx += cpad; + tw -= cpad; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + tx += tpad; + tw -= lrpad; + #if BAR_WINICON_PATCH - drw_text(drw, x, a->y, w, a->h, pad + (c->icon ? c->icon->width + ICONSPACING : 0), c->name, 0, False); - if (c->icon) - drw_img(drw, x + pad, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); - #else - drw_text(drw, x, a->y, w, a->h, pad, c->name, 0, False); + if (ipad) { + drw_img(drw, tx, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); + tx += ipad; + tw -= ipad; + } #endif // BAR_WINICON_PATCH + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH XSync(dpy, False); XSetErrorHandler(xerror); From 5c80a54b623a72b0855a9d46575565cc446f3bd6 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Tue, 18 Jan 2022 11:08:34 +0100 Subject: [PATCH 11/16] Refactoring restack to allow it to work without having the bar as a reference ref. #214 --- dwm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dwm.c b/dwm.c index 803f77a..03ea7c3 100644 --- a/dwm.c +++ b/dwm.c @@ -3000,7 +3000,7 @@ resizemouse(const Arg *arg) void restack(Monitor *m) { - Client *c; + Client *c, *f = NULL; XEvent ev; XWindowChanges wc; #if WARP_PATCH && FLEXTILE_DELUXE_LAYOUT @@ -3015,11 +3015,17 @@ restack(Monitor *m) return; if (m->sel->isfloating || !m->lt[m->sellt]->arrange) XRaiseWindow(dpy, m->sel->win); - if (m->lt[m->sellt]->arrange && m->bar) { + if (m->lt[m->sellt]->arrange) { wc.stack_mode = Below; - wc.sibling = m->bar->win; + if (m->bar) { + wc.sibling = m->bar->win; + } else { + for (f = m->stack; f && (f->isfloating || !ISVISIBLE(f)); f = f->snext); // find first tiled stack client + if (f) + wc.sibling = f->win; + } for (c = m->stack; c; c = c->snext) - if (!c->isfloating && ISVISIBLE(c)) { + if (!c->isfloating && ISVISIBLE(c) && c != f) { XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc); wc.sibling = c->win; } From d1662b6636202ae5c6aea81074b539fa7f347322 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Tue, 18 Jan 2022 14:29:11 +0100 Subject: [PATCH 12/16] Ignoring unused functions warnings. This is achieved by adding the -Wno-unused-function flag to the compiler. The warnings are suppressed to avoid confusion for users new to dwm. Removing the static declaration from the header files works too, but adds unnecessary data into the compiled object. --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mk b/config.mk index fb2310c..6829536 100644 --- a/config.mk +++ b/config.mk @@ -58,7 +58,7 @@ LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} ${XRENDER} ${MPDCLIENT # flags CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} +CFLAGS = -std=c99 -pedantic -Wall -Wno-unused-function -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} LDFLAGS = ${LIBS} # Solaris From 8e36c36bcf4c5ba53949923d75ad46f984c12cbc Mon Sep 17 00:00:00 2001 From: bakkeby Date: Thu, 20 Jan 2022 22:21:55 +0100 Subject: [PATCH 13/16] Fix for drw_text cropping one characters too many when the text is too long and replacing with ... ref. #216 --- drw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drw.c b/drw.c index 0fc9f05..afb6477 100644 --- a/drw.c +++ b/drw.c @@ -507,8 +507,8 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp if (utf8strlen) { drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL); /* shorten text if necessary */ - for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--) - drw_font_getexts(usedfont, utf8str, len, &ew, NULL); + for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; drw_font_getexts(usedfont, utf8str, len, &ew, NULL)) + len--; if (len) { memcpy(buf, utf8str, len); From a0751271bc6f3d45f165f750915e464f90336d0d Mon Sep 17 00:00:00 2001 From: bakkeby Date: Fri, 11 Feb 2022 09:44:40 +0100 Subject: [PATCH 14/16] sizehints ruled: have rule checks take window type and role into account ref. #229 --- patch/sizehints_ruled.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/patch/sizehints_ruled.c b/patch/sizehints_ruled.c index 99c7e62..ce2eeb9 100644 --- a/patch/sizehints_ruled.c +++ b/patch/sizehints_ruled.c @@ -2,6 +2,10 @@ void checkfloatingrules(Client *c) { const char *class, *instance; + Atom wintype; + #if WINDOWROLERULE_PATCH + char role[64]; + #endif // WINDOWROLERULE_PATCH unsigned int i; const Rule *r; XClassHint ch = { NULL, NULL }; @@ -9,13 +13,23 @@ checkfloatingrules(Client *c) XGetClassHint(dpy, c->win, &ch); class = ch.res_class ? ch.res_class : broken; instance = ch.res_name ? ch.res_name : broken; + wintype = getatomprop(c, netatom[NetWMWindowType]); + #if WINDOWROLERULE_PATCH + gettextprop(c->win, wmatom[WMWindowRole], role, sizeof(role)); + #endif // WINDOWROLERULE_PATCH for (i = 0; i < LENGTH(rules); i++) { r = &rules[i]; if ((!r->title || strstr(c->name, r->title)) && (!r->class || strstr(class, r->class)) - && (!r->instance || strstr(instance, r->instance))) + #if WINDOWROLERULE_PATCH + && (!r->role || strstr(role, r->role)) + #endif // WINDOWROLERULE_PATCH + && (!r->instance || strstr(instance, r->instance)) + && (!r->wintype || wintype == XInternAtom(dpy, r->wintype, False))) + { c->isfloating = r->isfloating; + } } if (ch.res_class) XFree(ch.res_class); From 90e4dfc0cf76a3126981c443dd3013a7ccf049bc Mon Sep 17 00:00:00 2001 From: bakkeby Date: Fri, 11 Feb 2022 10:10:28 +0100 Subject: [PATCH 15/16] Adding the isfreesize version of the sizehints patch ref. #229 --- README.md | 2 ++ dwm.c | 25 +++++++++++++++++++++---- patches.def.h | 13 +++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3fc48f5..abec291 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ If you are experiencing issues then you may want to check out the [Known Issues] ### Changelog: +2022-02-11 - Added the isfreesize version of the sizehints patch + 2021-11-23 - Added the taglabels and underlinetags patches 2021-09-08 - Added the alwayscenter patch diff --git a/dwm.c b/dwm.c index 03ea7c3..95d7cf8 100644 --- a/dwm.c +++ b/dwm.c @@ -368,6 +368,9 @@ struct Client { #if PLACEMOUSE_PATCH int beingmoved; #endif // PLACEMOUSE_PATCH + #if SIZEHINTS_ISFREESIZE_PATCH + int isfreesize; + #endif // SIZEHINTS_ISFREESIZE_PATCH #if SWALLOW_PATCH int isterminal, noswallow; pid_t pid; @@ -515,6 +518,9 @@ typedef struct { #if SELECTIVEFAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH int isfakefullscreen; #endif // SELECTIVEFAKEFULLSCREEN_PATCH + #if SIZEHINTS_ISFREESIZE_PATCH + int isfreesize; + #endif // SIZEHINTS_ISFREESIZE_PATCH #if ISPERMANENT_PATCH int ispermanent; #endif // ISPERMANENT_PATCH @@ -825,6 +831,9 @@ applyrules(Client *c) #if SWALLOW_PATCH c->noswallow = -1; #endif // SWALLOW_PATCH + #if SIZEHINTS_ISFREESIZE_PATCH + c->isfreesize = 1; + #endif // SIZEHINTS_ISFREESIZE_PATCH c->isfloating = 0; c->tags = 0; XGetClassHint(dpy, c->win, &ch); @@ -863,6 +872,9 @@ applyrules(Client *c) c->isterminal = r->isterminal; c->noswallow = r->noswallow; #endif // SWALLOW_PATCH + #if SIZEHINTS_ISFREESIZE_PATCH + c->isfreesize = r->isfreesize; + #endif // SIZEHINTS_ISFREESIZE_PATCH c->isfloating = r->isfloating; c->tags |= r->tags; #if SCRATCHPADS_PATCH @@ -4533,11 +4545,11 @@ updatesizehints(Client *c) if (!XGetWMNormalHints(dpy, c->win, &size, &msize)) /* size is uninitialized, ensure that size.flags aren't used */ - #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH + #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH || SIZEHINTS_ISFREESIZE_PATCH size.flags = 0; #else size.flags = PSize; - #endif // SIZEHINTS_PATCH | SIZEHINTS_RULED_PATCH + #endif // SIZEHINTS_PATCH | SIZEHINTS_RULED_PATCH | SIZEHINTS_ISFREESIZE_PATCH if (size.flags & PBaseSize) { c->basew = size.base_width; c->baseh = size.base_height; @@ -4569,8 +4581,13 @@ updatesizehints(Client *c) c->maxa = (float)size.max_aspect.x / size.max_aspect.y; } else c->maxa = c->mina = 0.0; - #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH - if (size.flags & PSize) { + #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH || SIZEHINTS_ISFREESIZE_PATCH + #if SIZEHINTS_ISFREESIZE_PATCH + if ((size.flags & PSize) && c->isfreesize) + #else + if (size.flags & PSize) + #endif // SIZEHINTS_ISFREESIZE_PATCH + { c->basew = size.base_width; c->baseh = size.base_height; c->isfloating = 1; diff --git a/patches.def.h b/patches.def.h index 037c5ee..3d59e2e 100644 --- a/patches.def.h +++ b/patches.def.h @@ -970,6 +970,19 @@ */ #define SIZEHINTS_RULED_PATCH 0 +/* This patch makes dwm obey even "soft" sizehints for new clients. The isfreesize + * version is similar to the sizehints ruled patch except it allows you to specify + * via client rules which clients this should apply to. Soft sizehints applies by + * default to clients that are not ruled, and will be disabled by default for clients + * that are. + * + * Example client rule enabling soft sizehints: + * - RULE(.wintype = WTYPE "DIALOG", .isfloating = 1, .isfreesize = 1) + * + * https://dwm.suckless.org/patches/sizehints/ + */ +#define SIZEHINTS_ISFREESIZE_PATCH 0 + /* In a multi-head setup monitor 0 is by default the primary screen, with the left and right * screen being monitor 1 and 2 respectively. This patch sorts screens left to right (or * top to bottom in a vertical layout) which aims to address some inconsistencies when it From 282dc2ad22fd9483a4349064ce7e7e5e4476ef18 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Fri, 11 Feb 2022 11:43:06 +0100 Subject: [PATCH 16/16] barpadding: adding vanitygaps variant --- dwm.c | 21 +++++++++------------ patch/vanitygaps.c | 7 +++---- patches.def.h | 9 +++++---- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/dwm.c b/dwm.c index 95d7cf8..37c265f 100644 --- a/dwm.c +++ b/dwm.c @@ -4343,25 +4343,22 @@ updatebarpos(Monitor *m) m->ww = m->mw; m->wh = m->mh; Bar *bar; - #if BAR_GAPS_PADDING_PATCH && VANITYGAPS_PATCH int y_pad = 0; int x_pad = 0; - + #if BAR_PADDING_VANITYGAPS_PATCH && VANITYGAPS_PATCH #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH - if (!selmon || selmon->pertag->enablegaps[selmon->pertag->curtag]) { + if (!selmon || selmon->pertag->enablegaps[selmon->pertag->curtag]) #else - if (enablegaps) { + if (enablegaps) #endif // PERTAG_VANITYGAPS_PATCH - y_pad = gappov; - x_pad = gappoh; + { + y_pad = gappoh; + x_pad = gappov; } #elif BAR_PADDING_PATCH - int y_pad = vertpad; - int x_pad = sidepad; - #else - int y_pad = 0; - int x_pad = 0; - #endif // BAR_PADDING_PATCH + y_pad = vertpad; + x_pad = sidepad; + #endif // BAR_PADDING_PATCH | BAR_PADDING_VANITYGAPS_PATCH #if INSETS_PATCH // Custom insets diff --git a/patch/vanitygaps.c b/patch/vanitygaps.c index 880bf4a..d322ded 100644 --- a/patch/vanitygaps.c +++ b/patch/vanitygaps.c @@ -87,16 +87,15 @@ togglegaps(const Arg *arg) enablegaps = !enablegaps; #endif // PERTAG_VANITYGAPS_PATCH - #if BAR_GAPS_PADDING_PATCH + #if BAR_PADDING_VANITYGAPS_PATCH updatebarpos(selmon); - Bar *bar; - for (bar = selmon->bar; bar; bar = bar->next) + for (Bar *bar = selmon->bar; bar; bar = bar->next) XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); #if BAR_SYSTRAY_PATCH drawbarwin(systray->bar); #endif // BAR_SYSTRAY_PATCH - #endif // BAR_GAPS_PADDING_PATCH + #endif // BAR_PADDING_VANITYGAPS_PATCH arrange(NULL); } diff --git a/patches.def.h b/patches.def.h index 3d59e2e..dbd133d 100644 --- a/patches.def.h +++ b/patches.def.h @@ -347,11 +347,12 @@ */ #define BAR_PADDING_PATCH 0 -/* Same as barpadding patch but specifically written for the vanitygaps patch. It adds the same - * outer horizontal and vertical padding as vanity gaps. Moreover, the padding is toggled whenever - * vanitygaps are toggled. +/* Same as barpadding patch but specifically tailored for the vanitygaps patch in that the outer + * bar padding is derived from the vanitygaps settings. In addition to this the bar padding is + * toggled in unison when vanitygaps are toggled. Increasing or decreasing gaps during runtime + * will not affect the bar padding. */ -#define BAR_GAPS_PADDING_PATCH 0 +#define BAR_PADDING_VANITYGAPS_PATCH 0 /* This patch adds simple markup for status messages using pango markup. * This depends on the pango library v1.44 or greater.