From 692affcff7593f718db827edf70a2b130725a1f3 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Tue, 31 Mar 2020 09:07:00 +0200 Subject: [PATCH] dragcfact and dragmfact improvements --- patch/cfacts.c | 2 ++ patch/dragcfact.c | 3 ++- patch/dragmfact.c | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/patch/cfacts.c b/patch/cfacts.c index 223436f..ece210f 100644 --- a/patch/cfacts.c +++ b/patch/cfacts.c @@ -10,6 +10,8 @@ setcfact(const Arg *arg) return; if (!arg->f) f = 1.0; + else if (arg->f > 4.0) // set fact absolutely + f = arg->f - 4.0; else f = arg->f + c->cfact; if (f < 0.25) diff --git a/patch/dragcfact.c b/patch/dragcfact.c index 98e2e31..9d20a2b 100644 --- a/patch/dragcfact.c +++ b/patch/dragcfact.c @@ -57,7 +57,8 @@ dragcfact(const Arg *arg) fact = (float) -4.0 * dist_y / c->mon->wh; } - setcfact(&((Arg) { .f = fact })); + if (fact) + setcfact(&((Arg) { .f = fact })); prev_x = ev.xmotion.x; prev_y = ev.xmotion.y; diff --git a/patch/dragmfact.c b/patch/dragmfact.c index ee76647..444557c 100644 --- a/patch/dragmfact.c +++ b/patch/dragmfact.c @@ -28,28 +28,28 @@ dragmfact(const Arg *arg) if (!m->lt[m->sellt]->arrange // floating || (m->nmaster && n <= m->nmaster) // no master #if MONOCLE_LAYOUT - || m->lt[m->sellt]->arrange == monocle + || m->lt[m->sellt]->arrange == &monocle #endif // MONOCLE_LAYOUT #if GRIDMODE_LAYOUT - || m->lt[m->sellt]->arrange == grid + || m->lt[m->sellt]->arrange == &grid #endif // GRIDMODE_LAYOUT #if HORIZGRID_LAYOUT - || m->lt[m->sellt]->arrange == horizgrid + || m->lt[m->sellt]->arrange == &horizgrid #endif // HORIZGRID_LAYOUT #if GAPPLESSGRID_LAYOUT - || m->lt[m->sellt]->arrange == gaplessgrid + || m->lt[m->sellt]->arrange == &gaplessgrid #endif // GAPPLESSGRID_LAYOUT #if NROWGRID_LAYOUT - || m->lt[m->sellt]->arrange == nrowgrid + || m->lt[m->sellt]->arrange == &nrowgrid #endif // NROWGRID_LAYOUT #if FLEXTILE_DELUXE_LAYOUT - || (m->lt[m->sellt]->arrange == flextile && m->ltaxis[LAYOUT] == NO_SPLIT) + || (m->lt[m->sellt]->arrange == &flextile && m->ltaxis[LAYOUT] == NO_SPLIT) #endif // FLEXTILE_DELUXE_LAYOUT ) return; #if FLEXTILE_DELUXE_LAYOUT - if (m->lt[m->sellt]->arrange == flextile) { + if (m->lt[m->sellt]->arrange == &flextile) { int layout = m->ltaxis[LAYOUT]; if (layout < 0) { mirror = 1; @@ -74,19 +74,19 @@ dragmfact(const Arg *arg) } #endif // FLEXTILE_DELUXE_LAYOUT #if CENTEREDMASTER_LAYOUT - else if (m->lt[m->sellt]->arrange == centeredmaster) + else if (m->lt[m->sellt]->arrange == ¢eredmaster) center = 1; #endif // CENTEREDMASTER_LAYOUT #if CENTEREDFLOATINGMASTER_LAYOUT - else if (m->lt[m->sellt]->arrange == centeredfloatingmaster) + else if (m->lt[m->sellt]->arrange == ¢eredfloatingmaster) center = 1; #endif // CENTEREDFLOATINGMASTER_LAYOUT #if BSTACK_LAYOUT - else if (m->lt[m->sellt]->arrange == bstack) + else if (m->lt[m->sellt]->arrange == &bstack) horizontal = 1; #endif // BSTACK_LAYOUT #if BSTACKHORIZ_LAYOUT - else if (m->lt[m->sellt]->arrange == bstackhoriz) + else if (m->lt[m->sellt]->arrange == &bstackhoriz) horizontal = 1; #endif // BSTACKHORIZ_LAYOUT