~ubuntu-branches/ubuntu/oneiric/xorg-server/oneiric-security

« back to all changes in this revision

Viewing changes to debian/patches/219_fedora-pointer-barriers.diff

  • Committer: Bazaar Package Importer
  • Author(s): Timo Aaltonen
  • Date: 2011-07-05 16:22:23 UTC
  • mfrom: (1.1.44 upstream) (0.11.25 sid)
  • Revision ID: james.westby@ubuntu.com-20110705162223-r7wfqdkwl8zubdjb
Tags: 2:1.10.2.902-1ubuntu1
* Merge from Debian unstable. (LP: #441653)
  - Update 500_xi2.1.patch to apply.
  - Drop patch 218_randr-check-rotated-virtual-size-limits-correctly.diff,
    fixed upstream.
* Update the crtc confinement patch with one that should work, with
  further fixes from upstream. (LP: #389519)
* Dropped a bunch of old Breaks from xserver-xorg-core.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From ad2c48ab05d9415aa384eda6be52576525a3abcf Mon Sep 17 00:00:00 2001
 
1
From 14f1112bec18ccece8e732fe6c200a56546230c7 Mon Sep 17 00:00:00 2001
2
2
From: Adam Jackson <ajax@redhat.com>
3
3
Date: Thu, 17 Mar 2011 13:56:17 -0400
4
4
Subject: [PATCH] CRTC confine and pointer barriers
5
5
 
6
6
---
 
7
 dix/events.c                |    7 +
 
8
 dix/getevents.c             |   12 +-
 
9
 include/dix.h               |    1 +
7
10
 include/protocol-versions.h |    2 +-
8
 
 xfixes/cursor.c             |  408 ++++++++++++++++++++++++++++++++++++++++++-
 
11
 mi/mipointer.c              |   16 ++-
 
12
 mi/mipointer.h              |    6 +
 
13
 randr/randr.c               |    2 +
 
14
 randr/randrstr.h            |    4 +
 
15
 randr/rrcrtc.c              |  155 ++++++++++++++++
 
16
 xfixes/cursor.c             |  399 ++++++++++++++++++++++++++++++++++++++++++-
9
17
 xfixes/xfixes.c             |   24 ++-
10
18
 xfixes/xfixes.h             |   17 ++
11
19
 xfixes/xfixesint.h          |   16 ++
12
 
 6 files changed, 458 insertions(+), 12 deletions(-)
 
20
 14 files changed, 658 insertions(+), 16 deletions(-)
13
21
 
 
22
diff --git a/dix/events.c b/dix/events.c
 
23
index 07f8b05..d2be84f 100644
 
24
--- a/dix/events.c
 
25
+++ b/dix/events.c
 
26
@@ -328,6 +328,13 @@ IsMaster(DeviceIntPtr dev)
 
27
     return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD;
 
28
 }
 
29
 
 
30
+Bool
 
31
+IsFloating(DeviceIntPtr dev)
 
32
+{
 
33
+    return GetMaster(dev, MASTER_KEYBOARD) == NULL;
 
34
+}
 
35
+
 
36
+
 
37
 /**
 
38
  * Max event opcode.
 
39
  */
 
40
diff --git a/dix/getevents.c b/dix/getevents.c
 
41
index 794df42..c66e516 100644
 
42
--- a/dix/getevents.c
 
43
+++ b/dix/getevents.c
 
44
@@ -812,7 +812,11 @@ accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms)
 
45
  * miPointerSetPosition() and then scale back into device coordinates (if
 
46
  * needed). miPSP will change x/y if the screen was crossed.
 
47
  *
 
48
+ * The coordinates provided are always absolute. The parameter mode whether
 
49
+ * it was relative or absolute movement that landed us at those coordinates.
 
50
+ *
 
51
  * @param dev The device to be moved.
 
52
+ * @param mode Movement mode (Absolute or Relative)
 
53
  * @param x Pointer to current x-axis value, may be modified.
 
54
  * @param y Pointer to current y-axis value, may be modified.
 
55
  * @param x_frac Fractional part of current x-axis value, may be modified.
 
56
@@ -824,7 +828,8 @@ accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms)
 
57
  * @param screeny_frac Fractional part of screen y coordinate, as above.
 
58
  */
 
59
 static void
 
60
-positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
 
