xserver: Branch 'server-1.12-branch' - 7 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri Mar 30 14:59:55 PDT 2012


 Xext/syncsrv.h  |    2 --
 Xext/xtest.c    |   10 ++++++++++
 Xi/exevents.c   |   24 ++++++++++++++++--------
 dix/getevents.c |   16 +++++++++-------
 dix/touch.c     |    3 ++-
 include/input.h |    3 ++-
 6 files changed, 39 insertions(+), 19 deletions(-)

New commits:
commit 5eb20062208177172ff3443e522096a2e8f2f1e8
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Mar 21 14:05:29 2012 +1000

    dix: set raw event values before adding up relative values (#46976)
    
    Regression introduced in 4e52cc0ef48145134cd58d357fb7289e6f8bb709
    
    Raw event values are values as-is from the driver, modified only be
    transformation or acceleration. 4e52cc caused the mask to be updated from
    relative to absolute coordinates which then got written into the raw events.
    
    Move the raw event update into the respective branches for absolute/relative
    events.
    
    X.Org Bug 46976 <http://bugs.freedesktop.org/show_bug.cgi?id=46976>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Tested-by: Sven Arvidsson <sa at whiz.se>
    Reviewed-by: Simon Thum <simon.thum at gmx.de>
    (cherry picked from commit 908ab3d580188533168c8cdfd2cab9dc689b4218)

diff --git a/dix/getevents.c b/dix/getevents.c
index 260955b..fa85fe7 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1314,18 +1314,19 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
 
         transformAbsolute(pDev, &mask);
         clipAbsolute(pDev, &mask);
+        if ((flags & POINTER_NORAW) == 0)
+            set_raw_valuators(raw, &mask, raw->valuators.data);
     }
     else {
         if (flags & POINTER_ACCELERATE)
             accelPointer(pDev, &mask, ms);
+        if ((flags & POINTER_NORAW) == 0)
+            set_raw_valuators(raw, &mask, raw->valuators.data);
+
         moveRelative(pDev, &mask);
     }
 
     /* valuators are in device coordinate system in absolute coordinates */
-
-    if ((flags & POINTER_NORAW) == 0)
-        set_raw_valuators(raw, &mask, raw->valuators.data);
-
     scale_to_desktop(pDev, &mask, &devx, &devy, &screenx, &screeny);
     scr = positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
                          &mask, &devx, &devy, &screenx, &screeny);
commit a095f7ae96a353073add83e78f88f29d854d289d
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Mar 21 14:03:27 2012 +1000

    dix: fix compiler warning "unused variable 'scr'"
    
    getevents.c: In function 'updateSlaveDeviceCoords':
    getevents.c:326:15: warning: unused variable 'scr' [-Wunused-variable]
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 9c3bd3ae652af386b6821b197d24528f20ba867d)

