[hackers] [wmii] Fix flicker on press of grabbed key.

From: Kris Maglione <jg_AT_suckless.org>
Date: Mon Jun 11 19:15:47 2007

changeset: 2159:025b467a0f17
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Jun 11 13:13:49 2007 -0400
summary: Fix flicker on press of grabbed key.

diff -r 243ed0c354bd -r 025b467a0f17 cmd/wmii/client.c
--- a/cmd/wmii/client.c Mon Jun 11 12:04:50 2007 -0400
+++ b/cmd/wmii/client.c Mon Jun 11 13:13:49 2007 -0400
@@ -690,10 +690,8 @@ focusout_event(Window *w, XFocusChangeEv
 
         c = w->aux;
         if((e->mode == NotifyWhileGrabbed) && (screen->hasgrab != &c_root)) {
- if((screen->focus) && (screen->hasgrab != screen->focus))
+ if(screen->focus)
                         screen->hasgrab = screen->focus;
- if(screen->hasgrab == c)
- return;
         }else if(screen->focus == c) {
                 print_focus(&c_magic, "<magic>");
                 screen->focus = &c_magic;
diff -r 243ed0c354bd -r 025b467a0f17 cmd/wmii/event.c
--- a/cmd/wmii/event.c Mon Jun 11 12:04:50 2007 -0400
+++ b/cmd/wmii/event.c Mon Jun 11 13:13:49 2007 -0400
@@ -165,7 +165,6 @@ focusin(XEvent *e) {
                         if(XCheckMaskEvent(display, KeyPressMask, &me)) {
                                 /* wmii has grabbed focus */
                                 screen->hasgrab = &c_root;
- flushevents(FocusChangeMask, True);
                                 dispatch_event(&me);
                         }
                 /* Some unmanaged window has grabbed focus */
diff -r 243ed0c354bd -r 025b467a0f17 cmd/wmii/key.c
--- a/cmd/wmii/key.c Mon Jun 11 12:04:50 2007 -0400
+++ b/cmd/wmii/key.c Mon Jun 11 13:13:49 2007 -0400
@@ -199,13 +199,13 @@ kpress(XWindow w, ulong mod, KeyCode key
         for(k=key; k; k=k->lnext)
                  k->tnext=k->lnext;
         found = match_keys(key, mod, keycode, False);
- if(!found) {
+ if(!found) /* grabbed but not found */
                 XBell(display, 0);
- } /* grabbed but not found */
         else if(!found->tnext && !found->next)
                 write_event("Key %s\n", found->name);
         else {
                 XGrabKeyboard(display, w, True, GrabModeAsync, GrabModeAsync, CurrentTime);
+ flushevents(FocusChangeMask, True);
                 kpress_seq(w, found);
                 XUngrabKeyboard(display, CurrentTime);
                 XSync(display, False);
diff -r 243ed0c354bd -r 025b467a0f17 man/wmii.1
--- a/man/wmii.1 Mon Jun 11 12:04:50 2007 -0400
+++ b/man/wmii.1 Mon Jun 11 13:13:49 2007 -0400
@@ -1,5 +1,5 @@
 '\" t
-.\" Manual page created with latex2man on Mon Jun 11 12:04:08 EDT 2007
+.\" Manual page created with latex2man on Mon Jun 11 12:08:17 EDT 2007
 .\" NOTE: This file is generated, DO NOT EDIT.
 .de Vb
 .ft CW
@@ -398,8 +398,7 @@ Rules have the form:
 \fB \fP
 .br
 \fB \fP\fB \fP/\fIregex\fP/
-\-> \fIwidth\fP[\fI+width\&...
-\fP]
+\-> \fIwidth\fP[\fI+width...\fP]
 .br
 \fB \fP
 .br
@@ -425,8 +424,7 @@ Rules are specified:
 \fB \fP
 .br
 \fB \fP\fB \fP/\fIregex\fP/
-\-> \fItag\fP[\fI+tag\&...
-\fP]
+\-> \fItag\fP[\fI+tag...\fP]
 .br
 \fB \fP
 .br
@@ -484,7 +482,8 @@ A left or right bar has been clicked or
 A left or right bar has been clicked or has a
 button pressed over it.
 .TP
-\&...To be continued\&...
+\&.\&.\&.
+To be continued...
 .RE
 .RS
 .PP
diff -r 243ed0c354bd -r 025b467a0f17 man/wmii.tex
--- a/man/wmii.tex Mon Jun 11 12:04:50 2007 -0400
+++ b/man/wmii.tex Mon Jun 11 13:13:49 2007 -0400
@@ -196,7 +196,7 @@ follows.
         rules which affect the width of newly created columns.
         Rules have the form: \\ \SP % Yuck!
         \MANbr
- \SP\SP /\Arg{regex}/ -> \Arg{width}\oArg{+width\Dots} \\ \SP
+ \SP\SP /\Arg{regex}/ -> \Arg{width}\oArg{+width...} \\ \SP
         \MANbr
         When a new column, \Arg{n}, is created on a view whose
         name matches \Arg{regex}, the \Arg{n}th given
@@ -208,7 +208,7 @@ follows.
         the tags a client is to be given when it is created.
         Rules are specified: \\ \SP
         \MANbr
- \SP\SP /\Arg{regex}/ -> \Arg{tag}\oArg{+tag\Dots} \\ \SP
+ \SP\SP /\Arg{regex}/ -> \Arg{tag}\oArg{+tag...} \\ \SP
         \MANbr
         When a client's \Arg{name}:\Arg{class}:\Arg{title}
         matches \Arg{regex}, it is given the tagstring
@@ -240,7 +240,7 @@ follows.
         \item[\emph{Left\Bar Right}Bar\emph{Click\Bar MouseDown} \Arg{button} \Arg{bar}]
                 A left or right bar has been clicked or has a
                 button pressed over it.
- \item[\Dots] To be continued\Dots
+ \item[...] To be continued...
         \end{description}
 \item[ctl] The \emph{ctl} file takes a number of messages to
         change global settings such as color and font, which can
Received on Mon Jun 11 2007 - 19:15:47 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:18 UTC