tcmd/devdraw: clear keyboard state on lost focus. - plan9port - [fork] Plan 9 f… | |
git clone git://src.adamsgaard.dk/plan9port | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit d74fdb6edbedbb184de9a8230e156460cb609aa6 | |
parent 3d31240bfdaee03aff28103b530ff593e9ddbbc5 | |
Author: Roger Peppe <[email protected]> | |
Date: Wed, 17 Jul 2013 17:55:09 +0100 | |
cmd/devdraw: clear keyboard state on lost focus. | |
See https://bitbucket.org/rsc/plan9port/issue/128/alt-button-sticks-in-acme-som… | |
R=rsc | |
https://codereview.appspot.com/11453043 | |
Diffstat: | |
M CONTRIBUTORS | 1 + | |
M src/cmd/devdraw/x11-srv.c | 6 ++++++ | |
2 files changed, 7 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/CONTRIBUTORS b/CONTRIBUTORS | |
t@@ -40,6 +40,7 @@ Peter Saveliev <[email protected]> | |
Richard Miller <[email protected]> | |
Rob Kroeger <[email protected]> | |
Rob Pike <[email protected]> | |
+Roger Peppe <[email protected]> | |
Russ Cox <[email protected]> | |
Sean McKean <[email protected]> | |
Shenghou Ma <[email protected]> | |
diff --git a/src/cmd/devdraw/x11-srv.c b/src/cmd/devdraw/x11-srv.c | |
t@@ -619,6 +619,12 @@ runxevent(XEvent *xev) | |
break; | |
case FocusOut: | |
+ /* | |
+ * Some key combinations (e.g. Alt-Tab) can cause us | |
+ * to see the key down event without the key up event, | |
+ * so clear out the keyboard state when we lose the focus. | |
+ */ | |
+ kstate = 0; | |
abortcompose(); | |
break; | |