61
+positionSprite(DeviceIntPtr dev, int mode,
 
62
+               int *x, int *y, float x_frac, float y_frac,
 
63
                ScreenPtr scr, int *screenx, int *screeny, float *screenx_frac, float *screeny_frac)
 
64
 {
 
65
     int old_screenx, old_screeny;
 
66
@@ -863,7 +868,7 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
 
67
     old_screeny = *screeny;
 
68
     /* This takes care of crossing screens for us, as well as clipping
 
69
      * to the current screen. */
 
70
-    miPointerSetPosition(dev, screenx, screeny);
 
71
+    _miPointerSetPosition(dev, mode, screenx, screeny);
 
72
 
 
73
     if (dev->u.master) {
 
74
         dev->u.master->last.valuators[0] = *screenx;
 
75
@@ -1193,7 +1198,8 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
 
76
 
 
77
     set_raw_valuators(raw, &mask, raw->valuators.data);
 
78
 
 
79
-    positionSprite(pDev, &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac);
 
80
+    positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
 
81
+                   &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac);
 
82
     updateHistory(pDev, &mask, ms);
 
83
 
 
84
     /* Update the valuators with the true value sent to the client*/
 
85
diff --git a/include/dix.h b/include/dix.h
 
86
index 12e4b59..3f99098 100644
 
87
--- a/include/dix.h
 
88
+++ b/include/dix.h
 
89
@@ -570,6 +570,7 @@ extern Bool _X_EXPORT IsPointerDevice( DeviceIntPtr dev);
 
90
 extern Bool _X_EXPORT IsKeyboardDevice(DeviceIntPtr dev);
 
91
 extern Bool IsPointerEvent(InternalEvent *event);
 
92
 extern _X_EXPORT Bool IsMaster(DeviceIntPtr dev);
 
93
+extern _X_EXPORT Bool IsFloating(DeviceIntPtr dev);
 
94
 
 
95
 extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
 
96
 extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what);
14
97
diff --git a/include/protocol-versions.h b/include/protocol-versions.h
15
 
index 8692ded..7b7a9f5 100644
 
98
index 1d33bdd..1dc66ad 100644
16
99
--- a/include/protocol-versions.h
17
100
+++ b/include/protocol-versions.h
18
 
@@ -122,7 +122,7 @@
 
101
@@ -126,7 +126,7 @@
19
102
 #define SERVER_XF86VIDMODE_MINOR_VERSION       2
20
103
 
21
104
 /* Fixes */
24
107
 #define SERVER_XFIXES_MINOR_VERSION            0
25
108
 
26
109
 /* X Input */
 
110
diff --git a/mi/mipointer.c b/mi/mipointer.c
 
111
index 554397a..85f1949 100644
 
112
--- a/mi/mipointer.c
 
113
+++ b/mi/mipointer.c
 
114
@@ -229,6 +229,10 @@ miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
 
115
     SetupScreen (pScreen);
 
116
 
 
117
     GenerateEvent = generateEvent;
 
118
+
 
119
+    if (pScreen->ConstrainCursorHarder)
 
120
+       pScreen->ConstrainCursorHarder(pDev, pScreen, Absolute, &x, &y);
 
121
+
 
122
     /* device dependent - must pend signal and call miPointerWarpCursor */
 
123
     (*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y);
 
124
     if (!generateEvent)
 
125
@@ -484,7 +488,7 @@ miPointerMoveNoEvent (DeviceIntPtr pDev, ScreenPtr pScreen,
 
126
 }
 
127
 
 
128
 void
 
129
-miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
 
130
+_miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y)
 
131
 {
 
132
     miPointerScreenPtr pScreenPriv;
 
133
     ScreenPtr          pScreen;
 
134
@@ -529,6 +533,9 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
 
135
     if (*y >= pPointer->limits.y2)
 
136
        *y = pPointer->limits.y2 - 1;
 
137
 
 
138
+    if (pScreen->ConstrainCursorHarder)
 
139
+       pScreen->ConstrainCursorHarder(pDev, pScreen, mode, x, y);
 
140
+
 
141
     if (pPointer->x == *x && pPointer->y == *y && 
 
142
             pPointer->pScreen == pScreen) 
 
143
         return;
 
144
@@ -536,6 +543,13 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
 
145
     miPointerMoveNoEvent(pDev, pScreen, *x, *y);
 
146
 }
 
147
 
 
148
+/* ABI hack */
 
149
+void
 
