mfwm

A tiling fork of dylanaraps sowm.
git clone git://depsterr.com/git/mfwm
Log | Files | Refs | README | LICENSE

commit 3272bb9256aef80e054fe6f620dbb76f702780a3
parent 60ee489f450a9208a4bf497f2e3245a465ef7393
Author: depsterr <depsterr@protonmail.com>
Date:   Tue, 16 Jun 2020 01:44:23 +0200

first sucessfull compile

Diffstat:
A.config.h.swp | 0
Msowm.c | 29+++++++++++++----------------
Msowm.h | 2++
3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/.config.h.swp b/.config.h.swp Binary files differ. diff --git a/sowm.c b/sowm.c @@ -279,7 +279,6 @@ int main(void) { } void client_focus(client* c) { - client *c; if (list) { list->prev->next = c; @@ -295,9 +294,16 @@ void client_focus(client* c) { } void organize() { + if (!list) return; + int n = 0; + for win n++; + + if (!n) + return; + int i, nx, ny, nw, nh; nx = wx; @@ -305,45 +311,36 @@ void organize() { nw = ww - gappx; nh = wh - gappx; + i = 0; + for win { - if((i % 2 && nh / 2 > 2 * c->bw) - || (!(i % 2) && nw / 2 > 2 * c->bw)) { + if (i % 2) { if(i < n - 1) { if(i % 2) nh /= 2; else nw /= 2; - if((i % 4) == 2 && !s) - nx += nw; - else if((i % 4) == 3 && !s) - ny += nh; } if((i % 4) == 0) { - if(s) ny += nh; - else - ny -= nh; } else if((i % 4) == 1) nx += nw; else if((i % 4) == 2) ny += nh; else if((i % 4) == 3) { - if(s) nx += nw; - else - nx -= nw; } if(i == 0) { if(n != 1) nw = mfact; - ny = mon->wy; + ny = wy; } else if(i == 1) - nw = mon->ww - nw - gappx; + nw = ww - nw - gappx; i++; } - resize(c, nx + gappx, ny + gappx, nw - 2 * c->bw - gappx, nh - 2 * c->bw - gappx, False); + XMoveResizeWindow(d, c->w, nx + gappx, ny + gappx, nw - gappx, nh - gappx); } } diff --git a/sowm.h b/sowm.h @@ -35,6 +35,7 @@ typedef struct client { void button_press(XEvent *e); void button_release(XEvent *e); +void client_focuse(client *c); void configure_request(XEvent *e); void input_grab(Window root); void key_press(XEvent *e); @@ -42,6 +43,7 @@ void map_request(XEvent *e); void notify_destroy(XEvent *e); void notify_enter(XEvent *e); void notify_motion(XEvent *e); +void organize(); void run(const Arg arg); void win_add(Window w); void win_center(const Arg arg);