diff options
author | Roger Peppe <rogpeppe@gmail.com> | 2013-07-17 17:55:09 +0100 |
---|---|---|
committer | Roger Peppe <rogpeppe@gmail.com> | 2013-07-17 17:55:09 +0100 |
commit | d74fdb6edbedbb184de9a8230e156460cb609aa6 (patch) | |
tree | 0c8fcad4bf60625a0f1bdbdad06960051862c187 | |
parent | 3d31240bfdaee03aff28103b530ff593e9ddbbc5 (diff) | |
download | plan9port-d74fdb6edbedbb184de9a8230e156460cb609aa6.tar.gz plan9port-d74fdb6edbedbb184de9a8230e156460cb609aa6.tar.bz2 plan9port-d74fdb6edbedbb184de9a8230e156460cb609aa6.zip |
cmd/devdraw: clear keyboard state on lost focus.
See https://bitbucket.org/rsc/plan9port/issue/128/alt-button-sticks-in-acme-sometimes-after
R=rsc
https://codereview.appspot.com/11453043
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-srv.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 73171a95..c49c9cdb 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -40,6 +40,7 @@ Peter Saveliev <svinota.saveliev@gmail.com> Richard Miller <millerresearch@gmail.com> Rob Kroeger <robkroeger@gmail.com> Rob Pike <robpike@gmail.com> +Roger Peppe <rogpeppe@gmail.com> Russ Cox <rsc@swtch.com> Sean McKean <smckean83@gmail.com> Shenghou Ma <minux.ma@gmail.com> diff --git a/src/cmd/devdraw/x11-srv.c b/src/cmd/devdraw/x11-srv.c index 04ecabee..b9343913 100644 --- a/src/cmd/devdraw/x11-srv.c +++ b/src/cmd/devdraw/x11-srv.c @@ -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; |