mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-05-19 01:20:23 -07:00
sowm: simpler window add
This commit is contained in:
parent
f10cec8509
commit
493302d38b
19
sowm.c
19
sowm.c
@ -130,24 +130,21 @@ void button_release() {
|
||||
}
|
||||
|
||||
void win_add(Window w) {
|
||||
client *c, *t;
|
||||
client *c, *t = list;
|
||||
|
||||
if (!(c = (client *) calloc(1, sizeof(client))))
|
||||
exit(1);
|
||||
|
||||
if (!list) {
|
||||
c->next = c->prev = 0;
|
||||
c->w = w;
|
||||
list = c;
|
||||
c->w = w;
|
||||
|
||||
} else {
|
||||
for (t=list;t->next;t=t->next);
|
||||
if (list) {
|
||||
while (t->next) t = t->next;
|
||||
|
||||
c->next = 0;
|
||||
c->prev = t;
|
||||
c->w = w;
|
||||
t->next = c;
|
||||
}
|
||||
c->prev = t;
|
||||
|
||||
} else
|
||||
list = c;
|
||||
|
||||
ws_save(ws);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user