X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/c53b29e60b1fcc0f7f095eaabccf38b3630e28fa..a88e0373efe5f6800a99fca2c228be98b522aaa9:/dwm.c?ds=sidebyside diff --git a/dwm.c b/dwm.c index b989e8a..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 */ }