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

« back to all changes in this revision

Viewing changes to debian/patches/202_xf86CoordinationsToWindows.patch

  • Committer: Bazaar Package Importer
  • Author(s): Chase Douglas
  • Date: 2010-08-09 14:33:40 UTC
  • Revision ID: james.westby@ubuntu.com-20100809143340-cnku0iprp23ezrdt
Tags: 2:1.8.99.905-1ubuntu2
* Add in gesture support (LP: #616678)
  - add debian/patches/203_gestures-extension.patch
    and debian/patches/202_xf86CoordinationsToWindows.patch
  - debian/rules:
    - switch configure option to enable gesture

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 0e750eff9ba7987ef31acaabd3ef771bfd2e2ce5 Mon Sep 17 00:00:00 2001
 
2
From: Chase Douglas <chase.douglas@canonical.com>
 
3
Date: Wed, 21 Jul 2010 12:00:04 +0200
 
4
Subject: [PATCH 1/5] Add XFixesCoordinatesToWindow request
 
5
 
 
6
---
 
7
 dix/events.c                   |   48 ++++++++++++++++++++++++++++++++++++++++
 
8
 hw/xfree86/common/xf86Xinput.c |    7 +++++
 
9
 hw/xfree86/common/xf86Xinput.h |    2 +
 
10
 include/events.h               |    3 ++
 
11
 4 files changed, 60 insertions(+), 0 deletions(-)
 
12
 
 
13
--- xorg-server-debian.orig/dix/events.c
 
14
+++ xorg-server-debian/dix/events.c
 
15
@@ -5840,3 +5840,47 @@
 
16
     return FALSE;
 
17
 }
 
18
 
 
19
+WindowPtr
 
20
+CoordinatesToWindow(int x, int y, int screen)
 
21
+{
 
22
+    WindowPtr pWin;
 
23
+    WindowPtr ret = NullWindow;
 
24
+    BoxRec box;
 
25
+
 
26
+    pWin = screenInfo.screens[screen]->root;
 
27
+    while (pWin)
 
28
+    {
 
29
+       if ((pWin->mapped) &&
 
30
+           (x >= pWin->drawable.x - wBorderWidth (pWin)) &&
 
31
+           (x < pWin->drawable.x + (int)pWin->drawable.width +
 
32
+            wBorderWidth(pWin)) &&
 
33
+           (y >= pWin->drawable.y - wBorderWidth (pWin)) &&
 
34
+           (y < pWin->drawable.y + (int)pWin->drawable.height +
 
35
+            wBorderWidth (pWin))
 
36
+           /* When a window is shaped, a further check
 
37
+            * is made to see if the point is inside
 
38
+            * borderSize
 
39
+            */
 
40
+           && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y))
 
41
+           && (!wInputShape(pWin) ||
 
42
+               RegionContainsPoint(wInputShape(pWin),
 
43
+                                   x - pWin->drawable.x,
 
44
+                                   y - pWin->drawable.y, &box))
 
45
+#ifdef ROOTLESS
 
46
+    /* In rootless mode windows may be offscreen, even when
 
47
+     * they're in X's stack. (E.g. if the native window system
 
48
+     * implements some form of virtual desktop system).
 
49
+     */
 
50
+               && !pWin->rootlessUnhittable
 
51
+#endif
 
52
+           )
 
53
+       {
 
54
+            ret = pWin;
 
55
+            pWin = pWin->firstChild;
 
56
+        }
 
57
+        else
 
58
+            pWin = pWin->nextSib;
 
59
+    }
 
60
+    return ret;
 
61
+}
 
62
+
 
63
--- xorg-server-debian.orig/hw/xfree86/common/xf86Xinput.c
 
64
+++ xorg-server-debian/hw/xfree86/common/xf86Xinput.c
 
65
@@ -1362,4 +1362,10 @@
 
66
     EnableDevice(dev, TRUE);
 
67
 }
 
68
 
 
69
+WindowPtr
 
70
+xf86CoordinatesToWindow(int x, int y, int screen)
 
71
+{
 
72
+    return CoordinatesToWindow(x, y, screen);
 
73
+}
 
74
+
 
75
 /* end of xf86Xinput.c */
 
76
--- xorg-server-debian.orig/hw/xfree86/common/xf86Xinput.h
 
77
+++ xorg-server-debian/hw/xfree86/common/xf86Xinput.h
 
78
@@ -212,6 +212,8 @@
 
79
 extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
 
80
                             pointer extraOpts);
 
81
 
 
82
+extern _X_EXPORT WindowPtr xf86CoordinatesToWindow(int x, int y, int screen);
 
83
+
 
84
 
 
85
 /* Legacy hatred */
 
86
 #define SendCoreEvents 59
 
87
--- xorg-server-debian.orig/include/events.h
 
88
+++ xorg-server-debian/include/events.h
 
89
@@ -24,6 +24,7 @@
 
90
 
 
91
 #ifndef EVENTS_H
 
92
 #define EVENTS_H
 
93
+
 
94
 typedef struct _DeviceEvent DeviceEvent;
 
95
 typedef struct _DeviceChangedEvent DeviceChangedEvent;
 
96
 #if XFreeXDGA
 
97
@@ -35,4 +36,6 @@
 
98
 #endif
 
99
 typedef union _InternalEvent InternalEvent;
 
100
 
 
101
+extern WindowPtr CoordinatesToWindow(int x, int y, int screen);
 
102
+
 
103
 #endif