xserver: Branch 'master' - 4 commits

Peter Hutterer whot at kemper.freedesktop.org
Sun Jul 5 20:07:08 PDT 2009


 Xext/xtest.c                         |   25 +++++++++++++++++++++++--
 dix/devices.c                        |    2 ++
 hw/xfree86/os-support/shared/sigio.c |    6 +++---
 include/inputstr.h                   |    2 +-
 mi/midispcur.c                       |    2 +-
 5 files changed, 30 insertions(+), 7 deletions(-)

New commits:
commit 89cf81cd85919e3dbb5adff5e6c6056c7990b60f
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jul 3 10:29:40 2009 +1000

    Xext: return BadValue for XTestFakeInput on unsupported capabilities.
    
    Calling XTestFakeDevice*Event on a device that doesn't allow the matching
    event returns BadValue.
    
    Reported-by: Florian Echtler
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xext/xtest.c b/Xext/xtest.c
index 67f12ac..cbbc51a 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -189,11 +189,34 @@ ProcXTestFakeInput(ClientPtr client)
         switch (type) {
             case XI_DeviceKeyPress:
             case XI_DeviceKeyRelease:
+                if (!dev->key)
+                {
+                    client->errorValue = ev->u.u.type;
+                    return BadValue;
+                }
+                break;
             case XI_DeviceButtonPress:
             case XI_DeviceButtonRelease:
+                if (!dev->button)
+                {
+                    client->errorValue = ev->u.u.type;
+                    return BadValue;
+                }
+                break;
             case XI_DeviceMotionNotify:
+                if (!dev->valuator)
+                {
+                    client->errorValue = ev->u.u.type;
+                    return BadValue;
+                }
+                break;
             case XI_ProximityIn:
             case XI_ProximityOut:
+                if (!dev->proximity)
+                {
+                    client->errorValue = ev->u.u.type;
+                    return BadValue;
+                }
                 break;
             default:
                 client->errorValue = ev->u.u.type;
commit b773b4e8e0087993406d1d8c2df895db4d6301ff
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jul 6 11:04:47 2009 +1000

    s/MAX_DEVICES/MAXDEVICES/ updates.
    
    The number of input devices is MAXDEVICES, not MAX_DEVICES (f781a752e6)
    Two comments updated to refer to MAXDEVICES.
    
    MAX_FUNCS in sigio.c was set to 16 if MAX_DEVICES was undefined. If more
    than 15 physical input devices were present, this could result in a
    failure to install the SIGIO handler for any device above 15.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
index 5ba0b7e..44136cc 100644
--- a/hw/xfree86/os-support/shared/sigio.c
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -75,11 +75,11 @@
 #  define O_ASYNC FASYNC
 #endif
 
-#ifdef MAX_DEVICES
-/* MAX_DEVICES represents the maximimum number of input devices usable
+#ifdef MAXDEVICES
+/* MAXDEVICES represents the maximimum number of input devices usable
  * at the same time plus one entry for DRM support.
  */
-# define MAX_FUNCS   (MAX_DEVICES + 1)
+# define MAX_FUNCS   (MAXDEVICES + 1)
 #else
 # define MAX_FUNCS 16
 #endif
diff --git a/include/inputstr.h b/include/inputstr.h
index b284ea4..73750e0 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -119,7 +119,7 @@ typedef struct _InputClients {
  * OtherInputMasks struct and exactly one InputClients struct hanging off
  * inputClients. Each further client appends to the inputClients list.
  * Each Mask field is per-device, with the device id as the index.
- * Exception: for non-device events (Presence events), the MAX_DEVICES
+ * Exception: for non-device events (Presence events), the MAXDEVICES
  * deviceid is used.
  */
 typedef struct _OtherInputMasks {
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 7b3ce29..3fb7e02 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -51,7 +51,7 @@ in this Software without prior written authorization from The Open Group.
 # include   "picturestr.h"
 #endif
 
-# include "inputstr.h" /* for MAX_DEVICES */
+# include "inputstr.h"
 
 /* per-screen private data */
 static int miDCScreenKeyIndex;
commit 183c075d2f9d5f6effa1ce7ab135fb0c2e46085a
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jul 3 13:26:48 2009 +1000

    dix: always init the full button map to default values (#22594)
    
    Master devices must have the standard button map applied for all buttons to
    ensure buttons larger than 7 (the default for MDs) are mapped appropriately.
    
    We can't copy the button map from SDs to MDs since that breaks the chained
    button mapping. However, by ensuring all buttons (even non-existing ones)
    are mapped, devices that send such buttons continue to work.
    
    X.Org Bug 22594 <http://bugs.freedesktop.org/show_bug.cgi?id=22594>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/devices.c b/dix/devices.c
index e000f29..8fac981 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1172,6 +1172,8 @@ InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, Atom* labels,
     butc->sourceid = dev->id;
     for (i = 1; i <= numButtons; i++)
 	butc->map[i] = map[i];
+    for (i = numButtons + 1; i < MAP_LENGTH; i++)
+        butc->map[i] = i;
     memcpy(butc->labels, labels, numButtons * sizeof(Atom));
     dev->button = butc;
     return TRUE;
commit 744bb559826ede37a77e9000b6c620eaa6a3c837
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jul 3 13:58:38 2009 +1000

    Xext: remove unused variable 'it'.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xext/xtest.c b/Xext/xtest.c
index 4f5c527..67f12ac 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -270,8 +270,6 @@ ProcXTestFakeInput(ClientPtr client)
 
     } else
     {
-        DeviceIntPtr it;
-
         if (nev != 1)
             return BadLength;
         switch (type)


More information about the xorg-commit mailing list