Hi,

I have been using for a while a hack to fix cwm windows cycle (the traditional
Alt-Tab).  The problem is that I modified the default key binding but the
code actually expects Alt to be the modifier.  The result is that, in some
situations (e.g., after moving to a new group), the window does not get
keyboard input until I hit the Alt key.

The code already uses some funny hack to handle this, but this hack does not
work in my case (I'm using Mod4-Tab).  I'm attaching the patch that seems to
sort this out, but I am not sure if there are any side effects (any x11 expert
around?).

If this solution is ok, I can clean it a little bit and remove the keyrelease
handler and the altpersist member of struct screen_ctx.

Any comments?

Luis Henriques

Index: client.c
===================================================================
RCS file: /cvs/xenocara/app/cwm/client.c,v
retrieving revision 1.91
diff -u -r1.91 client.c
--- client.c    13 Sep 2011 08:41:57 -0000      1.91
+++ client.c    29 Dec 2011 21:51:25 -0000
@@ -641,6 +641,13 @@
        sc->altpersist = 1;
        client_ptrsave(oldcc);
        client_ptrwarp(newcc);
+
+       sc->altpersist = 0;
+       client_mtf(NULL);
+       if (newcc != NULL) {
+               group_sticky_toggle_exit(newcc);
+               XUngrabKeyboard(X_Dpy, CurrentTime);
+       }
 }
 
 static struct client_ctx *
Index: xevents.c
===================================================================
RCS file: /cvs/xenocara/app/cwm/xevents.c,v
retrieving revision 1.56
diff -u -r1.56 xevents.c
--- xevents.c   13 Sep 2011 08:41:57 -0000      1.56
+++ xevents.c   29 Dec 2011 21:51:25 -0000
@@ -324,6 +324,7 @@
        struct client_ctx       *cc;
        int                      keysym;
 
+#if 0
        sc = screen_fromroot(e->root);
        cc = client_current();
 
@@ -343,6 +344,7 @@
                group_sticky_toggle_exit(cc);
                XUngrabKeyboard(X_Dpy, CurrentTime);
        }
+#endif
 }
 
 static void

Reply via email to