JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
ignore client requests to get focus
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index f8467d6..a04e2b6 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -547,6 +547,7 @@ clientmessage(XEvent *e) {
                                      || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
        }
        else if(cme->message_type == netatom[NetActiveWindow]) {
+               return;
                if(!ISVISIBLE(c)) {
                        c->mon->seltags ^= 1;
                        c->mon->tagset[c->mon->seltags] = c->tags;
@@ -695,9 +696,10 @@ detachstack(Client *c) {
                // WARNING if you detach() before detachstack() this will select last visible window
                for(i = nextvisible(c->mon->clients); i && i != c; i = nextvisible(i->next))
                        next_sel = i;
-               // failing that, find first visible window
+               // failing that, find first visible window (besides c)
                if (!next_sel)
-                       for(i = nextvisible(c->mon->clients); i && i != c; i = nextvisible(i->next))
+                       for(i = nextvisible(c->mon->clients); i && i == c; i = nextvisible(i->next));
+                       if (i != c)
                                next_sel = i;
                c->mon->sel = next_sel;
        }