Fixed minor cross-compatibility issues for combo, holdbar, leftlayout, hidevacanttags, taggrid and activetagindicatorbar

This commit is contained in:
bakkeby 2019-10-08 00:54:06 +02:00
parent ca8638128f
commit 83242012da
6 changed files with 98 additions and 7 deletions

View File

@ -13,7 +13,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog:
2019-10-07 - Added sortscreens and dwmc patches
2019-10-07 - Added sortscreens and dwmc patches, fixed minor cross-compatibility issues for combo, holdbar, leftlayout, hidevacanttags, taggrid and activetagindicatorbar
2019-10-06 - Added statuscolors and statusallmons patches, fixed minor cross-compatibility issues for killunsel, fullscreen, noborder, tagintostack patches

View File

@ -267,6 +267,45 @@ static const Layout layouts[] = {
{ "[\\]", flextile, { -1, -1, NO_SPLIT, DWINDLE, 0, 0, NULL } }, // fibonacci dwindle
{ "(@)", flextile, { -1, -1, NO_SPLIT, SPIRAL, 0, 0, NULL } }, // fibonacci spiral
{ "|||", flextile, { -1, -1, SPLIT_VERTICAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, 0, NULL } }, // columns (col) layout
#if TILE_LAYOUT
{ "[]=", tile, {0} },
#endif
#if MONOCLE_LAYOUT
{ "[M]", monocle, {0} },
#endif
#if BSTACK_LAYOUT
{ "TTT", bstack, {0} },
#endif
#if BSTACKHORIZ_LAYOUT
{ "===", bstackhoriz, {0} },
#endif
#if CENTEREDMASTER_LAYOUT
{ "|M|", centeredmaster, {0} },
#endif
#if CENTEREDFLOATINGMASTER_LAYOUT
{ ">M>", centeredfloatingmaster, {0} },
#endif
#if DECK_LAYOUT
{ "[D]", deck, {0} },
#endif
#if FIBONACCI_SPIRAL_LAYOUT
{ "(@)", spiral, {0} },
#endif
#if FIBONACCI_DWINDLE_LAYOUT
{ "[\\]", dwindle, {0} },
#endif
#if GRIDMODE_LAYOUT
{ "HHH", grid, {0} },
#endif
#if HORIZGRID_LAYOUT
{ "---", horizgrid, {0} },
#endif
#if GAPPLESSGRID_LAYOUT
{ ":::", gaplessgrid, {0} },
#endif
#if NROWGRID_LAYOUT
{ "###", nrowgrid, {0} },
#endif
#if CYCLELAYOUTS_PATCH
{ NULL, NULL, {0} },
#endif
@ -355,6 +394,9 @@ static Key keys[] = {
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
#if SWITCHCOL_PATCH
{ MODKEY, XK_v, switchcol, {0} },
#endif // SWITCHCOL_PATCH
#if ROTATESTACK_PATCH
{ MODKEY|Mod4Mask, XK_j, rotatestack, {.i = +1 } },
{ MODKEY|Mod4Mask, XK_k, rotatestack, {.i = -1 } },
@ -365,6 +407,10 @@ static Key keys[] = {
#endif // PUSH_PATCH / PUSH_NO_MASTER_PATCH
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
#if FLEXTILE_DELUXE_LAYOUT
{ MODKEY|ControlMask, XK_i, incnstack, {.i = +1 } },
{ MODKEY|ControlMask, XK_u, incnstack, {.i = -1 } },
#endif // FLEXTILE_DELUXE_LAYOUT
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
#if CFACTS_PATCH
@ -448,6 +494,9 @@ static Key keys[] = {
#if TOGGLEFULLSCREEN_PATCH
{ MODKEY, XK_y, togglefullscreen, {0} },
#endif // TOGGLEFULLSCREEN_PATCH
#if FULLSCREEN_PATCH
{ MODKEY|ShiftMask, XK_f, fullscreen, {0} },
#endif // FULLSCREEN_PATCH
#if STICKY_PATCH
{ MODKEY, XK_s, togglesticky, {0} },
#endif // STICKY_PATCH

47
dwm.c
View File

@ -636,13 +636,40 @@ buttonpress(XEvent *e)
if (ev->x < x) {
click = ClkLtSymbol;
} else {
do
#if HIDEVACANTTAGS_PATCH
for (c = m->clients; c; c = c->next)
occ |= c->tags == 255 ? 0 : c->tags;
#endif // HIDEVACANTTAGS_PATCH
#if TAGGRID_PATCH
if (drawtagmask & DRAWCLASSICTAGS)
#endif // TAGGRID_PATCH
do {
#if HIDEVACANTTAGS_PATCH
/* do not reserve space for vacant tags */
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
continue;
#endif // HIDEVACANTTAGS_PATCH
x += TEXTW(tags[i]);
while (ev->x >= x && ++i < LENGTH(tags));
} while (ev->x >= x && ++i < LENGTH(tags));
if (i < LENGTH(tags)) {
click = ClkTagBar;
arg.ui = 1 << i;
#if TAGGRID_PATCH
} else if (ev->x < x + columns * bh / tagrows && (drawtagmask & DRAWTAGGRID)) {
click = ClkTagBar;
i = (ev->x - x) / (bh / tagrows);
i = i + columns * (ev->y / (bh / tagrows));
if (i >= LENGTH(tags)) {
i = LENGTH(tags) - 1;
}
arg.ui = 1 << i;
}
else if (ev->x < x + blw + columns * bh / tagrows)
click = ClkLtSymbol;
#else // TAGGRID_PATCH
} else if (ev->x < x + blw)
click = ClkLtSymbol;
#endif // TAGGRID_PATCH
#if AWESOMEBAR_PATCH && SYSTRAY_PATCH
else if (ev->x > selmon->ww - TEXTW(stext) + lrpad - 2 - getsystraywidth())
#elif AWESOMEBAR_PATCH
@ -676,13 +703,13 @@ buttonpress(XEvent *e)
#endif // AWESOMEBAR_PATCH
}
#else // LEFTLAYOUT_PATCH
#if TAGGRID_PATCH
if (drawtagmask & DRAWCLASSICTAGS)
#endif // TAGGRID_PATCH
#if HIDEVACANTTAGS_PATCH
for (c = m->clients; c; c = c->next)
occ |= c->tags == 255 ? 0 : c->tags;
#endif // HIDEVACANTTAGS_PATCH
#if TAGGRID_PATCH
if (drawtagmask & DRAWCLASSICTAGS)
#endif // TAGGRID_PATCH
do {
#if HIDEVACANTTAGS_PATCH
/* do not reserve space for vacant tags */
@ -710,7 +737,7 @@ buttonpress(XEvent *e)
}
else if (ev->x < x + blw + columns * bh / tagrows)
click = ClkLtSymbol;
#else
#else // TAGGRID_PATCH
} else if (ev->x < x + blw)
click = ClkLtSymbol;
#endif // TAGGRID_PATCH
@ -1416,7 +1443,11 @@ drawbar(Monitor *m)
if (tw > 0) /* trap special handling of 0 in drw_text */
drw_text(drw, x, 0, tw, bh, lrpad / 2, c->name, 0);
if (c->isfloating)
#if ACTIVETAGINDICATORBAR_PATCH
drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw, c->isfixed, 0);
#else
drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
#endif // ACTIVETAGINDICATORBAR_PATCH
x += tw;
w -= tw;
}
@ -1437,7 +1468,11 @@ drawbar(Monitor *m)
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
#endif // CENTEREDWINDOWNAME_PATCH
if (m->sel->isfloating)
#if ACTIVETAGINDICATORBAR_PATCH
drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw, m->sel->isfixed, 0);
#else
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
#endif // ACTIVETAGINDICATORBAR_PATCH
} else {
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x, 0, w, bh, 1, 1);

View File

@ -1,10 +1,12 @@
static int combo = 0;
#if !HOLDBAR_PATCH
void
keyrelease(XEvent *e)
{
combo = 0;
}
#endif // !HOLDBAR_PATCH
void
combotag(const Arg *arg)

View File

@ -1,3 +1,5 @@
#if !HOLDBAR_PATCH
static void keyrelease(XEvent *e);
#endif // !HOLDBAR_PATCH
static void combotag(const Arg *arg);
static void comboview(const Arg *arg);

View File

@ -15,6 +15,9 @@ keyrelease(XEvent *e)
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
arrange(selmon);
}
#if COMBO_PATCH
combo = 0;
#endif // COMBO_PATCH
}
void