summaryrefslogtreecommitdiffstats
path: root/abs/extra/tigervnc/xorg111.patch
blob: ee0ddb999c45e717b3c2707dd3df5b2732e211d3 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
diff -up tigervnc-1.1.0/unix/xserver/hw/vnc/Input.cc.xorg111 tigervnc-1.1.0/unix/xserver/hw/vnc/Input.cc
--- tigervnc-1.1.0/unix/xserver/hw/vnc/Input.cc.xorg111	2011-08-09 23:16:36.000000000 +0200
+++ tigervnc-1.1.0/unix/xserver/hw/vnc/Input.cc	2011-11-11 11:59:14.226819903 +0100
@@ -82,10 +82,11 @@ static KeyCode KeysymToKeycode(KeySymsPt
 /* Event queue is shared between all devices. */
 #if XORG == 15
 static xEvent *eventq = NULL;
-#else
+#elif XORG < 111
 static EventList *eventq = NULL;
 #endif
 
+#if XORG < 111
 static void initEventq(void)
 {
 	/* eventq is never free()-ed because it exists during server life. */
@@ -100,7 +101,9 @@ static void initEventq(void)
 #endif
 	}
 }
+#endif /* XORG < 111 */
 
+#if XORG < 111
 static void enqueueEvents(DeviceIntPtr dev, int n)
 {
 	int i;
@@ -122,6 +125,7 @@ static void enqueueEvents(DeviceIntPtr d
 			   );
 	}
 }
+#endif /* XORG < 111 */
 
 InputDevice::InputDevice(rfb::VNCServerST *_server)
 	: server(_server), oldButtonMask(0)
@@ -141,12 +145,17 @@ InputDevice::InputDevice(rfb::VNCServerS
 				     keyboardProc, TRUE);
 	RegisterKeyboardDevice(keyboardDev);
 #endif
+#if XORG < 111
 	initEventq();
+#endif
 }
 
 void InputDevice::PointerButtonAction(int buttonMask)
 {
-	int i, n;
+	int i;
+#if XORG < 111
+	int n;
+#endif
 #if XORG >= 110
 	ValuatorMask mask;
 #endif
@@ -160,13 +169,17 @@ void InputDevice::PointerButtonAction(in
 #if XORG < 110
 			n = GetPointerEvents(eventq, pointerDev, action, i + 1,
 					     POINTER_RELATIVE, 0, 0, NULL);
-#else
+			enqueueEvents(pointerDev, n);
+#elif XORG < 111
 			valuator_mask_set_range(&mask, 0, 0, NULL);
 			n = GetPointerEvents(eventq, pointerDev, action, i + 1,
 					     POINTER_RELATIVE, &mask);
-#endif
 			enqueueEvents(pointerDev, n);
-
+#else
+			valuator_mask_set_range(&mask, 0, 0, NULL);
+			QueuePointerEvents(pointerDev, action, i + 1,
+					   POINTER_RELATIVE, &mask);
+#endif
 		}
 	}
 
