X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=ac534a8c73f74020056d6942cd1b92f4caea4f99;hp=88d80b2a447be77a7872e2ea3c0a82fb8f44a1cf;hb=1973ab0643707f708a7d6dbede749d5fa6ac1256;hpb=d6bdd03d915ecb800444986503b43aa488a82e36 diff --git a/dwm.c b/dwm.c index 88d80b2..ac534a8 100644 --- a/dwm.c +++ b/dwm.c @@ -815,8 +815,8 @@ void focus(Client *c) { if(!c || !ISVISIBLE(c)) for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); -// if(selmon->sel) -// unfocus(selmon->sel); + if(selmon->sel) + unfocus(selmon->sel); if(c) { if(c->mon != selmon) selmon = c->mon; @@ -848,7 +848,8 @@ focusmon(const Arg *arg) { if(!mons->next) return; - m = dirtomon(arg->i); + if((m = dirtomon(arg->i)) == selmon) + return; unfocus(selmon->sel); selmon = m; focus(NULL); @@ -1406,7 +1407,7 @@ run(void) { /* main event loop */ XSync(dpy, False); while(running && !XNextEvent(dpy, &ev)) { - D fprintf(stderr, "run event %s\n", evname[ev.type]); + D fprintf(stderr, "run event %s %ld\n", evname[ev.type], ev.xany.window); if(handler[ev.type]) handler[ev.type](&ev); /* call handler */ }