150
+miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
 
151
+{
 
152
+    _miPointerSetPosition(pDev, Absolute, x, y);
 
153
+}
 
154
+
 
155
 void
 
156
 miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
 
157
 {
 
158
diff --git a/mi/mipointer.h b/mi/mipointer.h
 
159
index 3c86110..6b6010c 100644
 
160
--- a/mi/mipointer.h
 
161
+++ b/mi/mipointer.h
 
162
@@ -131,6 +131,12 @@ extern _X_EXPORT void miPointerGetPosition(
 
163
 
 
164
 /* Moves the cursor to the specified position.  May clip the co-ordinates:
 
165
  * x and y are modified in-place. */
 
166
+extern _X_EXPORT void _miPointerSetPosition(
 
167
+    DeviceIntPtr pDev,
 
168
+    int mode,
 
169
+    int *x,
 
170
+    int *y);
 
171
+
 
172
 extern _X_EXPORT void miPointerSetPosition(
 
173
     DeviceIntPtr pDev,
 
174
     int *x,
 
175
diff --git a/randr/randr.c b/randr/randr.c
 
176
index 6077705..d337129 100644
 
177
--- a/randr/randr.c
 
178
+++ b/randr/randr.c
 
179
@@ -270,6 +270,8 @@ Bool RRScreenInit(ScreenPtr pScreen)
 
180
     
 
181
     wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen);
 
182
 
 
183
+    pScreen->ConstrainCursorHarder = RRConstrainCursorHarder;
 
184
+
 
185
     pScrPriv->numOutputs = 0;
 
186
     pScrPriv->outputs = NULL;
 
187
     pScrPriv->numCrtcs = 0;
 
188
diff --git a/randr/randrstr.h b/randr/randrstr.h
 
189
index 7ea6080..d8dd37d 100644
 
190
--- a/randr/randrstr.h
 
191
+++ b/randr/randrstr.h
 
192
@@ -297,6 +297,7 @@ typedef struct _rrScrPriv {
 
193
     int                            rate;
 
194
     int                            size;
 
195
 #endif
 
196
+    Bool                   discontiguous;
 
197
 } rrScrPrivRec, *rrScrPrivPtr;
 
198
 
 
199
 extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;
 
200
@@ -700,6 +701,9 @@ ProcRRGetPanning (ClientPtr client);
 
201
 int
 
202
 ProcRRSetPanning (ClientPtr client);
 
203
 
 
204
+void
 
205
+RRConstrainCursorHarder (DeviceIntPtr, ScreenPtr, int, int *, int *);
 
206
+
 
207
 /* rrdispatch.c */
 
208
 extern _X_EXPORT Bool
 
209
 RRClientKnowsRates (ClientPtr  pClient);
 
210
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
 
211
index 98206a2..d4d8f2a 100644
 
212
--- a/randr/rrcrtc.c
 
213
+++ b/randr/rrcrtc.c
 
214
@@ -1,5 +1,6 @@
 
215
 /*
 
216
  * Copyright © 2006 Keith Packard
 
217
+ * Copyright 2010 Red Hat, Inc
 
218
  *
 
219
  * Permission to use, copy, modify, distribute, and sell this software and its
 
220
  * documentation for any purpose is hereby granted without fee, provided that
 
221
@@ -22,6 +23,7 @@
 
222
 
 
223
 #include "randrstr.h"
 
224
 #include "swaprep.h"
 
225
+#include "mipointer.h"
 
226
 
 
227
 RESTYPE        RRCrtcType;
 
228
 
 
229
@@ -292,6 +294,92 @@ RRCrtcPendingProperties (RRCrtcPtr crtc)
 
230
     return FALSE;
 
231
 }
 
232
 
 
233
+static void
 
234
+crtc_bounds(RRCrtcPtr crtc, int *left, int *right, int *top, int *bottom)
 
235
+{
 
236
+    *left = crtc->x;
 
237
+    *top = crtc->y;
 
238
+
 
239
+    switch (crtc->rotation) {
 
240
+    case RR_Rotate_0:
 
241
+    case RR_Rotate_180:
 
242
+    default:
 
243
+       *right = crtc->x + crtc->mode->mode.width;
 
244
+       *bottom = crtc->y + crtc->mode->mode.height;
 
245
+       return;
 
246
+    case RR_Rotate_90:
 
247
+    case RR_Rotate_270:
 
248
+       *right = crtc->x + crtc->mode->mode.height;
 
249
+       *bottom = crtc->y + crtc->mode->mode.width;
 
250
+       return;
 
251
+    }
 
252
+}
 
253
+
 
254
+/* overlapping counts as adjacent */
 
255
+static Bool
 
256
+crtcs_adjacent(const RRCrtcPtr a, const RRCrtcPtr b)
 
257
+{
 
258
+    /* left, right, top, bottom... */
 
259
+    int al, ar, at, ab;
 
260
+    int bl, br, bt, bb;
 
261
+    int cl, cr, ct, cb; /* the overlap, if any */
 
262
+
 
263
+    crtc_bounds(a, &al, &ar, &at, &ab);
 
264
+    crtc_bounds(b, &bl, &br, &bt, &bb);
 
265
+
 
266
+    cl = max(al, bl);
 
267
+    cr = min(ar, br);
 
268
+    ct = max(at, bt);
 
269
+    cb = min(ab, bb);
 
270
+
 
271
+    return (cl <= cr) && (ct <= cb);
 
272
+}
 
273
+
 
274
+/* Depth-first search and mark all CRTCs reachable from cur */
 
275
+static void
 
276
+mark_crtcs (rrScrPrivPtr pScrPriv, int *reachable, int cur)
 
277
+{
 
278
+    int i;
 
279
+    reachable[cur] = TRUE;
 
280
+    for (i = 0; i < pScrPriv->numCrtcs; ++i) {
 
281
+        if (reachable[i] || !pScrPriv->crtcs[i]->mode)
 
282
+            continue;
 
283
+        if (crtcs_adjacent(pScrPriv->crtcs[cur], pScrPriv->crtcs[i]))
 
284
+            mark_crtcs(pScrPriv, reachable, i);
 
285
+    }
 
286
+}
 
287
+
 
288
+static void
 
289
+RRComputeContiguity (ScreenPtr pScreen)
 
290
+{
 
291
+    rrScrPriv(pScreen);
 
292
+    Bool discontiguous = TRUE;
 
293
+    int i, n = pScrPriv->numCrtcs;
 
294
+
 
295
+    int *reachable = calloc(n, sizeof(int));
 
296
+    if (!reachable)
 
297
+        goto out;
 
298
+
 
299
+    /* Find first enabled CRTC and start search for reachable CRTCs from it */
 
300
+    for (i = 0; i < n; ++i) {
 
301
+        if (pScrPriv->crtcs[i]->mode) {
 
302
+            mark_crtcs(pScrPriv, reachable, i);
 
303
+            break;
 
304
+        }
 
305
+    }
 
306
+
 
307
+    /* Check that all enabled CRTCs were marked as reachable */
 
308
+    for (i = 0; i < n; ++i)
 
309
+        if (pScrPriv->crtcs[i]->mode && !reachable[i])
 
310
+            goto out;
 
311
+
 
312
+    discontiguous = FALSE;
 
313
+
 
314
+out:
 
315
+    free(reachable);
 
316
+    pScrPriv->discontiguous = discontiguous;
 
317
+}
 
318
+
 
319
 /*
 
320
  * Request that the Crtc be reconfigured
 
321
  */
 
322
@@ -306,6 +394,7 @@ RRCrtcSet (RRCrtcPtr    crtc,
 
323
 {
 
324
     ScreenPtr  pScreen = crtc->pScreen;
 
325
     Bool       ret = FALSE;
 
326
+    Bool       recompute = TRUE;
 
327
     rrScrPriv(pScreen);
 
328
 
 
329
     /* See if nothing changed */
 
330
@@ -318,6 +407,7 @@ RRCrtcSet (RRCrtcPtr    crtc,
 
331
        !RRCrtcPendingProperties (crtc) &&
 
332
        !RRCrtcPendingTransform (crtc))
 
333
     {
 
334
+       recompute = FALSE;
 
335
        ret = TRUE;
 
336
     }
 
337
     else
 
338
@@ -381,6 +471,10 @@ RRCrtcSet (RRCrtcPtr    crtc,
 
339
                RRPostPendingProperties (outputs[o]);
 
340
        }
 
341
     }
 
342
+
 
343
+    if (recompute)
 
344
+       RRComputeContiguity(pScreen);
 
345
+
 
346
     return ret;
 
347
 }
 
348
 
 
349
@@ -1349,3 +1443,64 @@ ProcRRGetCrtcTransform (ClientPtr client)
 
350
     free(reply);
 
351
     return Success;
 
352
 }
 
353
+
 
354
+void
 
355
+RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, int *y)
 
