diff options
| author | bakkeby <[email protected]> | 2020-06-29 11:03:25 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-06-29 11:03:25 +0200 |
| commit | 347e6ace9114e6bf971549c01454859cfbad79c7 (patch) | |
| tree | 37f5ab5015eeaadb06aff44ccf64e8529a727536 /patch | |
| parent | c14a51524b103de1068391786d9643a8af77f796 (diff) | |
| download | dwm-flexipatch-347e6ace9114e6bf971549c01454859cfbad79c7.tar.gz dwm-flexipatch-347e6ace9114e6bf971549c01454859cfbad79c7.zip | |
dragmfact: Tweaks for fixed horizontal split
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/dragmfact.c | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/patch/dragmfact.c b/patch/dragmfact.c index 26867f5..0532f2f 100644 --- a/patch/dragmfact.c +++ b/patch/dragmfact.c @@ -4,7 +4,7 @@ dragmfact(const Arg *arg) unsigned int n; int py, px; // pointer coordinates int ax, ay, aw, ah; // area position, width and height - int center = 0, horizontal = 0, mirror = 0; // layout configuration + int center = 0, horizontal = 0, mirror = 0, fixed = 0; // layout configuration double fact; Monitor *m; XEvent ev; @@ -25,30 +25,6 @@ dragmfact(const Arg *arg) ah = m->wh; aw = m->ww; - /* do not allow mfact to be modified under certain conditions */ - if (!m->lt[m->sellt]->arrange // floating - || (m->nmaster && n <= m->nmaster) // no master - #if MONOCLE_LAYOUT - || m->lt[m->sellt]->arrange == &monocle - #endif // MONOCLE_LAYOUT - #if GRIDMODE_LAYOUT - || m->lt[m->sellt]->arrange == &grid - #endif // GRIDMODE_LAYOUT - #if HORIZGRID_LAYOUT - || m->lt[m->sellt]->arrange == &horizgrid - #endif // HORIZGRID_LAYOUT - #if GAPPLESSGRID_LAYOUT - || m->lt[m->sellt]->arrange == &gaplessgrid - #endif // GAPPLESSGRID_LAYOUT - #if NROWGRID_LAYOUT - || m->lt[m->sellt]->arrange == &nrowgrid - #endif // NROWGRID_LAYOUT - #if FLEXTILE_DELUXE_LAYOUT - || (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) { int layout = m->ltaxis[LAYOUT]; @@ -56,12 +32,14 @@ dragmfact(const Arg *arg) mirror = 1; layout *= -1; } - if (layout > FLOATING_MASTER) + if (layout > FLOATING_MASTER) { layout -= FLOATING_MASTER; + fixed = 1; + } if (layout == SPLIT_HORIZONTAL || layout == SPLIT_HORIZONTAL_DUAL_STACK) horizontal = 1; - else if (layout == SPLIT_CENTERED_VERTICAL && (n - m->nmaster) > 1) + else if (layout == SPLIT_CENTERED_VERTICAL && (fixed || n - m->nmaster > 1)) center = 1; else if (layout == FLOATING_MASTER) { center = 1; @@ -69,13 +47,14 @@ dragmfact(const Arg *arg) horizontal = 1; } else if (layout == SPLIT_CENTERED_HORIZONTAL) { + if (fixed || n - m->nmaster > 1) + center = 1; horizontal = 1; - center = 1; } } #endif // FLEXTILE_DELUXE_LAYOUT #if CENTEREDMASTER_LAYOUT - else if (m->lt[m->sellt]->arrange == ¢eredmaster && (n - m->nmaster) > 1) + else if (m->lt[m->sellt]->arrange == ¢eredmaster && (fixed || n - m->nmaster > 1)) center = 1; #endif // CENTEREDMASTER_LAYOUT #if CENTEREDFLOATINGMASTER_LAYOUT @@ -91,6 +70,30 @@ dragmfact(const Arg *arg) horizontal = 1; #endif // BSTACKHORIZ_LAYOUT + /* do not allow mfact to be modified under certain conditions */ + if (!m->lt[m->sellt]->arrange // floating layout + || (!n || (!fixed && m->nmaster && n <= m->nmaster)) // no master + #if MONOCLE_LAYOUT + || m->lt[m->sellt]->arrange == &monocle + #endif // MONOCLE_LAYOUT + #if GRIDMODE_LAYOUT + || m->lt[m->sellt]->arrange == &grid + #endif // GRIDMODE_LAYOUT + #if HORIZGRID_LAYOUT + || m->lt[m->sellt]->arrange == &horizgrid + #endif // HORIZGRID_LAYOUT + #if GAPPLESSGRID_LAYOUT + || m->lt[m->sellt]->arrange == &gaplessgrid + #endif // GAPPLESSGRID_LAYOUT + #if NROWGRID_LAYOUT + || m->lt[m->sellt]->arrange == &nrowgrid + #endif // NROWGRID_LAYOUT + #if FLEXTILE_DELUXE_LAYOUT + || (m->lt[m->sellt]->arrange == &flextile && m->ltaxis[LAYOUT] == NO_SPLIT) + #endif // FLEXTILE_DELUXE_LAYOUT + ) + return; + #if VANITYGAPS_PATCH ay += oh; ax += ov; |