diff --git a/dix/getevents.c b/dix/getevents.c
index 68bf58c..260955b 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -328,7 +328,6 @@ rescaleValuatorAxis(double coord, AxisInfoPtr from, AxisInfoPtr to,
 static void
 updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
 {
-    ScreenPtr scr = miPointerGetScreen(pDev);
     int i;
     DeviceIntPtr lastSlave;
 
commit d0a6d9bcefaf56aa63708ea69e5c399dbf266d63
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Mar 12 16:26:29 2012 +1000

    Xext: drop InitServertime() declaration.
    
    Not implemented anywhere.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Bryce Harrington <bryce at canonical.com>
    (cherry picked from commit 5910f2df58beaae2187438fef0b62c29a563e853)

diff --git a/Xext/syncsrv.h b/Xext/syncsrv.h
index e7ef1f4..b0464b3 100644
--- a/Xext/syncsrv.h
+++ b/Xext/syncsrv.h
@@ -141,7 +141,5 @@ extern void SyncChangeCounter(SyncCounter * /* pCounter */ ,
 
 extern void SyncDestroySystemCounter(pointer pCounter);
 
-extern void InitServertime(void);
-
 extern void SyncExtensionInit(void);
 #endif                          /* _SYNCSRV_H_ */
commit f8446ad3d71cdf9c2200f5584bd156c629fe3c90
Author: Chase Douglas <chase.douglas at canonical.com>
Date:   Wed Mar 7 16:06:27 2012 -0800

    Use a new sprite trace for indirect touches when all touches have physically ended
    
    All touches of an indirect device, such as a trackpad, are sent to the
    same window set. When there are no active touches, a new window set is
    created; otherwise, the window set of an existing touch is copied.
    
    The current code checks for any logically active touches. This includes
    touches that have physically ended but are still logically active due to
    unhandled touch grabs. Instead, we want a new window set whenever there
    are no physically active touches.
    
    This change skips over logically active but pending end touches, which
    are touches that have physically ended.
    
    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>
    (cherry picked from commit 31df08a449cf9b6e1740e1c02257997490630d93)

diff --git a/dix/touch.c b/dix/touch.c
index 5d7132e..0829b65 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -510,7 +510,8 @@ TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite)
     /* All touches should have the same sprite trace, so find and reuse an
      * existing touch's sprite if possible, else use the device's sprite. */
     for (i = 0; i < t->num_touches; i++)
-        if (t->touches[i].sprite.spriteTraceGood > 0)
+        if (!t->touches[i].pending_finish &&
+            t->touches[i].sprite.spriteTraceGood > 0)
             break;
     if (i < t->num_touches)
         srcsprite = &t->touches[i].sprite;
commit 5a3ec826e653377e8b70e7553d1f0ca72210447c
Author: Chase Douglas <chase.douglas at canonical.com>
Date:   Wed Mar 7 16:06:26 2012 -0800

    Xi: Fix TouchEnd to TouchUpdate change for one accepted grab
    
    If there is only one listener of a touch, the listener is a grab, and is
    accepted before the touch has ended, the current code will not end the
    touch record when the touch does end.
    
    This change adds a listener state for when a touch is accepted but has
    not yet ended. We now keep the touch record alive in this state, but end
    it when the touch ends.
    
    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>
    (cherry picked from commit 58427e08a4a36ce9e213e4b4fe5249d5db2c764d)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index a690a19..f681a8b 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1210,6 +1210,8 @@ ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
         /* Owner accepted after receiving end */
         if (ti->listeners[0].state == LISTENER_HAS_END)
             TouchEndTouch(dev, ti);
+        else
+            ti->listeners[0].state = LISTENER_HAS_ACCEPTED;
     }
     else {                      /* this is the very first ownership event for a grab */
         DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource);
@@ -1730,7 +1732,11 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
     else {
         if (has_ownershipmask)
             TouchSendOwnershipEvent(dev, ti, 0, listener->listener);
-        state = LISTENER_IS_OWNER;
+
+        if (!has_ownershipmask || listener->type == LISTENER_REGULAR)
+            state = LISTENER_HAS_ACCEPTED;
+        else
+            state = LISTENER_IS_OWNER;
     }
     listener->state = state;
 
@@ -1759,20 +1765,22 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
         listener->state = LISTENER_HAS_END;
     }
     else if (TouchResourceIsOwner(ti, listener->listener)) {
+        Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT);
+
         /* FIXME: what about early acceptance */
-        if (!(ev->device_event.flags & TOUCH_ACCEPT)) {
-            if (listener->state != LISTENER_HAS_END)
-                rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
-            listener->state = LISTENER_HAS_END;
-        }
+        if (normal_end && listener->state != LISTENER_HAS_END)
+            rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
+
         if ((ti->num_listeners > 1 ||
-             (listener->type == LISTENER_GRAB &&
-              xi2mask_isset(xi2mask, dev, XI_TouchOwnership))) &&
+             listener->state != LISTENER_HAS_ACCEPTED) &&
             (ev->device_event.flags & (TOUCH_ACCEPT | TOUCH_REJECT)) == 0) {
             ev->any.type = ET_TouchUpdate;
             ev->device_event.flags |= TOUCH_PENDING_END;
             ti->pending_finish = TRUE;
         }
