xserver: Branch 'master' - 7 commits

Keith Packard keithp at kemper.freedesktop.org
Tue Feb 21 21:08:35 PST 2012


 Xi/exevents.c   |   30 ++++++++++++++++++------------
 dix/getevents.c |    2 ++
 2 files changed, 20 insertions(+), 12 deletions(-)

New commits:
commit 71594746c7da32e1c7986341a0da30f241a7a2be
Merge: d53235a... eaba06a...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Feb 22 18:07:20 2012 +1300

    Merge remote-tracking branch 'whot/for-keith'

commit eaba06a27c5520a02f08431ac1e4b0e0bdc22cd8
Author: Chase Douglas <chase.douglas at canonical.com>
Date:   Mon Feb 13 16:00:48 2012 -0800

    Keep virtual core pointer touch class around if new slave doesn't have one
    
    The VCP may have active touch grabs. The touch records must be kept so
    these touch grabs may be accepted/rejected in the future. This means the
    touch class list will not represent the touch class of the attached
    slave device if it does not have a touch class, but we already were
    breaking that assumption by keeping a separate touches array for the
    VCP.
    
    Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index ca8060d..f390f67 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -704,13 +704,10 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
         t->motionMask = f->motionMask;
         /* to->touches and to->num_touches are separate on the master,
          * don't copy */
-    } else if (to->touch)
-    {
-        ClassesPtr classes;
-        classes = to->unused_classes;
-        classes->touch = to->touch;
-        to->touch      = NULL;
     }
+    /* Don't remove touch class if from->touch is non-existent. The to device
+     * may have an active touch grab, so we need to keep the touch class record
+     * around. */
 }
 
 /**
commit 8573b3519af138a3a12a2e77098718165f9fd8ff
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Feb 13 16:00:47 2012 -0800

    Don't clobber virtual core pointer touches array length
    
    The VCP has its own touches array, don't overwrite it when the class is
    copied from the SD to the master.
    
    Reported-by: Chase Douglas <chase.douglas at canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 816dfa7..ca8060d 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -671,7 +671,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
 
     if (from->touch)
     {
-        TouchPointInfoPtr tmp;
+        TouchClassPtr t, f;
         if (!to->touch)
         {
             classes = to->unused_classes;
@@ -692,10 +692,18 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
             } else
                 classes->touch = NULL;
         }
-        tmp = to->touch->touches;
-        memcpy(to->touch, from->touch, sizeof(TouchClassRec));
-        to->touch->touches = tmp;
-        to->touch->sourceid = from->id;
+
+
+        t = to->touch;
+        f = from->touch;
+        t->sourceid = f->sourceid;
+        t->max_touches = f->max_touches;
+        t->mode = f->mode;
+        t->buttonsDown = f->buttonsDown;
+        t->state = f->state;
+        t->motionMask = f->motionMask;
+        /* to->touches and to->num_touches are separate on the master,
+         * don't copy */
     } else if (to->touch)
     {
         ClassesPtr classes;
commit 03d32fe7a718d9016053cdb5d57f51a74ef99b59
Author: Chase Douglas <chase.douglas at ubuntu.com>
Date:   Mon Feb 13 12:09:32 2012 -0800

    Don't dereference a touch after it has been ended when punting to next owner
    
    In this case, we have ended the touch because the last owner has
    rejected it. We need to return from the function right now so we don't
    attempt to dereference another touch client for early acceptance
    processing.
    
    Signed-off-by: Chase Douglas <chase.douglas at ubuntu.com>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index de7d50a..816dfa7 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1164,6 +1164,7 @@ TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti,
     {
         EmitTouchEnd(dev, ti, 0, 0);
         TouchEndTouch(dev, ti);
+        return;
     }
 
     if (ti->listeners[0].state == LISTENER_EARLY_ACCEPT)
commit 1ecb7aaf2adedad1996cd26176ef5802113e3ad9
Author: Chase Douglas <chase.douglas at ubuntu.com>
Date:   Sat Feb 11 07:58:38 2012 -0800

    Focus event button state must show the logical buttons, not physical buttons
    
    Similar to the fix in fcda98c48610fd507ca0b89c6006a5497d9dc1c9. This
    ensures we show the correct logical state of the buttons in device focus
    events too.
    
    Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 1ecc3ba..de7d50a 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -2215,7 +2215,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
 
     for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++)
         if (BitIsOn(mouse->button->down, i))
