[hackers] [dwm] more debug output, experimental focus optimisation || Anselm R Garbe

From: <hg_AT_suckless.org>
Date: Wed, 31 Mar 2010 23:14:21 +0000 (UTC)

changeset: 1510:e9c916f6ea15
tag: tip
user: Anselm R Garbe <anselm_AT_garbe.us>
date: Thu Apr 01 00:14:15 2010 +0100
files: dwm.c
description:
more debug output, experimental focus optimisation

diff -r 7830e13337e9 -r e9c916f6ea15 dwm.c
--- a/dwm.c Wed Mar 31 23:27:30 2010 +0100
+++ b/dwm.c Thu Apr 01 00:14:15 2010 +0100
@@ -815,8 +815,12 @@
 focus(Client *c) {
         if(!c || !ISVISIBLE(c))
                 for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
-/* if(selmon->sel)
- unfocus(selmon->sel);*/
+ if(c && c == selmon->sel) {
+ D fprintf(stderr, "focus, optimising focus away\n");
+ return;
+ }
+ if(selmon->sel)
+ unfocus(selmon->sel);
         if(c) {
                 if(c->mon != selmon)
                         selmon = c->mon;
@@ -848,7 +852,8 @@
 
         if(!mons->next)
                 return;
- m = dirtomon(arg->i);
+ if((m = dirtomon(arg->i)) == selmon)
+ return;
         unfocus(selmon->sel);
         selmon = m;
         focus(NULL);
@@ -1406,7 +1411,7 @@
         /* 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 */
         }
Received on Wed Mar 31 2010 - 23:14:21 UTC

This archive was generated by hypermail 2.2.0 : Wed Mar 31 2010 - 23:24:06 UTC