summarylogtreecommitdiffstats
path: root/getmaster.patch
blob: 2eb8d033f2ad802e6b753dda62e6b50e946e5481 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
diff --git a/unix/xserver/hw/vnc/InputXKB.c b/unix/xserver/hw/vnc/InputXKB.c
index 8d7ae56..e7ded9c 100644
--- a/unix/xserver/hw/vnc/InputXKB.c
+++ b/unix/xserver/hw/vnc/InputXKB.c
@@ -212,10 +212,7 @@ void vncPrepareInputDevices(void)
 
 unsigned vncGetKeyboardState(void)
 {
-	DeviceIntPtr master;
-
-	master = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT);
-	return XkbStateFieldFromRec(&master->key->xkbInfo->state);
+	return XkbStateFieldFromRec(&vncKeyboardDev->master->key->xkbInfo->state);
 }
 
 unsigned vncGetLevelThreeMask(void)
@@ -236,7 +233,7 @@ unsigned vncGetLevelThreeMask(void)
 			return 0;
 	}
 
-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;
 
 	act = XkbKeyActionPtr(xkb, keycode, state);
 	if (act == NULL)
@@ -261,7 +258,7 @@ KeyCode vncPressShift(void)
 	if (state & ShiftMask)
 		return 0;
 
-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;
 	for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
 		XkbAction *act;
 		unsigned char mask;
@@ -301,7 +298,7 @@ size_t vncReleaseShift(KeyCode *keys, size_t maxKeys)
 
 	count = 0;
 
-	master = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT);
+	master = vncKeyboardDev->master;
 	xkb = master->key->xkbInfo->desc;
 	for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
 		XkbAction *act;
@@ -357,7 +354,7 @@ KeyCode vncPressLevelThree(void)
 			return 0;
 	}
 
-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;
 
 	act = XkbKeyActionPtr(xkb, keycode, state);
 	if (act == NULL)
@@ -388,7 +385,7 @@ size_t vncReleaseLevelThree(KeyCode *keys, size_t maxKeys)
 
 	count = 0;
 
-	master = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT);
+	master = vncKeyboardDev->master;
 	xkb = master->key->xkbInfo->desc;
 	for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
 		XkbAction *act;
@@ -431,7 +428,7 @@ KeyCode vncKeysymToKeycode(KeySym keysym, unsigned state, unsigned *new_state)
 	if (new_state != NULL)
 		*new_state = state;
 
-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;
 	for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
 		unsigned int state_out;
 		KeySym dummy;
@@ -488,7 +485,7 @@ int vncIsLockModifier(KeyCode keycode, unsigned state)
 	XkbDescPtr xkb;
 	XkbAction *act;
 
-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;
 
 	act = XkbKeyActionPtr(xkb, keycode, state);
 	if (act == NULL)
@@ -526,7 +523,7 @@ int vncIsAffectedByNumLock(KeyCode keycode)
 	if (numlock_keycode == 0)
 		return 0;
 
-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;
 
 	act = XkbKeyActionPtr(xkb, numlock_keycode, state);
 	if (act == NULL)
@@ -560,7 +557,7 @@ KeyCode vncAddKeysym(KeySym keysym, unsigned state)
 	KeySym *syms;
 	KeySym upper, lower;
 
-	master = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT);
+	master = vncKeyboardDev->master;
 	xkb = master->key->xkbInfo->desc;
 	for (key = xkb->max_key_code; key >= xkb->min_key_code; key--) {
 		if (XkbKeyNumGroups(xkb, key) == 0)