~linaro-maintainers/ubuntu/oneiric/xorg-server/pvr-omap4-fallback

« back to all changes in this revision

Viewing changes to debian/patches/219_xi1_handle_noncontinuous_valuator_data.patch

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington, Bryce Harrington, Chase Douglas
  • Date: 2011-03-31 23:58:07 UTC
  • Revision ID: james.westby@ubuntu.com-20110331235807-nv26c9su1xbp37mr
Tags: 2:1.10.0-0ubuntu3
[ Bryce Harrington ]
* patches/111_armel-drv-fallbacks.patch: Always fallback to -fbdev,
  not just when no other X driver matches. (Thanks jcristau)

[ Chase Douglas ]
* Fix jumpy cursor in XI 1.x applications.
  (LP: #736500)
  - Added 218_getValuatorEvents_cleanup.patch
  - Added 219_xi1_handle_noncontinuous_valuator_data.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 8a67ba29b82e2a627172b7ee181091df59e4cace Mon Sep 17 00:00:00 2001
 
2
From: Chase Douglas <chase.douglas@canonical.com>
 
3
Date: Mon, 28 Mar 2011 12:08:46 -0400
 
4
Subject: [PATCH 2/2] Handle non continuous valuator data in getValuatorEvents
 
5
 
 
6
This allows for masked valuators to be handled properly in XI 1.x
 
7
events. Any unset valuators in the device event are set to the last
 
8
known value when transmitted on the wire through XI 1.x valuator events.
 
9
 
 
10
Fixes https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/736500
 
11
 
 
12
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
 
13
---
 
14
 dix/eventconvert.c |   11 +++++++----
 
15
 1 files changed, 7 insertions(+), 4 deletions(-)
 
16
 
 
17
diff --git a/dix/eventconvert.c b/dix/eventconvert.c
 
18
index 9192080..3285133 100644
 
19
--- a/dix/eventconvert.c
 
20
+++ b/dix/eventconvert.c
 
21
@@ -364,19 +364,18 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
 
22
     int i;
 
23
     int state = 0;
 
24
     int first_valuator, num_valuators;
 
25
+    DeviceIntPtr dev = NULL;
 
26
 
 
27
 
 
28
     num_valuators = countValuators(ev, &first_valuator);
 
29
     if (num_valuators > 0)
 
30
     {
 
31
-        DeviceIntPtr dev = NULL;
 
32
         dixLookupDevice(&dev, ev->deviceid, serverClient, DixUseAccess);
 
33
         /* State needs to be assembled BEFORE the device is updated. */
 
34
         state = (dev && dev->key) ? XkbStateFieldFromRec(&dev->key->xkbInfo->state) : 0;
 
35
         state |= (dev && dev->button) ? (dev->button->state) : 0;
 
36
     }
 
37
 
 
38
-    /* FIXME: non-continuous valuator data in internal events*/
 
39
     for (i = 0; i < num_valuators; i += 6, xv++) {
 
40
         INT32 *valuators = &xv->valuator0; // Treat all 6 vals as an array
 
41
         int j;
 
42
@@ -387,8 +386,12 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
 
43
         xv->deviceid = ev->deviceid;
 
44
         xv->device_state = state;
 
45
 
 
46
-        for (j = 0; j < xv->num_valuators; j++)
 
47
-            valuators[j] = ev->valuators.data[xv->first_valuator + j];
 
48
+        for (j = 0; j < xv->num_valuators; j++) {
 
49
+            if (BitIsOn(ev->valuators.mask, xv->first_valuator + j))
 
50
+                valuators[j] = ev->valuators.data[xv->first_valuator + j];
 
51
+            else
 
52
+                valuators[j] = dev->valuator->axisVal[xv->first_valuator + j];
 
53
+        }
 
54
 
 
55
         if (i + 6 < num_valuators)
 
56
             xv->deviceid |= MORE_EVENTS;
 
57
-- 
 
58
1.7.4.1
 
59