356
+{
 
357
+    rrScrPriv (pScreen);
 
358
+    int i;
 
359
+
 
360
+    /* intentional dead space -> let it float */
 
361
+    if (pScrPriv->discontiguous)
 
362
+       return;
 
363
+
 
364
+    /* if we're moving inside a crtc, we're fine */
 
365
+    for (i = 0; i < pScrPriv->numCrtcs; i++) {
 
366
+       RRCrtcPtr crtc = pScrPriv->crtcs[i];
 
367
+
 
368
+       int left, right, top, bottom;
 
369
+
 
370
+       if (!crtc->mode)
 
371
+           continue;
 
372
+
 
373
+       crtc_bounds(crtc, &left, &right, &top, &bottom);
 
374
+
 
375
+       if ((*x >= left) && (*x <= right) && (*y >= top) && (*y <= bottom))
 
376
+           return;
 
377
+    }
 
378
+
 
379
+    /* if we're trying to escape, clamp to the CRTC we're coming from */
 
380
+    for (i = 0; i < pScrPriv->numCrtcs; i++) {
 
381
+       RRCrtcPtr crtc = pScrPriv->crtcs[i];
 
382
+       int nx, ny;
 
383
+       int left, right, top, bottom;
 
384
+
 
385
+       if (!crtc->mode)
 
386
+           continue;
 
387
+
 
388
+       crtc_bounds(crtc, &left, &right, &top, &bottom);
 
389
+       miPointerGetPosition(pDev, &nx, &ny);
 
390
+
 
391
+       if ((nx >= left) && (nx <= right) && (ny >= top) && (ny <= bottom)) {
 
392
+           if ((*x <= left) || (*x >= right)) {
 
393
+               int dx = *x - nx;
 
394
+
 
395
+               if (dx > 0)
 
396
+                   *x = right;
 
397
+               else if (dx < 0)
 
398
+                   *x = left;
 
399
+           }
 
400
+
 
401
+           if ((*y <= top) || (*y >= bottom)) {
 
402
+               int dy = *y - ny;
 
403
+
 
404
+               if (dy > 0)
 
405
+                   *y = bottom;
 
406
+               else if (dy < 0)
 
407
+                   *y = top;
 
408
+           }
 
409
+
 
410
+           return;
 
411
+       }
 
412
+    }
 
413
+}
27
414
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
28
415
index fb608f6..5c55c95 100644
29
416
--- a/xfixes/cursor.c
89
476
     deleteCursorHideCountsForScreen(pScreen);