+
+        if (normal_end)
+            listener->state = LISTENER_HAS_END;
     }
 
  out:
diff --git a/include/input.h b/include/input.h
index a9d0944..d891fe5 100644
--- a/include/input.h
+++ b/include/input.h
@@ -523,7 +523,8 @@ enum TouchListenerState {
     LISTENER_AWAITING_OWNER,       /**< Waiting for a TouchOwnership event */
     LISTENER_EARLY_ACCEPT,         /**< Waiting for ownership, has already
                                         accepted */
-    LISTENER_IS_OWNER,             /**< Is the current owner */
+    LISTENER_IS_OWNER,             /**< Is the current owner, hasn't accepted */
+    LISTENER_HAS_ACCEPTED,         /**< Is the current owner, has accepted */
     LISTENER_HAS_END,              /**< Has already received the end event */
 };
 
commit a8c9a93c66edce893af3ba460d728fe2bc48c2af
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Feb 27 10:09:44 2012 +1000

    dix: when rescaling from master, rescale from desktop dimensions (#46657)
    
    master->last.valuators[] is in desktop dimensions, so use those as
    rescale axis ranges, not the screen. Otherwise, a rescale on any screen
    not the top-left will cause out-of-bounds coordinates which will always
    map to the bottom-right screen, causing the device to be stuck on that
    screen.
    
    X.Org Bug 46657 <http://bugs.freedesktop.org/show_bug.cgi?id=46657>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
    (cherry picked from commit eb84c154ed38194c32651727b6dfe2d1bde4c599)

diff --git a/dix/getevents.c b/dix/getevents.c
index 2f6f06c..68bf58c 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -345,13 +345,15 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
         pDev->last.valuators[0] = rescaleValuatorAxis(pDev->last.valuators[0],
                                                       NULL,
                                                       pDev->valuator->axes + 0,
-                                                      0, scr->width);
+                                                      screenInfo.x,
+                                                      screenInfo.width);
     }
     if (pDev->valuator->numAxes > 1) {
         pDev->last.valuators[1] = rescaleValuatorAxis(pDev->last.valuators[1],
                                                       NULL,
                                                       pDev->valuator->axes + 1,
-                                                      0, scr->height);
+                                                      screenInfo.y,
+                                                      screenInfo.height);
     }
 
     /* calculate the other axis as well based on info from the old
commit bc8dc7183b50800470080eaa9c04cfd6ecc3591b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Feb 16 15:11:40 2012 +1000

    Xext: return BadAccess if PickPointer fails (#45796)
    
    PickPointer or PickKeyboard return NULL, all MDs are currently disabled and
    we cannot emulate a core event. This wasn't anticipated by the protocol, so
    we don't really have an error code we may use here - BadAccess is simply the
    least bad of the possible ones.
    
    And returning BadAccess beats crashing the server.
    
    X.Org Bug 45796 <http://bugs.freedesktop.org/show_bug.cgi?id=45796>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 6b6afd3d013e3f4910fae3520d1d786df2b0e47a)

diff --git a/Xext/xtest.c b/Xext/xtest.c
index 2414457..e659b41 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -118,6 +118,10 @@ ProcXTestCompareCursor(ClientPtr client)
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
         return rc;
+
+    if (!ptr)
+        return BadAccess;
+
     if (stuff->cursor == None)
         pCursor = NullCursor;
     else if (stuff->cursor == XTestCurrentCursor)
@@ -307,9 +311,15 @@ ProcXTestFakeInput(ClientPtr client)
             return BadValue;
         }
 
+        /* Technically the protocol doesn't allow for BadAccess here but
+         * this can only happen when all MDs are disabled.  */
+        if (!dev)
+            return BadAccess;
+
         dev = GetXTestDevice(dev);
     }
 
+
     /* If the event has a time set, wait for it to pass */
     if (ev->u.keyButtonPointer.time) {
         TimeStamp activateTime;


More information about the xorg-commit mailing list