changeset: 1981:18c1736806e7
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Thu Mar 01 16:37:00 2007 -0500
summary: Fix flicker on keyboard focus change.
diff -r cd308347b379 -r 18c1736806e7 event.c
--- a/event.c Thu Mar 01 15:20:53 2007 -0500
+++ b/event.c Thu Mar 01 16:37:00 2007 -0500
@@ -298,12 +298,12 @@ expose(XEvent *e) {
static void
keypress(XEvent *e) {
+ XEvent me;
XKeyEvent *ev = &e->xkey;
+ Frame *f;
KeySym k = 0;
char buf[32];
int n;
- static Frame *f;
-
ev->state &= valid_mask;
if((f = frame_of_win(ev->window))) {
@@ -314,8 +314,12 @@ keypress(XEvent *e) {
return;
buf[n] = 0;
}
- else
+ else {
+ while(XCheckMaskEvent(blz.dpy, FocusChangeMask, &me))
+ if(me.xfocus.mode != NotifyGrab)
+ handler[me.type](&me);
kpress(blz.root, ev->state, (KeyCode) ev->keycode);
+ }
}
static void
Received on Thu Mar 01 2007 - 22:37:11 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:02 UTC