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
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(-)
13
--- xorg-server-debian.orig/dix/events.c
14
+++ xorg-server-debian/dix/events.c
15
@@ -5840,3 +5840,47 @@
20
+CoordinatesToWindow(int x, int y, int screen)
23
+ WindowPtr ret = NullWindow;
26
+ pWin = screenInfo.screens[screen]->root;
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
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))
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).
50
+ && !pWin->rootlessUnhittable
55
+ pWin = pWin->firstChild;
58
+ pWin = pWin->nextSib;
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);
70
+xf86CoordinatesToWindow(int x, int y, int screen)
72
+ return CoordinatesToWindow(x, y, screen);
75
/* end of xf86Xinput.c */
76
--- xorg-server-debian.orig/hw/xfree86/common/xf86Xinput.h
77
+++ xorg-server-debian/hw/xfree86/common/xf86Xinput.h
79
extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
82
+extern _X_EXPORT WindowPtr xf86CoordinatesToWindow(int x, int y, int screen);
86
#define SendCoreEvents 59
87
--- xorg-server-debian.orig/include/events.h
88
+++ xorg-server-debian/include/events.h
94
typedef struct _DeviceEvent DeviceEvent;
95
typedef struct _DeviceChangedEvent DeviceChangedEvent;
99
typedef union _InternalEvent InternalEvent;
101
+extern WindowPtr CoordinatesToWindow(int x, int y, int screen);