diff options
| author | Anselm R Garbe <anselm@garbe.us> | 2010-04-01 00:14:15 +0100 |
|---|---|---|
| committer | Anselm R Garbe <anselm@garbe.us> | 2010-04-01 00:14:15 +0100 |
| commit | aa9f2be24ea9ea6d9419cad1975bf34c5b64b6e5 (patch) | |
| tree | 5bde4c862fd4e25b886468c910c61537b1dffa93 /dwm.c | |
| parent | quick typo fix (diff) | |
| download | dwm-aa9f2be24ea9ea6d9419cad1975bf34c5b64b6e5.tar.gz dwm-aa9f2be24ea9ea6d9419cad1975bf34c5b64b6e5.zip | |
more debug output, experimental focus optimisation
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 13 |
1 files changed, 9 insertions, 4 deletions
| @@ -815,8 +815,12 @@ void | |||
| 815 | focus(Client *c) { | 815 | focus(Client *c) { |
| 816 | if(!c || !ISVISIBLE(c)) | 816 | if(!c || !ISVISIBLE(c)) |
| 817 | for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); | 817 | for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); |
| 818 | /* if(selmon->sel) | 818 | if(c && c == selmon->sel) { |
| 819 | unfocus(selmon->sel);*/ | 819 | D fprintf(stderr, "focus, optimising focus away\n"); |
| 820 | return; | ||
| 821 | } | ||
| 822 | if(selmon->sel) | ||
| 823 | unfocus(selmon->sel); | ||
| 820 | if(c) { | 824 | if(c) { |
| 821 | if(c->mon != selmon) | 825 | if(c->mon != selmon) |
| 822 | selmon = c->mon; | 826 | selmon = c->mon; |
| @@ -848,7 +852,8 @@ focusmon(const Arg *arg) { | |||
| 848 | 852 | ||
| 849 | if(!mons->next) | 853 | if(!mons->next) |
| 850 | return; | 854 | return; |
| 851 | m = dirtomon(arg->i); | 855 | if((m = dirtomon(arg->i)) == selmon) |
| 856 | return; | ||
| 852 | unfocus(selmon->sel); | 857 | unfocus(selmon->sel); |
| 853 | selmon = m; | 858 | selmon = m; |
| 854 | focus(NULL); | 859 | focus(NULL); |
| @@ -1406,7 +1411,7 @@ run(void) { | |||
| 1406 | /* main event loop */ | 1411 | /* main event loop */ |
| 1407 | XSync(dpy, False); | 1412 | XSync(dpy, False); |
| 1408 | while(running && !XNextEvent(dpy, &ev)) { | 1413 | while(running && !XNextEvent(dpy, &ev)) { |
| 1409 | D fprintf(stderr, "run event %s\n", evname[ev.type]); | 1414 | D fprintf(stderr, "run event %s %ld\n", evname[ev.type], ev.xany.window); |
| 1410 | if(handler[ev.type]) | 1415 | if(handler[ev.type]) |
| 1411 | handler[ev.type](&ev); /* call handler */ | 1416 | handler[ev.type](&ev); /* call handler */ |
| 1412 | } | 1417 | } |
