mfwm

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

commit 473c4dec545d8fb4dd73773122a928444990c394
parent fe8aa7989b05993c0bcb795bcd8b635d4edc3d82
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Fri, 11 Oct 2019 22:26:52 +0300

docs: update

Diffstat:
Msowm.c | 60++++++++++++++++++++++++++++++------------------------------
1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/sowm.c b/sowm.c @@ -312,39 +312,39 @@ void win_del(Window w) { client *c; for(c=head;c;c=c->next) { - if (c->win != w) continue; - - if (c->prev == NULL && c->next == NULL) { - free(head); - - head = NULL; - cur = NULL; - + if (c->win == w) { + if (c->prev == NULL && c->next == NULL) { + free(head); + + head = NULL; + cur = NULL; + + ws_save(curr_desk); + return; + } + + if (c->prev == NULL) { + head = c->next; + c->next->prev = NULL; + cur = c->next; + } + + else if (c->next == NULL) { + c->prev->next = NULL; + cur = c->prev; + } + + else { + c->prev->next = c->next; + c->next->prev = c->prev; + cur = c->prev; + } + + free(c); ws_save(curr_desk); + win_update(); return; } - - if (c->prev == NULL) { - head = c->next; - c->next->prev = NULL; - cur = c->next; - } - - else if (c->next == NULL) { - c->prev->next = NULL; - cur = c->prev; - } - - else { - c->prev->next = c->next; - c->next->prev = c->prev; - cur = c->prev; - } - - free(c); - ws_save(curr_desk); - win_update(); - return; } }