summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch')
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch122
1 files changed, 122 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch b/meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch
new file mode 100644
index 0000000000..e0cca5428b
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch
@@ -0,0 +1,122 @@
1---
2 Xext/xcalibrate.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
3 hw/kdrive/src/kdrive.h | 3 +++
4 hw/kdrive/src/kinput.c | 12 ++++++++++++
5 3 files changed, 61 insertions(+), 1 deletion(-)
6
7Index: xorg-server-1.3.0.0/Xext/xcalibrate.c
8===================================================================
9--- xorg-server-1.3.0.0.orig/Xext/xcalibrate.c 2007-06-29 17:30:03.000000000 +0100
10+++ xorg-server-1.3.0.0/Xext/xcalibrate.c 2007-06-30 14:04:40.000000000 +0100
11@@ -166,7 +166,6 @@ ProcXCalibrateSetRawMode (ClientPtr clie
12 return (client->noClientException);
13 }
14
15-
16 static int
17 SProcXCalibrateSetRawMode (ClientPtr client)
18 {
19@@ -180,6 +179,47 @@ SProcXCalibrateSetRawMode (ClientPtr cli
20 return ProcXCalibrateSetRawMode(client);
21 }
22
23+static int
24+ProcXCalibrateScreenToCoord (ClientPtr client)
25+{
26+ REQUEST(xXCalibrateScreenToCoordReq);
27+ xXCalibrateScreenToCoordReply rep;
28+
29+ REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
30+
31+ memset (&rep, 0, sizeof (rep));
32+ rep.type = X_Reply;
33+ rep.sequenceNumber = client->sequence;
34+ rep.x = stuff->x;
35+ rep.y = stuff->y;
36+
37+ KdScreenToMouseCoords(&rep.x, &rep.y);
38+
39+ if (client->swapped)
40+ {
41+ int n;
42+
43+ swaps (&rep.x, n);
44+ swaps (&rep.y, n);
45+ }
46+ WriteToClient(client, sizeof (rep), (char *) &rep);
47+ return (client->noClientException);
48+}
49+
50+static int
51+SProcXCalibrateScreenToCoord (ClientPtr client)
52+{
53+ REQUEST(xXCalibrateScreenToCoordReq);
54+ int n;
55+
56+ REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
57+
58+ swaps(&stuff->x, n);
59+ swaps(&stuff->y, n);
60+
61+ return ProcXCalibrateScreenToCoord(client);
62+}
63+
64 static void
65 XCalibrateResetProc (ExtensionEntry *extEntry)
66 {
67@@ -194,6 +234,9 @@ ProcXCalibrateDispatch (ClientPtr client
68 return ProcXCalibrateQueryVersion(client);
69 case X_XCalibrateRawMode:
70 return ProcXCalibrateSetRawMode(client);
71+ case X_XCalibrateScreenToCoord:
72+ return ProcXCalibrateScreenToCoord(client);
73+
74 default: break;
75 }
76
77@@ -213,6 +256,8 @@ SProcXCalibrateDispatch (ClientPtr clien
78 return SProcXCalibrateQueryVersion(client);
79 case X_XCalibrateRawMode:
80 return SProcXCalibrateSetRawMode(client);
81+ case X_XCalibrateScreenToCoord:
82+ return SProcXCalibrateScreenToCoord(client);
83
84 default: break;
85 }
86Index: xorg-server-1.3.0.0/hw/kdrive/src/kdrive.h
87===================================================================
88--- xorg-server-1.3.0.0.orig/hw/kdrive/src/kdrive.h 2007-06-30 13:43:45.000000000 +0100
89+++ xorg-server-1.3.0.0/hw/kdrive/src/kdrive.h 2007-06-30 13:45:03.000000000 +0100
90@@ -746,6 +746,9 @@ void
91 KdSetMouseMatrix (KdMouseMatrix *matrix);
92
93 void
94+KdScreenToMouseCoords (int *x, int *y);
95+
96+void
97 KdComputeMouseMatrix (KdMouseMatrix *matrix, Rotation randr, int width, int height);
98
99 void
100Index: xorg-server-1.3.0.0/hw/kdrive/src/kinput.c
101===================================================================
102--- xorg-server-1.3.0.0.orig/hw/kdrive/src/kinput.c 2007-06-29 17:30:16.000000000 +0100
103+++ xorg-server-1.3.0.0/hw/kdrive/src/kinput.c 2007-06-30 15:52:16.000000000 +0100
104@@ -381,6 +381,18 @@ KdSetMouseMatrix (KdMouseMatrix *matrix)
105 }
106
107 void
108+KdScreenToMouseCoords (int *x, int *y)
109+{
110+ int (*m)[3] = kdMouseMatrix.matrix;
111+ int div = m[0][1] * m[1][0] - m[1][1] * m[0][0];
112+ int sx = *x;
113+ int sy = *y;
114+
115+ *x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] - m[1][1] * sx) / div;
116+ *y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] - m[0][0] * sy) / div;
117+}
118+
119+void
120 KdComputeMouseMatrix (KdMouseMatrix *m, Rotation randr, int width, int height)
121 {
122 int x_dir = 1, y_dir = 1;