Commit Diff


commit - 3d31240bfdaee03aff28103b530ff593e9ddbbc5
commit + d74fdb6edbedbb184de9a8230e156460cb609aa6
blob - 73171a95eeb540000a288251bbc7051b086d8b39
blob + c49c9cdbd584f76c4a6860c17487e47d48fea1b7
--- CONTRIBUTORS
+++ 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>
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;