shithub: drawterm

Download patch

ref: 51afb6e1319846bf3f1a4ab6cf69fdf7cf3865e1
parent: 5eaaeb08c5ea01c7c0d0473c2b95462536e6bc25
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Nov 10 13:15:48 EST 2021

x11: reset mod4 state when focus changes

--- a/gui-x11/x11.c
+++ b/gui-x11/x11.c
@@ -770,6 +770,7 @@
 {
 	static int altdown;
 	static int shiftdown;
+	static int superdown;
 	KeySym k;
 
 	switch(e->xany.type){
@@ -788,6 +789,10 @@
 			shiftdown = 0;
 			kbdkey(Kshift, 0);
 		}
+		if(superdown){
+			superdown = 0;
+			kbdkey(Kmod4, 0);
+		}
 		/* wet floor */
 	default:
 		return;
@@ -931,6 +936,7 @@
 		return;
 	altdown = e->xany.type == KeyPress && k == Kalt;
 	shiftdown = e->xany.type == KeyPress && k == Kshift;
+	superdown = e->xany.type == KeyPress && k == Kmod4;
 	kbdkey(k, e->xany.type == KeyPress);
 }