xserver: Branch 'master' - 7 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Dec 6 19:46:23 PST 2010


 Xi/exevents.c                        |    6 ++--
 dix/eventconvert.c                   |    8 -----
 hw/xfree86/common/xf86Config.c       |    5 ++-
 hw/xfree86/common/xf86Xinput.c       |    5 ++-
 hw/xfree86/common/xf86Xinput.h       |    1 
 hw/xfree86/doc/devel/Registry        |    1 
 hw/xfree86/doc/man/xorg.conf.man.pre |   48 +++++++++++++++++++++--------------
 mi/mieq.c                            |    8 +++++
 8 files changed, 49 insertions(+), 33 deletions(-)

New commits:
commit 01e9fa7da389fc7ab834b4234b8484514144b7f4
Merge: 79870db... 68a1b0d...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Dec 6 19:45:11 2010 -0800

    Merge remote branch 'whot/for-keith'

commit 68a1b0de95f71f74835c6c0f002699fcdccbb268
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 6 14:58:37 2010 +1000

    xfree86: use xf86AllocateInput() for xorg.conf devices too.
    
    Single allocation point for input devices, most notably a single point to
    reset default values.
    Without this patch, the file descriptor default was -1 for hotplugged
    devices and 0 for config devices. Drivers that don't overwrite the default
    themselves would thus fail if configured in the xorg.conf.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index c352f3c..ae9592e 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1458,7 +1458,7 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp)
     irp = layout->lay_input_lst;
     count = 0;
     while (irp) {
-	indp[count] = xnfalloc(sizeof(InputInfoRec));
+	indp[count] = xf86AllocateInput();
 	if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) {
 	    while(count--)
 		free(indp[count]);
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 0fc5e1d..c2cf438 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -653,7 +653,7 @@ IgnoreInputClass(const InputInfoPtr idev, const InputAttributes *attrs)
     return ignore;
 }
 
-static InputInfoPtr
+InputInfoPtr
 xf86AllocateInput(void)
 {
     InputInfoPtr pInfo;
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 3a17116..1b0b16f 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -155,6 +155,7 @@ extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic);
 extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev);
 /* not exported */
 int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto);
+InputInfoPtr xf86AllocateInput(void);
 
 /* xf86Helper.c */
 extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
commit beea2378f142556471c62290e275935af848e137
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 6 14:33:43 2010 +1000

    xfree86: don't overwrite option list (#32115)
    
    Options set in the configuration file were unconditionally overwritten by
    the server. Merge the already existing options and the new options together
    instead of just overwriting ones.
    
    Introduced in commit 2199842ed50b3eb40d54146827fc58cae7e873ec
    Author: Peter Hutterer <peter.hutterer at who-t.net>
    Date:   Thu Sep 2 10:52:54 2010 +1000
    
        xfree86: remove extraOptions field from IDevRec.
    
    X.Org Bug 32115 <http://bugs.freedesktop.org/show_bug.cgi?id=32115>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Tested-by: David Ronis <ronis at ronispc.chem.mcgill.ca>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 5800700..c352f3c 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1465,7 +1465,8 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp)
 	    free(indp);
 	    return FALSE;
 	}
-	indp[count]->options = irp->iref_option_lst;
+	indp[count]->options = xf86OptionListMerge(indp[count]->options,
+						   irp->iref_option_lst);
 	count++;
 	irp = (XF86ConfInputrefPtr)irp->list.next;
     }
