xserver: Branch 'master' - 5 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Nov 11 18:58:36 PST 2010


 Xi/extinit.c                    |    4 ++--
 dix/devices.c                   |    2 +-
 hw/xfree86/common/xf86Config.c  |   36 +++++++++++++++++++-----------------
 hw/xfree86/common/xf86Globals.c |    4 ++--
 hw/xfree86/common/xf86Privstr.h |    3 +--
 hw/xquartz/darwin.c             |    2 --
 hw/xquartz/darwinEvents.c       |    7 ++++---
 test/xi2/protocol-common.c      |    1 +
 8 files changed, 30 insertions(+), 29 deletions(-)

New commits:
commit 965e709f2b0b17f1e59e5aeb5e7717fede51ef97
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu Nov 11 17:23:33 2010 -0800

    XQuartz: Build-fixes for XQuartz for recent input API changes
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 018ce78..fce3b2c 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -314,7 +314,6 @@ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) {
                                     (PtrCtrlProcPtr)NoopDDA,
                                     GetMotionHistorySize(), NAXES,
                                     axes_labels);
-            pPointer->valuator->mode = Absolute; // Relative
             InitAbsoluteClassDeviceStruct(pPointer);
 //            InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
 //            InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
@@ -362,7 +361,6 @@ static int DarwinTabletProc(DeviceIntPtr pPointer, int what) {
                                     (PtrCtrlProcPtr)NoopDDA,
                                     GetMotionHistorySize(), NAXES,
                                     axes_labels);
-            pPointer->valuator->mode = Absolute; // Relative
             InitProximityClassDeviceStruct(pPointer);
 			InitAbsoluteClassDeviceStruct(pPointer);
 
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 672d768..9e03525 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group.
 #include   "windowstr.h"
 #include   "pixmapstr.h"
 #include   "inputstr.h"
+#include   "inpututils.h"
 #include   "eventstr.h"
 #include   "mi.h"
 #include   "scrnintstr.h"
@@ -414,7 +415,6 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa
 			     float pressure, float tilt_x, float tilt_y) {
 	static int darwinFakeMouseButtonDown = 0;
 	int i, num_events;
-    ValuatorMask mask;
     ScreenPtr screen;
     int valuators[5];
 	
@@ -465,9 +465,10 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa
 
     DarwinPrepareValuators(pDev, valuators, screen, pointer_x, pointer_y, pressure, tilt_x, tilt_y);
     darwinEvents_lock(); {
+        ValuatorMask mask;
         valuator_mask_set_range(&mask, 0, (pDev == darwinTabletCurrent) ? 5 : 2, valuators);
         num_events = GetPointerEvents(darwinEvents, pDev, ev_type, ev_button, 
-                                      POINTER_ABSOLUTE, 0, &mask);
+                                      POINTER_ABSOLUTE, &mask);
         for(i=0; i<num_events; i++) mieqEnqueue (pDev, (InternalEvent*)darwinEvents[i].event);
         if(num_events > 0) DarwinPokeEQ();
     } darwinEvents_unlock();