90
477
     ret = (*pScreen->CloseScreen) (index, pScreen);
91
478
     free(cs);
92
 
@@ -1029,6 +1045,391 @@ CursorFreeWindow (pointer data, XID id)
 
479
@@ -1029,6 +1045,382 @@ CursorFreeWindow (pointer data, XID id)
93
480
     return 1;
94
481
 }
95
482
 
144
531
+
145
532
+/**
146
533
+ * Test if the movement vector x1/y1 → x2/y2 is intersecting with the
147
 
+ * barrier. A movement vector with the startpoint or endpoint on the barrier
148
 
+ * itself counts as intersecting.
 
534
+ * barrier. A movement vector with the startpoint or endpoint adjacent to
 
535
+ * the barrier itself counts as intersecting.
149
536
+ *
150
537
+ * @param x1 X start coordinate of movement vector
151
538
+ * @param y1 Y start coordinate of movement vector
172
559
+           return FALSE;
173
560
+       if (dir & BarrierNegativeX && x1 == (barrier->x1 - 1))
174
561
+           return FALSE;
175
 
+       /* startpoint on barrier */
 
562
+       /* startpoint adjacent to barrier, moving towards -> block */
176
563
+       if (x1 == barrier->x1 && y1 >= barrier->y1 && y1 <= barrier->y2) {
177
564
+           *distance = 0;
178
565
+           return TRUE;
179
566
+       }
180
 
+       /* endpoint on barrier */
181
 
