From ce1e6e2a367a606b00d218fc87e9473a2c518fd7 Mon Sep 17 00:00:00 2001 From: speediegq Date: Wed, 5 Oct 2022 14:23:01 +0200 Subject: [PATCH] Update: Pertag vanitygaps causes windows to spawn outside the screen, so it has been disabled for now. --- speedwm.c | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/speedwm.c b/speedwm.c index 52c3238..c239253 100644 --- a/speedwm.c +++ b/speedwm.c @@ -2655,8 +2655,6 @@ setgaps(int oh, int ov, int ih, int iv) selmon->gappih = ih; selmon->gappiv = iv; - selmon->pertag->gaps[selmon->pertag->curtag] = ((oh & 0xFF) << 0) | ((ov & 0xFF) << 8) | ((ih & 0xFF) << 16) | ((iv & 0xFF) << 24); - arrange(selmon); } @@ -5545,35 +5543,38 @@ view(const Arg *arg) for (m = mons; m; m = m->next) m->seltags ^= 1; if (arg->ui & TAGMASK) { - for (m = mons; m; m = m->next) - m->tagset[m->seltags] = arg->ui & TAGMASK; + for (m = mons; m; m = m->next) + m->tagset[m->seltags] = arg->ui & TAGMASK; - if (pertag) { - selmon->pertag->prevtag = selmon->pertag->curtag; + selmon->pertag->prevtag = selmon->pertag->curtag; - if (arg->ui == ~0) - selmon->pertag->curtag = 0; - else { - for (i = 0; !(arg->ui & 1 << i); i++) ; - selmon->pertag->curtag = i + 1; - } - } else { - tmptag = selmon->pertag->prevtag; + if (arg->ui == ~0) + selmon->pertag->curtag = 0; + else { + for (i = 0; !(arg->ui & 1 << i); i++) ; + selmon->pertag->curtag = i + 1; + } + tmptag = selmon->pertag->prevtag; + + if (pertag) { selmon->pertag->prevtag = selmon->pertag->curtag; selmon->pertag->curtag = tmptag; + + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; + selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; + selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; + selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; + + /* + * Temp removed because these lines cause the first spawned window to tile outside the screen + selmon->gappoh = selmon->pertag->gaps[selmon->pertag->curtag]; + selmon->gappov = selmon->pertag->gaps[selmon->pertag->curtag]; + selmon->gappih = selmon->pertag->gaps[selmon->pertag->curtag]; + selmon->gappiv = selmon->pertag->gaps[selmon->pertag->curtag]; + */ } - selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; - selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; - selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; - selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; - - selmon->gappoh = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff) >> 0; - selmon->gappov = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff00) >> 8; - selmon->gappih = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff0000) >> 16; - selmon->gappiv = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff000000) >> 24; - if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) togglebar(NULL);