docs: update

This commit is contained in:
Dylan Araps 2019-10-11 22:33:01 +03:00
parent 8351d8c0dd
commit 1adf23af8c
1 changed files with 31 additions and 33 deletions

64
sowm.c
View File

@ -97,22 +97,20 @@ void win_add(Window w) {
exit(1);
if (head == NULL) {
c->next = NULL;
c->prev = NULL;
c->win = w;
head = c;
}
else {
for (t=head;t->next;t=t->next);
c->next = NULL;
c->prev = t;
c->win = w;
t->next = c;
}
cur = c;
c->next = NULL;
c->win = w;
cur = c;
}
void ws_go(const Arg arg) {
@ -314,39 +312,39 @@ void win_del(Window w) {
client *c;
for(c=head;c;c=c->next) {
if (c->win == w) {
if (c->prev == NULL && c->next == NULL) {
free(head);
if (c->win != w) continue;
head = NULL;
cur = NULL;
if (c->prev == NULL && c->next == NULL) {
free(head);
ws_save(curr_desk);
return;
}
head = NULL;
cur = NULL;
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;
}
}
@ -415,7 +413,7 @@ void wm_init() {
start.subwindow = None;
while(!XNextEvent(dis,&ev))
while(1 && !XNextEvent(dis,&ev))
if (events[ev.type]) events[ev.type](&ev);
}