updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / tigervnc / xorg111.patch
blobee0ddb999c45e717b3c2707dd3df5b2732e211d3
1 diff -up tigervnc-1.1.0/unix/xserver/hw/vnc/Input.cc.xorg111 tigervnc-1.1.0/unix/xserver/hw/vnc/Input.cc
2 --- tigervnc-1.1.0/unix/xserver/hw/vnc/Input.cc.xorg111 2011-08-09 23:16:36.000000000 +0200
3 +++ tigervnc-1.1.0/unix/xserver/hw/vnc/Input.cc 2011-11-11 11:59:14.226819903 +0100
4 @@ -82,10 +82,11 @@ static KeyCode KeysymToKeycode(KeySymsPt
5 /* Event queue is shared between all devices. */
6 #if XORG == 15
7 static xEvent *eventq = NULL;
8 -#else
9 +#elif XORG < 111
10 static EventList *eventq = NULL;
11 #endif
13 +#if XORG < 111
14 static void initEventq(void)
16 /* eventq is never free()-ed because it exists during server life. */
17 @@ -100,7 +101,9 @@ static void initEventq(void)
18 #endif
21 +#endif /* XORG < 111 */
23 +#if XORG < 111
24 static void enqueueEvents(DeviceIntPtr dev, int n)
26 int i;
27 @@ -122,6 +125,7 @@ static void enqueueEvents(DeviceIntPtr d
31 +#endif /* XORG < 111 */
33 InputDevice::InputDevice(rfb::VNCServerST *_server)
34 : server(_server), oldButtonMask(0)
35 @@ -141,12 +145,17 @@ InputDevice::InputDevice(rfb::VNCServerS
36 keyboardProc, TRUE);
37 RegisterKeyboardDevice(keyboardDev);
38 #endif
39 +#if XORG < 111
40 initEventq();
41 +#endif
44 void InputDevice::PointerButtonAction(int buttonMask)
46 - int i, n;
47 + int i;
48 +#if XORG < 111
49 + int n;
50 +#endif
51 #if XORG >= 110
52 ValuatorMask mask;
53 #endif
54 @@ -160,13 +169,17 @@ void InputDevice::PointerButtonAction(in
55 #if XORG < 110
56 n = GetPointerEvents(eventq, pointerDev, action, i + 1,
57 POINTER_RELATIVE, 0, 0, NULL);
58 -#else
59 + enqueueEvents(pointerDev, n);
60 +#elif XORG < 111
61 valuator_mask_set_range(&mask, 0, 0, NULL);
62 n = GetPointerEvents(eventq, pointerDev, action, i + 1,
63 POINTER_RELATIVE, &mask);
64 -#endif
65 enqueueEvents(pointerDev, n);
67 +#else
68 + valuator_mask_set_range(&mask, 0, 0, NULL);
69 + QueuePointerEvents(pointerDev, action, i + 1,
70 + POINTER_RELATIVE, &mask);
71 +#endif
75 @@ -175,7 +188,10 @@ void InputDevice::PointerButtonAction(in
77 void InputDevice::PointerMove(const rfb::Point &pos)
79 - int n, valuators[2];
80 + int valuators[2];
81 +#if XORG < 111
82 + int n;
83 +#endif
84 #if XORG >= 110
85 ValuatorMask mask;
86 #endif
87 @@ -190,12 +206,16 @@ void InputDevice::PointerMove(const rfb:
88 #if XORG < 110
89 n = GetPointerEvents(eventq, pointerDev, MotionNotify, 0, POINTER_ABSOLUTE, 0,
90 2, valuators);
91 -#else
92 + enqueueEvents(pointerDev, n);
93 +#elif XORG < 111
94 valuator_mask_set_range(&mask, 0, 2, valuators);
95 n = GetPointerEvents(eventq, pointerDev, MotionNotify, 0, POINTER_ABSOLUTE,
96 &mask);
97 -#endif
98 enqueueEvents(pointerDev, n);
99 +#else
100 + valuator_mask_set_range(&mask, 0, 2, valuators);
101 + QueuePointerEvents(pointerDev, MotionNotify, 0, POINTER_ABSOLUTE, &mask);
102 +#endif
104 cursorPos = pos;
106 @@ -299,14 +319,20 @@ void InputDevice::initInputDevice(void)
107 static inline void pressKey(DeviceIntPtr dev, int kc, bool down, const char *msg)
109 int action;
110 +#if XORG < 111
111 unsigned int n;
112 +#endif
114 if (msg != NULL)
115 vlog.debug("%s %d %s", msg, kc, down ? "down" : "up");
117 action = down ? KeyPress : KeyRelease;
118 - n = GetKeyboardEvents(eventq, dev, action, kc);
119 +#if XORG < 111
120 + n = GetKeyboardEvents(eventq, dev, action, kc, NULL);
121 enqueueEvents(dev, n);
122 +#else
123 + QueueKeyboardEvents(dev, action, kc, NULL);
124 +#endif
127 #define IS_PRESSED(keyc, keycode) \
128 @@ -341,8 +367,11 @@ public:
129 int state, maxKeysPerMod, keycode;
130 #if XORG >= 17
131 KeyCode *modmap = NULL;
133 +#if XORG >= 111
134 + state = XkbStateFieldFromRec(&dev->master->key->xkbInfo->state);
135 +#else /* XORG >= 111 */
136 state = XkbStateFieldFromRec(&dev->u.master->key->xkbInfo->state);
137 +#endif /* XORG >= 111 */
138 #else
139 KeyClassPtr keyc = dev->key;
140 state = keyc->state;
141 @@ -380,7 +409,11 @@ public:
142 #if XORG >= 17
143 KeyCode *modmap = NULL;
145 +#if XORG >= 111
146 + keyc = dev->master->key;
147 +#else /* XORG >= 111 */
148 keyc = dev->u.master->key;
149 +#endif /* XORG >= 111 */
150 state = XkbStateFieldFromRec(&keyc->xkbInfo->state);
151 #else
152 keyc = dev->key;
153 @@ -596,7 +629,11 @@ void InputDevice::keyEvent(rdr::U32 keys
156 #if XORG >= 17
157 +#if XORG >= 111
158 + keyc = keyboardDev->master->key;
159 +#else /* XORG >= 111 */
160 keyc = keyboardDev->u.master->key;
161 +#endif /* XORG >= 111 */
163 keymap = XkbGetCoreMap(keyboardDev);
164 if (!keymap) {
165 @@ -753,7 +790,11 @@ ModeSwitchFound:
166 XkbApplyMappingChange(keyboardDev, keymap, minKeyCode,
167 maxKeyCode - minKeyCode + 1,
168 NULL, serverClient);
169 +#if XORG >= 111
170 + XkbCopyDeviceKeymap(keyboardDev->master, keyboardDev);
171 +#else
172 XkbCopyDeviceKeymap(keyboardDev->u.master, keyboardDev);
173 +#endif
174 #endif /* XORG < 17 */
175 break;
177 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
178 --- tigervnc-1.1.0/unix/xserver/hw/vnc/xorg-version.h.xorg111 2011-08-09 23:16:36.000000000 +0200
179 +++ tigervnc-1.1.0/unix/xserver/hw/vnc/xorg-version.h 2011-11-11 11:55:32.255835319 +0100
180 @@ -36,6 +36,8 @@
181 #define XORG 19
182 #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (10 * 100000) + (99 * 1000))
183 #define XORG 110
184 +#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (11 * 100000) + (99 * 1000))
185 +#define XORG 111
186 #else
187 #error "X.Org newer than 1.10 is not supported"
188 #endif
189 diff -up tigervnc-1.1.0/unix/xserver/hw/vnc/xvnc.cc.xorg111 tigervnc-1.1.0/unix/xserver/hw/vnc/xvnc.cc
190 --- tigervnc-1.1.0/unix/xserver/hw/vnc/xvnc.cc.xorg111 2011-08-09 23:16:36.000000000 +0200
191 +++ tigervnc-1.1.0/unix/xserver/hw/vnc/xvnc.cc 2011-11-11 11:55:32.256835319 +0100
192 @@ -211,7 +211,11 @@ static void vfbFreeFramebufferMemory(vfb
194 extern "C" {
196 +#if XORG < 111
197 void ddxGiveUp()
198 +#else
199 +void ddxGiveUp(enum ExitCode error)
200 +#endif
202 int i;
204 @@ -221,9 +225,17 @@ void ddxGiveUp()
207 void
208 +#if XORG < 111
209 AbortDDX()
210 +#else
211 +AbortDDX(enum ExitCode error)
212 +#endif
214 +#if XORG < 111
215 ddxGiveUp();
216 +#else
217 + ddxGiveUp(error);
218 +#endif
221 #ifdef __DARWIN__
222 @@ -668,8 +680,13 @@ vfbUninstallColormap(ColormapPtr pmap)
224 if (pmap->mid != pmap->pScreen->defColormap)
226 +#if XORG < 111
227 curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
228 RT_COLORMAP);
229 +#else
230 + dixLookupResourceByType((pointer *) &curpmap, pmap->pScreen->defColormap,
231 + RT_COLORMAP, serverClient, DixUnknownAccess);
232 +#endif
233 (*pmap->pScreen->InstallColormap)(curpmap);