From 7b876932a7b65bc1dd13a4187bbbc03a16740dcd Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 13 Oct 2019 17:45:44 +0300 Subject: [PATCH] docs: update --- sowm.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/sowm.c b/sowm.c index 93ff0ba..87b379e 100644 --- a/sowm.c +++ b/sowm.c @@ -91,7 +91,8 @@ void notify_destroy(XEvent *e) { } void notify_enter(XEvent *e) { - XSetInputFocus(dis, e->xcrossing.window, RevertToParent, CurrentTime); + if (e->xcrossing.window != root) + XSetInputFocus(dis, e->xcrossing.window, RevertToParent, CurrentTime); } void notify_motion(XEvent *e) { @@ -207,7 +208,12 @@ void win_del(Window w) { void win_kill() { Window cur = win_current(); - if (cur != root) XKillClient(dis, cur); + if (cur != root) { + XKillClient(dis, cur); + win_del(cur); + + if (list) XSetInputFocus(dis, list->win, RevertToParent, CurrentTime); + } } void win_center(Window w) { @@ -248,20 +254,20 @@ void win_to_ws(const Arg arg) { win_del(cur); XUnmapWindow(dis, cur); ws_save(tmp); + + if (list) XSetInputFocus(dis, list->win, RevertToParent, CurrentTime); } void win_next() { Window cur = win_current(); client *c; - if (list) { - if (cur == root) cur = list->win; + if (cur == root) return; + if (list) { for WIN if (c->win == cur) break; - c = c->next; - - if (!c) c = list; + c = c->next ? c->next : list; XSetInputFocus(dis, c->win, RevertToParent, CurrentTime); XRaiseWindow(dis, c->win);