commit d74fdb6edbedbb184de9a8230e156460cb609aa6 from: Roger Peppe date: Wed Jul 17 16:55:09 2013 UTC 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 commit - 3d31240bfdaee03aff28103b530ff593e9ddbbc5 commit + d74fdb6edbedbb184de9a8230e156460cb609aa6 blob - 73171a95eeb540000a288251bbc7051b086d8b39 blob + c49c9cdbd584f76c4a6860c17487e47d48fea1b7 --- CONTRIBUTORS +++ CONTRIBUTORS @@ -40,6 +40,7 @@ Peter Saveliev Richard Miller Rob Kroeger Rob Pike +Roger Peppe Russ Cox Sean McKean Shenghou Ma blob - 04ecabee93717033a159f842e6749653556c7463 blob + b934391316eb9f8a978604b02069eabe2374a3f5 --- src/cmd/devdraw/x11-srv.c +++ 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;