@@ -493,7 +494,6 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) {
     ScreenPtr screen;
     DeviceIntPtr pDev = darwinTabletCurrent;
     int valuators[5];
-    ValuatorMask mask;
 
 	DEBUG_LOG("DarwinSendProximityEvents(%d, %f, %f)\n", ev_type, pointer_x, pointer_y);
 
@@ -510,6 +510,7 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) {
 
     DarwinPrepareValuators(pDev, valuators, screen, pointer_x, pointer_y, 0.0f, 0.0f, 0.0f);
     darwinEvents_lock(); {
+        ValuatorMask mask;
         valuator_mask_set_range(&mask, 0, 5, valuators);
         num_events = GetProximityEvents(darwinEvents, pDev, ev_type, &mask);
         for(i=0; i<num_events; i++) mieqEnqueue (pDev, (InternalEvent*)darwinEvents[i].event);
commit fa50670c32637faff6bb91f1206a0e3c17a9bada
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Nov 12 11:48:08 2010 +1000

    xfree86: rename allowEmptyInput to forceInputDevices.
    
    This is a more accurate name for the actual functionality than
    allowEmptyInput. Historically, allowEmptyInput has allowed the server to
    start with no input devices. Since 1.4 and the introduction of VCP and VCK,
    there are always two input devices present.
    
    allowEmptyInput was changed in behaviour to essentially "ignore xorg.conf
    devices or not", auto-adding the built-in devices if disabled.
    
    Rename to forceInputDevices, because that's essentially what it does. When
    disabled (i.e. when hotplugging is enabled), it disables all
    mouse/kbd/vmmouse devices configured in the xorg.conf file.
    When enabled, it forces the traditional behaviour for input devices:
    - use input devices configured in the server layout
    - if none are configured, use the first pointer and the first keyboard
      device in the xorg.conf
    - if none are configured, create the default pointer/keyboard devices.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 568b2d6..a9e827e 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -951,12 +951,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
     }
 #endif
 
-    /* AllowEmptyInput is automatically true if we're hotplugging */
-    xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
+    /* if we're not hotplugging, force some input devices to exist */
+    xf86Info.forceInputDevices = !(xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
 
-    /* AEI on? Then we're not using kbd, so use the evdev rules set. */
+    /* when forcing input devices, we use kbd. otherwise evdev, so use the
+     * evdev rules set. */
 #if defined(linux)
-    if (xf86Info.allowEmptyInput)
+    if (!xf86Info.forceInputDevices)
         set.rules = "evdev";
 #endif
     XkbSetRulesDflts(&set);
@@ -1173,7 +1174,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 3. First core pointer device. */
-    if (!foundPointer && (!xf86Info.allowEmptyInput || implicitLayout)) {
+    if (!foundPointer && (xf86Info.forceInputDevices || implicitLayout)) {
 	XF86ConfInputPtr p;
 
 	for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
@@ -1189,7 +1190,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 4. First pointer with an allowed mouse driver. */
-    if (!foundPointer && !xf86Info.allowEmptyInput) {
+    if (!foundPointer && xf86Info.forceInputDevices) {
 	const char **driver = mousedrivers;
 	confInput = xf86findInput(CONF_IMPLICIT_POINTER,
 				  xf86configptr->conf_input_lst);
@@ -1206,7 +1207,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 5. Built-in default. */
-    if (!foundPointer && !xf86Info.allowEmptyInput) {
+    if (!foundPointer && xf86Info.forceInputDevices) {
 	memset(&defPtr, 0, sizeof(defPtr));
 	defPtr.inp_identifier = strdup("<default pointer>");
 	defPtr.inp_driver = strdup("mouse");
@@ -1232,7 +1233,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	}
     }
 
-    if (!foundPointer && !xf86Info.allowEmptyInput) {
+    if (!foundPointer && xf86Info.forceInputDevices) {
 	/* This shouldn't happen. */
 	xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
 	return FALSE;
@@ -1256,7 +1257,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	    driver++;
 	}
     }
-    if (!found && !xf86Info.allowEmptyInput) {
+    if (!found && xf86Info.forceInputDevices) {
 	xf86Msg(X_INFO, "No default mouse found, adding one\n");
 	memset(&defPtr, 0, sizeof(defPtr));
 	defPtr.inp_identifier = strdup("<default pointer>");
@@ -1315,7 +1316,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 3. First core keyboard device. */
-    if (!foundKeyboard && (!xf86Info.allowEmptyInput || implicitLayout)) {
+    if (!foundKeyboard && (xf86Info.forceInputDevices || implicitLayout)) {
 	XF86ConfInputPtr p;
 
 	for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
@@ -1331,7 +1332,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */
-    if (!foundKeyboard && !xf86Info.allowEmptyInput) {
+    if (!foundKeyboard && xf86Info.forceInputDevices) {
 	confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
 				  xf86configptr->conf_input_lst);
 	if (!confInput) {
@@ -1346,7 +1347,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 5. Built-in default. */
-    if (!foundKeyboard && !xf86Info.allowEmptyInput) {
+    if (!foundKeyboard && xf86Info.forceInputDevices) {
 	memset(&defKbd, 0, sizeof(defKbd));
 	defKbd.inp_identifier = strdup("<default keyboard>");
 	defKbd.inp_driver = strdup("kbd");
@@ -1372,7 +1373,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	}
     }
 
-    if (!foundKeyboard && !xf86Info.allowEmptyInput) {
+    if (!foundKeyboard && xf86Info.forceInputDevices) {
 	/* This shouldn't happen. */
 	xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
 	return FALSE;
@@ -1398,7 +1399,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	            "\tUsing the %s.\n", keyboardMsg);
     }
 
-    if (xf86Info.allowEmptyInput && !(foundPointer && foundKeyboard)) {
+    if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
 #if defined(CONFIG_HAL) || defined(CONFIG_UDEV)
 	const char *config_backend;
 #if defined(CONFIG_HAL)
@@ -2311,10 +2312,11 @@ static void
 checkInput(serverLayoutPtr layout, Bool implicit_layout) {
     checkCoreInputDevices(layout, implicit_layout);
 
-    /* AllowEmptyInput and the "kbd" and "mouse" drivers are mutually
-     * exclusive. Trawl the list for mouse/kbd devices and disable them.
+    /* Unless we're forcing input devices, disable mouse/kbd devices in the
+     * config. Otherwise the same physical device is added multiple times,
+     * leading to duplicate events.
      */
-    if (xf86Info.allowEmptyInput && layout->inputs)
+    if (!xf86Info.forceInputDevices && layout->inputs)
     {
         InputInfoPtr *dev = layout->inputs;
         BOOL warned = FALSE;
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index dbe2a1d..2c10005 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -128,11 +128,11 @@ xf86InfoRec xf86Info = {
     .disableRandR               = FALSE,
     .randRFrom                  = X_DEFAULT,
 #if defined(CONFIG_HAL) || defined(CONFIG_UDEV)
-    .allowEmptyInput            = TRUE,
+    .forceInputDevices          = FALSE,
     .autoAddDevices             = TRUE,
     .autoEnableDevices          = TRUE
 #else
-    .allowEmptyInput            = FALSE,
+    .forceInputDevices          = TRUE,
     .autoAddDevices             = FALSE,
     .autoEnableDevices          = FALSE
 #endif
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index efe19e2..608f9bd 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -107,8 +107,7 @@ typedef struct {
     MessageType		useDefaultFontPathFrom;
     Bool        ignoreABI;
 
-    Bool        allowEmptyInput;  /* Allow the server to start with no input
-                                   * devices. */
+    Bool        forceInputDevices; /* force xorg.conf or built-in input devices */
     Bool        autoAddDevices; /* Whether to succeed NIDR, or ignore. */
     Bool        autoEnableDevices; /* Whether to enable, or let the client
                                     * control. */
commit c481dae0dc89d8d50cac23210023d75bfaf6012b
Author: Cyril Brulebois <kibi at debian.org>
Date:   Thu Nov 11 23:55:55 2010 +0100

    test: Fix missing xkbsrv.h include.
    
    Otherwise, building fails with CFLAGS="-Wall -Werror" this way:
    | protocol-common.c: In function ‘init_simple’:
    | protocol-common.c:159: error: implicit declaration of function ‘XkbInitPrivates’
    | protocol-common.c:159: error: nested extern declaration of ‘XkbInitPrivates’
    
    Signed-off-by: Cyril Brulebois <kibi at debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c
index 50f2b86..10d82a5 100644
--- a/test/xi2/protocol-common.c
+++ b/test/xi2/protocol-common.c
@@ -28,6 +28,7 @@
 #include <stdint.h>
 #include "extinit.h" /* for XInputExtensionInit */
 #include "exglobals.h"
+#include "xkbsrv.h" /* for XkbInitPrivates */
 #include <glib.h>
 
 #include "protocol-common.h"
commit b8114f25b266624c8f73d03c710349f98693d877
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Nov 12 08:32:05 2010 +1000

    dix: fix typo in setting valuator modes (#21548)
    
    X.Org Bug 31548 <http://bugs.freedesktop.org/show_bug.cgi?id=31548>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Cyril Brulebois <kibi at debian.org>

diff --git a/dix/devices.c b/dix/devices.c
index a4c8e76..708860a 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2592,6 +2592,6 @@ void valuator_set_mode(DeviceIntPtr dev, int axis, int mode)
     else {
         int i;
         for (i = 0; i < dev->valuator->numAxes; i++)
-            dev->valuator->axes[axis].mode = mode;
+            dev->valuator->axes[i].mode = mode;
     }
 }
commit 5cd11d2356d153840f1b429bdb8284367f8dc468
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jun 9 17:10:57 2010 +1000

    Xi: move property reset from extension shutdown to init.
    
    If any part of the stack calls XIGetKnownProperty during device shutdown
    the property is re-initialized before the server generation resets, leaving
    the value invalid again.
    
    Move the reset to the extension init which happens before input devices are
    initialized before the first property is requested.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 7edadea..546ccb4 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -1120,8 +1120,6 @@ RestoreExtensionEvents(void)
 static void
 IResetProc(ExtensionEntry * unused)
 {
-    XIResetProperties();
-
     ReplySwapVector[IReqCode] = ReplyNotSwappd;
     EventSwapVector[DeviceValuator] = NotImplemented;
     EventSwapVector[DeviceKeyPress] = NotImplemented;
@@ -1301,6 +1299,8 @@ XInputExtensionInit(void)
 
 	inputInfo.all_devices = &xi_all_devices;
 	inputInfo.all_master_devices = &xi_all_master_devices;
+
+	XIResetProperties();
     } else {
 	FatalError("IExtensionInit: AddExtensions failed\n");
     }


More information about the xorg-commit mailing list