-            SetBit(&xi2event[1], i);
+            SetBit(&xi2event[1], mouse->button->map[i]);
 
     if (dev->key)
     {
commit 6f28388187cffae9e5bc9bfc9425acff4f478b59
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Sat Feb 11 01:29:26 2012 +1000

    dix: reset last.scroll when resetting the valuator (#45611)
    
    last.scroll remained on the last-submitted scrolling value but last.valuator
    was changed whenever the slave device changed. The first scrolling delta
    after a switch was then calculated as (last.scroll - new abs value), causing
    erroneous scrolling events.
    
    Test case:
    - synaptics with a scrolling method enabled, other device with 3+ axes (e.g.
      wacom)
    - scroll on touchpad
    - use other device
    - scroll on touchpad
    
    The second scroll caused erroneous button press/release events.
    
    X.Org Bug 45611 <http://bugs.freedesktop.org/show_bug.cgi?id=45611>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index 7678aa1..6ea4ba0 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -360,6 +360,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
             if (i >= lastSlave->valuator->numAxes)
             {
                 pDev->last.valuators[i] = 0;
+                valuator_mask_set_double(pDev->last.scroll, i, 0);
             }
             else
             {
@@ -367,6 +368,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
                 val = rescaleValuatorAxis(val, lastSlave->valuator->axes + i,
                                           pDev->valuator->axes + i, 0, 0);
                 pDev->last.valuators[i] = val;
+                valuator_mask_set_double(pDev->last.scroll, i, val);
             }
         }
     }
commit ceb026c6a6f1eea8b34e745f06f1ebcd652c0ba1
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jan 27 12:41:09 2012 +1000

    Xi: handle new XIAllowEvents request in inputproto 2.1.99.6
    
    grab_window and touchid were removed from the struct for ABI compatibility
    reasons, we need to pull in the new, XI 2.2-specific struct.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c
index 38967b2..d0856b6 100644
--- a/Xi/xiallowev.c
+++ b/Xi/xiallowev.c
@@ -41,6 +41,7 @@
 #include <X11/extensions/XI2proto.h>
 
 #include "exglobals.h" /* BadDevice */
+#include "exevents.h"
 #include "xiallowev.h"
 
 int
@@ -51,8 +52,12 @@ SProcXIAllowEvents(ClientPtr client)
     swaps(&stuff->length);
     swaps(&stuff->deviceid);
     swapl(&stuff->time);
-    /* FIXME swap touchid */
-    /* FIXME swap window */
+    if (stuff->length > 3)
+    {
+        xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq*)stuff;
+        swapl(&req_xi22->touchid);
+        swapl(&req_xi22->grab_window);
+    }
 
     return ProcXIAllowEvents(client);
 }
@@ -63,9 +68,21 @@ ProcXIAllowEvents(ClientPtr client)
     TimeStamp time;
     DeviceIntPtr dev;
     int ret = Success;
+    XIClientPtr xi_client;
+    Bool have_xi22 = FALSE;
+    REQUEST(xXI2_2AllowEventsReq);
 
-    REQUEST(xXIAllowEventsReq);
-    /* FIXME: check request length, 12 for XI 2.0+, 20 for XI 2.2+ */
+    xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
+
+    if (version_compare(xi_client->major_version,
+                        xi_client->minor_version, 2, 2) >= 0)
+    {
+        REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
+        have_xi22 = TRUE;
+    } else
+    {
+        REQUEST_SIZE_MATCH(xXIAllowEventsReq);
+    }
 
     ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
     if (ret != Success)
@@ -97,8 +114,20 @@ ProcXIAllowEvents(ClientPtr client)
 	break;
     case XIRejectTouch:
     case XIAcceptTouch:
-        ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
-                                stuff->grab_window, &client->errorValue);
+        {
+            int rc;
+            WindowPtr win;
+
+            if (!have_xi22)
+                return BadValue;
+
+            rc = dixLookupWindow(&win, stuff->grab_window, client, DixReadAccess);
+            if (rc != Success)
+                return rc;
+
+            ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
+                                    stuff->grab_window, &client->errorValue);
+        }
         break;
     default:
 	client->errorValue = stuff->mode;
diff --git a/configure.ac b/configure.ac
index 6241119..7e48d44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -776,7 +776,7 @@ XPROTO="xproto >= 7.0.22"
 RANDRPROTO="randrproto >= 1.2.99.3"
 RENDERPROTO="renderproto >= 0.11"
 XEXTPROTO="xextproto >= 7.1.99"
-INPUTPROTO="inputproto >= 2.1.99.5"
+INPUTPROTO="inputproto >= 2.1.99.6"
 KBPROTO="kbproto >= 1.0.3"
 FONTSPROTO="fontsproto"
 FIXESPROTO="fixesproto >= 5.0"


More information about the xorg-commit mailing list