commit 8f3fa8fb0b0a75dac714fc213c034b20595898d3
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 6 15:44:50 2010 +1000

    xfree86: add option "Floating", deprecate SendCoreEvents and friends.
    
    Some devices should be initialised as floating from the start (e.g.
    Joysticks and accelerometers benefit from this). Currently users use the
    "SendCoreEvents" "off" flag for this, which isn't the most appropriate
    naming.
    
    Add an option "Floating", deprecate the others. Still parsed and handled by
    the server.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 81bb707..0fc5e1d 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -280,7 +280,8 @@ void
 xf86ProcessCommonOptions(InputInfoPtr pInfo,
                          pointer	list)
 {
-    if (!xf86SetBoolOption(list, "AlwaysCore", 1) ||
+    if (xf86SetBoolOption(list, "Floating", 0) ||
+        !xf86SetBoolOption(list, "AlwaysCore", 1) ||
         !xf86SetBoolOption(list, "SendCoreEvents", 1) ||
         !xf86SetBoolOption(list, "CorePointer", 1) ||
         !xf86SetBoolOption(list, "CoreKeyboard", 1)) {
diff --git a/hw/xfree86/doc/devel/Registry b/hw/xfree86/doc/devel/Registry
index e09228b..48e24a2 100644
--- a/hw/xfree86/doc/devel/Registry
+++ b/hw/xfree86/doc/devel/Registry
@@ -243,6 +243,7 @@ DemandLoad                O     I    ??
 Device                    S     I    Device file name
 DeviceName                S     I    Input device name
 FlowControl               S     I    Serial flow control ("xon", "none")
+Floating                  B     I    Device initialised as floating
 HistorySize               I     I    ??
 MaxX                      I     I    Maximum X coordinate
 MaxY                      I     I    Maximum Y coordinate
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index ba876c0..e3fd0ea 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -904,30 +904,42 @@ the server. This affects implied layouts as well as explicit layouts
 specified in the configuration and/or on the command line.
 .TP 7
 .BI "Option \*qCorePointer\*q"
-Deprecated, use
-.B SendCoreEvents
-instead.
+Deprecated, see
+.B Floating
 .TP 7
 .BI "Option \*qCoreKeyboard\*q"
-Deprecated, use
-.B SendCoreEvents
-instead.
+Deprecated, see
+.B Floating
 .TP 7
 .BI "Option \*qAlwaysCore\*q  \*q" boolean \*q
-.B
-Deprecated, use
-.B SendCoreEvents
-instead.
+Deprecated, see
+.B Floating
 .TP 7
 .BI "Option \*qSendCoreEvents\*q  \*q" boolean \*q
-Both of these options are equivalent, and when enabled cause the
-input device to report core events through the master device. They are
-enabled by default.  Any device configured to send core events will be
-attached to the virtual core pointer or keyboard and control the cursor by
-default. Devices with
-.B SendCoreEvents
-disabled will be \*qfloating\*q and only accessible by clients employing the
-X Input extension. This option controls the startup behavior only, a device
+Deprecated, see
+.B Floating
+
+.TP 7
+.BI "Option \*qFloating\*q  \*q" boolean \*q
+When enabled, the input device is set up floating and does not
+report events through any master device or control a cursor. The device is
+only available to clients using the X Input Extension API. This option is
+disabled by default.
+The options
+.B CorePointer,
+.B CoreKeyboard,
+.B AlwaysCore,
+and
+.B SendCoreEvents,
+are the inverse of option
+.B Floating
+(i.e.
+.B SendCoreEvents \*qon\*q
+is equivalent to
+.B Floating \*qoff\*q
+).
+
+This option controls the startup behavior only, a device
 may be reattached or set floating at runtime.
 .PP
 For pointing devices, the following options control how the pointer
commit 36b614dedf4ddc428e43ad1542d4f9314f73f60a
Author: Eoghan Sherry <ejsherry at gmail.com>
Date:   Sun Nov 28 16:15:51 2010 -0500

    Xi: Fix master button update when slave buttons are mapped. #24887
    
    It is currently assumed that an event button delieved to a master device
    corresponds to the slave button states. However, the event button is a
    logical (mapped) slave button and slave button states correspond to
    physical (unmapped) slave buttons. This leads to incorrect update of the
    master button state and incorrect events devlivered to clients. Fix the
    situation by taking the slave button map into account when querying a
    slave button state.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24887
    
    Signed-off-by: Eoghan Sherry <ejsherry at gmail.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index d57265e..8615fd4 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -870,8 +870,10 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event)
                     continue;
                 if (!sd->button)
                     continue;
-                if (button_is_down(sd, key, BUTTON_PROCESSED))
-                    return DONT_PROCESS;
+                for (i = 1; i <= sd->button->numButtons; i++)
+                    if (sd->button->map[i] == key &&
+                        button_is_down(sd, i, BUTTON_PROCESSED))
+                        return DONT_PROCESS;
             }
         }
         set_button_up(device, key, BUTTON_PROCESSED);
commit 31ab9f8860848504df18a8be9d19b817b191e0df
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Sep 3 11:54:41 2010 +1000

    mi: handle DGA subtypes when determining the master device.
    
    The subtype in the DGA event is the core type and all ET_ event types (where
    applicable) are identical to the core types. Thus the switch statement below
    will work as required and assign the right master device.
    
    Fixes a crasher bug on keyboard devices with valuators. If a device sends a
    motion event while grabbed and a DGA client is active (but has not selected
    input through DGA), the valuator event is posted through the VCK and
    eventually results in a NULL-pointer dereference on dev->valuator.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/mi/mieq.c b/mi/mieq.c
index d1441e2..01da52a 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -320,6 +320,7 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
 {
     DeviceIntPtr mdev;
     int len = original->any.length;
+    int type = original->any.type;
 
     CHECKEVENT(original);
 
@@ -327,7 +328,12 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
     if (!sdev || !sdev->u.master)
         return NULL;
 
-    switch(original->any.type)
+#if XFreeXDGA
+    if (type == ET_DGAEvent)
+        type = original->dga_event.subtype;
+#endif
+
+    switch(type)
     {
         case ET_KeyPress:
         case ET_KeyRelease:
commit 5d31c3e705dfd9f38f0fffcd07a6d8d06644735c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Nov 26 09:37:37 2010 +1000

    dix: don't stop processing valuators when the mode changes.
    
    XI 1.x events still contain absolute coordinates anyway. By the time we get
    to the InternalEvent to XI event conversion, the valuators are already
    absolute.
    
    Stopping because of a different mode on a valuator is not necessary.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index dd17898..7b894f0 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -326,14 +326,6 @@ countValuators(DeviceEvent *ev, int *first)
     {
         if (BitIsOn(ev->valuators.mask, i))
         {
-            /* Assume mode of first_valuator matches XI1 device mode. Stop when the
-             * event mode changes since XI1 can't handle mixed mode devices.
-             */
-            if (first_valuator > -1 &&
-                 BitIsOn(ev->valuators.mode, i) !=
-                 BitIsOn(ev->valuators.mode, first_valuator))
-                break;
-
             if (first_valuator == -1)
                 first_valuator = i;
             last_valuator = i;


More information about the xorg-commit mailing list