@@ -175,7 +188,10 @@ void InputDevice::PointerButtonAction(in
 
 void InputDevice::PointerMove(const rfb::Point &pos)
 {
-	int n, valuators[2];
+	int valuators[2];
+#if XORG < 111
+	int n;
+#endif
 #if XORG >= 110
 	ValuatorMask mask;
 #endif
@@ -190,12 +206,16 @@ void InputDevice::PointerMove(const rfb:
 #if XORG < 110
 	n = GetPointerEvents(eventq, pointerDev, MotionNotify, 0, POINTER_ABSOLUTE, 0,
 			     2, valuators);
-#else
+	enqueueEvents(pointerDev, n);
+#elif XORG < 111
 	valuator_mask_set_range(&mask, 0, 2, valuators);
 	n = GetPointerEvents(eventq, pointerDev, MotionNotify, 0, POINTER_ABSOLUTE,
 			     &mask);
-#endif
 	enqueueEvents(pointerDev, n);
+#else
+	valuator_mask_set_range(&mask, 0, 2, valuators);
+	QueuePointerEvents(pointerDev, MotionNotify, 0, POINTER_ABSOLUTE, &mask);
+#endif
 
 	cursorPos = pos;
 }
@@ -299,14 +319,20 @@ void InputDevice::initInputDevice(void)
 static inline void pressKey(DeviceIntPtr dev, int kc, bool down, const char *msg)
 {
 	int action;
+#if XORG < 111
 	unsigned int n;
+#endif
 
 	if (msg != NULL)
 		vlog.debug("%s %d %s", msg, kc, down ? "down" : "up");
 
 	action = down ? KeyPress : KeyRelease;
-	n = GetKeyboardEvents(eventq, dev, action, kc);
+#if XORG < 111
+	n = GetKeyboardEvents(eventq, dev, action, kc, NULL);
 	enqueueEvents(dev, n);
+#else
+	QueueKeyboardEvents(dev, action, kc, NULL);
+#endif
 }
 
 #define IS_PRESSED(keyc, keycode) \
@@ -341,8 +367,11 @@ public:
 		int state, maxKeysPerMod, keycode;
 #if XORG >= 17
 		KeyCode *modmap = NULL;
-
+#if XORG >= 111
+		state = XkbStateFieldFromRec(&dev->master->key->xkbInfo->state);
+#else /* XORG >= 111 */
 		state = XkbStateFieldFromRec(&dev->u.master->key->xkbInfo->state);
+#endif /* XORG >= 111 */
 #else
 		KeyClassPtr keyc = dev->key;
 		state = keyc->state;
@@ -380,7 +409,11 @@ public:
 #if XORG >= 17
 		KeyCode *modmap = NULL;
 
+#if XORG >= 111
+		keyc = dev->master->key;
+#else /* XORG >= 111 */
 		keyc = dev->u.master->key;
+#endif /* XORG >= 111 */
 		state = XkbStateFieldFromRec(&keyc->xkbInfo->state);
 #else
 		keyc = dev->key;
@@ -596,7 +629,11 @@ void InputDevice::keyEvent(rdr::U32 keys
 	}
 
 #if XORG >= 17
+#if XORG >= 111
+	keyc = keyboardDev->master->key;
+#else /* XORG >= 111 */
 	keyc = keyboardDev->u.master->key;
+#endif /* XORG >= 111 */
 
 	keymap = XkbGetCoreMap(keyboardDev);
 	if (!keymap) {
@@ -753,7 +790,11 @@ ModeSwitchFound:
 			XkbApplyMappingChange(keyboardDev, keymap, minKeyCode,
 					      maxKeyCode - minKeyCode + 1,
 					      NULL, serverClient);
+#if XORG >= 111
+			XkbCopyDeviceKeymap(keyboardDev->master, keyboardDev);
+#else
 			XkbCopyDeviceKeymap(keyboardDev->u.master, keyboardDev);
+#endif
 #endif /* XORG < 17 */
 			break;
 		}
diff -up tigervnc-1.1.0/unix/xserver/hw/vnc/xorg-version.h.xorg111 tigervnc-1.1.0/unix/xserver/hw/vnc/xorg-version.h
--- tigervnc-1.1.0/unix/xserver/hw/vnc/xorg-version.h.xorg111	2011-08-09 23:16:36.000000000 +0200
+++ tigervnc-1.1.0/unix/xserver/hw/vnc/xorg-version.h	2011-11-11 11:55:32.255835319 +0100
@@ -36,6 +36,8 @@
 #define XORG 19
 #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (10 * 100000) + (99 * 1000))
 #define XORG 110
+#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (11 * 100000) + (99 * 1000))
+#define XORG 111
 #else
 #error "X.Org newer than 1.10 is not supported"
 #endif
diff -up tigervnc-1.1.0/unix/xserver/hw/vnc/xvnc.cc.xorg111 tigervnc-1.1.0/unix/xserver/hw/vnc/xvnc.cc
--- tigervnc-1.1.0/unix/xserver/hw/vnc/xvnc.cc.xorg111	2011-08-09 23:16:36.000000000 +0200
+++ tigervnc-1.1.0/unix/xserver/hw/vnc/xvnc.cc	2011-11-11 11:55:32.256835319 +0100
@@ -211,7 +211,11 @@ static void vfbFreeFramebufferMemory(vfb
 
 extern "C" {
 
+#if XORG < 111
 void ddxGiveUp()
+#else
+void ddxGiveUp(enum ExitCode error)
+#endif
 {
     int i;
 
@@ -221,9 +225,17 @@ void ddxGiveUp()
 }
 
 void
+#if XORG < 111
 AbortDDX()
+#else
+AbortDDX(enum ExitCode error)
+#endif
 {
+#if XORG < 111
     ddxGiveUp();
+#else
+    ddxGiveUp(error);
+#endif
 }
 
 #ifdef __DARWIN__
@@ -668,8 +680,13 @@ vfbUninstallColormap(ColormapPtr pmap)
     {
 	if (pmap->mid != pmap->pScreen->defColormap)
 	{
+#if XORG < 111
 	    curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
 						   RT_COLORMAP);
+#else
+	    dixLookupResourceByType((pointer *) &curpmap, pmap->pScreen->defColormap,
+				    RT_COLORMAP, serverClient, DixUnknownAccess);
+#endif
 	    (*pmap->pScreen->InstallColormap)(curpmap);
 	}
     }