+       if (x2 == barrier->x1 && y2 >= barrier->y1 && y2 <= barrier->y2) {
182
 
+           *distance = abs(x2 - x1);
183
 
+           return TRUE;
184
 
+        }
185
567
+    } else {
186
568
+       /* handle immediate barrier adjacency, moving away */
187
569
+       if (dir & BarrierPositiveY && y1 == barrier->y1)
188
570
+           return FALSE;
189
571
+       if (dir & BarrierNegativeY && y1 == (barrier->y1 - 1))
190
572
+           return FALSE;
191
 
+       /* startpoint on barrier */
 
573
+       /* startpoint adjacent to barrier, moving towards -> block */
192
574
+       if (y1 == barrier->y1 && x1 >= barrier->x1 && x1 <= barrier->x2) {
193
575
+           *distance = 0;
194
576
+           return TRUE;
195
577
+        }
196
 
+       /* endpoint on barrier */
197
 
+       if (y2 == barrier->y1 && x2 >= barrier->x1 && x2 <= barrier->x2) {
198
 
+           *distance = abs(y2 - y1);
199
 
+           return TRUE;
200
 
+        }
201
578
+    }
202
579
+
203
580
+    /* not an edge case, compute distance */
273
650
+void
274
651
+barrier_clamp_to_barrier(struct PointerBarrier *barrier, int dir, int *x, int *y)
275
652
+{
276
 
+    if (barrier_is_vertical(barrier)) {
 
653
+    if (barrier_is_vertical(barrier))
 
654
+    {
277
655
+       if ((dir & BarrierNegativeX) & ~barrier->directions)
278
656
+           *x = barrier->x1;
279
657
+       if ((dir & BarrierPositiveX) & ~barrier->directions)
305
683
+        * Given the origin and the movement vector, get the nearest barrier
306
684
+        * to the origin that is blocking the movement.
307
685
+        * Clamp to that barrier.
308
 
+        * Then, check from the clamped position to the original
 
686
+        * Then, check from the clamped intersection to the original
309
687
+        * destination, again finding the nearest barrier and clamping.
310
688
+        */
311
689
+       dir = barrier_get_direction(ox, oy, *x, *y);
505
883
 }
506
884
 
507
885
diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c
508
 
index e8c7bf1..de0e4db 100644
 
886
index e8c7bf1..a57884b 100644
509
887
--- a/xfixes/xfixes.c
510
888
+++ b/xfixes/xfixes.c
511
889
@@ -1,5 +1,6 @@
641
1019
 void PanoramiXFixesInit (void);
642
1020
 void PanoramiXFixesReset (void);
643
1021
-- 
644
 
1.7.4.4
645
 
 
646
 
commit 703baece7ebd128a6742d0523d5b3ebe65126fa5
647
 
Author: Peter Hutterer <peter.hutterer@who-t.net>
648
 
Date:   Fri Feb 11 12:19:26 2011 +1000
649
 
 
650
 
    dix: Add IsFloating(device) wrapper.
651
 
    
652
 
    Simplifies check for floating devices.
653
 
    
654
 
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
655
 
    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
656
 
 
657
 
diff --git a/dix/events.c b/dix/events.c
658
 
index 4826781..f6d92cf 100644
659
 
--- a/dix/events.c
660
 
+++ b/dix/events.c
661
 
@@ -328,6 +328,13 @@ IsMaster(DeviceIntPtr dev)
662
 
     return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD;
663
 
 }
664
 
 
665
 
+Bool
666
 
+IsFloating(DeviceIntPtr dev)
667
 
+{
668
 
+    return GetMaster(dev, MASTER_KEYBOARD) == NULL;
669
 
+}
670
 
+
671
 
+
672
 
 /**
673
 
  * Max event opcode.
674
 
  */
675
 
diff --git a/include/dix.h b/include/dix.h
676
 
index 12e4b59..3f99098 100644
677
 
--- a/include/dix.h
678
 
+++ b/include/dix.h
679
 
@@ -570,6 +570,7 @@ extern Bool _X_EXPORT IsPointerDevice( DeviceIntPtr dev);
680
 
 extern Bool _X_EXPORT IsKeyboardDevice(DeviceIntPtr dev);
681
 
 extern Bool IsPointerEvent(InternalEvent *event);
682
 
 extern _X_EXPORT Bool IsMaster(DeviceIntPtr dev);
683
 
+extern _X_EXPORT Bool IsFloating(DeviceIntPtr dev);
684
 
 
685
 
 extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
686
 
 extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what);
 
1022
1.7.4
 
1023