aports

Custom Alpine Linux aports

git clone https://git.8pit.net/aports.git

 1# HG changeset patch
 2# User Sören Tempel <soeren+hg@soeren-tempel.net>
 3# Date 1608985828 -3600
 4#      Sat Dec 26 13:30:28 2020 +0100
 5# Node ID 30a5839182285fa252fc7d9268c5df5b5cc07eb6
 6# Parent  8fd69c7dfe881e87efaf1c14c33653ad61488ec8
 7gui-x11: Don't use X11 standard interpretation for modifiers
 8
 9Using XLookupString to determine the KeySym causes the KeySym to be
10interpreted according to the “standard interpretation of the Shift,
11Lock, group, and numlock modifiers as defined in the X Protocol
12specification.” (see XLookupKeysym(3)). For example, pressing shift and
13'a' causes 'A' to be returned as a KeySym.
14
15When considering modifier keys this behaviour is undesirable. For
16instance, X11 xkb definitions which use the both_capslock rule (e.g.
17`setxkbmap de neo`) emit Shift_L with XLookupString when Shift_L/Shift_R
18is pressed but emit Caps_Lock on release as Shift_L acts as a modifier
19in this case (check with xev(1)). This causes Plan 9 to think that the
20Shift key is constantly pressed (as a key release event for Shift is
21never emitted by drawterm) thereby causing the context menu in rio to
22not work correctly. As a side note, capitalization is not effected by
23this as letters are capitalized by drawterm, not Plan 9.
24
25If my understanding of X11 is correct, using XLookupString on modifier
26keys is a bad idea in this particular code, instead XLookupKeysym should
27be used for modifiers.
28
29diff -r 8fd69c7dfe88 -r 30a583918228 gui-x11/x11.c
30--- a/gui-x11/x11.c	Wed Dec 23 15:58:36 2020 +0100
31+++ b/gui-x11/x11.c	Sat Dec 26 13:30:28 2020 +0100
32@@ -791,6 +791,10 @@
33 
34 	if(k == XK_Multi_key || k == NoSymbol)
35 		return;
36+	/* dont use standard interpretation for modifiers */
37+	if(IsModifierKey(k))
38+		k = XLookupKeysym((XKeyEvent*)e, 0);
39+
40 	if(k&0xFF00){
41 		switch(k){
42 		case XK_BackSpace: