[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'upstream-experimental'



 Xext/xtest.c                           |   17 +-
 Xi/exevents.c                          |    2 
 configure.ac                           |    6 
 dix/devices.c                          |   46 ++++++-
 dix/events.c                           |    6 
 dix/getevents.c                        |   75 ++++++++++--
 dix/ptrveloc.c                         |   38 +++---
 hw/dmx/config/xdmxconfig.c             |    3 
 hw/xfree86/common/xf86Events.c         |    4 
 hw/xfree86/common/xf86Module.h         |    2 
 hw/xfree86/common/xf86pciBus.c         |   64 +++++++++-
 hw/xfree86/man/xorg.conf.man           |   11 -
 hw/xfree86/os-support/linux/lnx_acpi.c |    9 -
 include/input.h                        |    3 
 include/inputstr.h                     |    8 -
 include/list.h                         |    2 
 include/misc.h                         |    1 
 include/protocol-versions.h            |    2 
 os/log.c                               |   21 ++-
 os/utils.c                             |   32 +++++
 randr/randrstr.h                       |    2 
 randr/rrcrtc.c                         |    5 
 test/signal-logging.c                  |  200 ++++++++++++++++-----------------
 xkb/xkbActions.c                       |  147 ++++++++++++++----------
 24 files changed, 468 insertions(+), 238 deletions(-)

New commits:
commit 955d434f4d755d00a24ae4068b9957765989d672
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Feb 13 21:39:37 2013 -0800

    Update to version 1.3.99.902 (1.14 RC2)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/configure.ac b/configure.ac
index 435a38f..53335b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,9 +26,9 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.13.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2012-12-19"
-RELEASE_NAME="Egg Nog"
+AC_INIT([xorg-server], 1.13.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2013-02-12"
+RELEASE_NAME="Ginger Beer"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 

commit 7115f6c709898a5124b67e19c61dc01334471358
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Wed Jan 23 16:58:47 2013 -0800

    randr: unref the provider shared pixmap the appropriate number of times
    
    When an RandR shared pixmap is created in rrCreateSharedPixmap, it has a refcnt
    of 1.  Then, PixmapShareToSlave bumps the refcnt to 2.  However, there's no
    corresponding PixmapUnshareFromSlave where the refcnt can be decreased again,
    and there's no convenient common place where the refcnt can be decremented when
    the slave pixmap is destroyed.
    
    Fix this by just unreffing the pixmap twice in RRCrtcDetachScanoutPixmap.
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index e82d050..6e2eca5 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -372,6 +372,11 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
     ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
     if (crtc->scanout_pixmap) {
         master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap);
+        /*
+         * Unref the pixmap twice: once for the original reference, and once
+         * for the reference implicitly added by PixmapShareToSlave.
+         */
+        master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap);
         master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap);
         crtc->pScreen->DestroyPixmap(crtc->scanout_pixmap);
     }

commit da92690107d90061205340d4cdc98b73b59db9b2
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Mon Feb 11 14:31:56 2013 -0800

    xf86: use nt_list_for_each_entry_safe to walk InputHandlers in xf86Wakeup
    
    This is necessary when the input handler deletes itself from the
    list. Bug found by Maarten Lankhorst, this patch uses the list macros
    instead of open-coding the fix.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 377e936..d92174e 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -272,9 +272,9 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
     }
 
     if (err >= 0) {             /* we don't want the handlers called if select() */
-        IHPtr ih;               /* returned with an error condition, do we?      */
+        IHPtr ih, ih_tmp;       /* returned with an error condition, do we?      */
 
-        for (ih = InputHandlers; ih; ih = ih->next) {
+        nt_list_for_each_entry_safe(ih, ih_tmp, InputHandlers, next) {
             if (ih->enabled && ih->fd >= 0 && ih->ihproc &&
                 (FD_ISSET(ih->fd, ((fd_set *) pReadmask)) != 0)) {
                 ih->ihproc(ih->fd, ih->data);

commit d0a14877872b6a33172fb8c8f335792a28b9499b
Author: Bryce Harrington <bryce@canonical.com>
Date:   Fri Feb 8 15:56:02 2013 -0800

    xfree86: Man page shouldn't say Device is mandatory anymore
    
    man xorg.conf states that the 'Device' identifier is required in the
    'Screen' section, yet current xserver defaults properly and boots up
    fine without it.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=20742
    Signed-off-by: Bryce Harrington <bryce@canonical.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index 5d92bbe..9361ce9 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -1821,9 +1821,7 @@ sections have the following format:
 .PP
 The
 .B Identifier
-and
-.B Device
-entries are mandatory.
+entry is mandatory.
 All others are optional.
 .PP
 The
@@ -1841,11 +1839,10 @@ The entries available
 for this section are:
 .TP 7
 .BI "Device  \*q" device\-id \*q
-This mandatory entry specifies the
+This entry specifies the
 .B Device
-section to be used for this screen.
-This is what ties a specific graphics card to a screen.
-The
+section to be used for this screen.  When multiple graphics cards are
+present, this is what ties a specific card to a screen.  The
 .I device\-id
 must match the
 .B Identifier

commit 5e91054aa070ea09b61325b7ec479d767b02730e
Author: Bryce Harrington <bryce@canonical.com>
Date:   Fri Feb 8 15:56:01 2013 -0800

    xfree86: Use fbdev/vesa driver on Oaktrail, Medfield, CDV rather than -intel
    
    Instead of defaulting to -intel for Oaktrail, Medfield, and CDV chips,
    default to -fbdev.  For Poulsbo (only), attempt to use -psb if it's
    installed, and fallback to fbdev otherwise.  All other Intel chips
    should use -intel.
    
    This fixed an issue where -intel would load on these chips and cause a
    boot failure.  Newer -intel drivers avoid the boot hang, but it's still
    the wrong driver to load, so why take chances.
    
    The patch was originally created by Stefan Dirsch for OpenSUSE.  We have
    included it in our stable release (Ubuntu "quantal" 12.10) since
    December.
    
    ref:  https://bugzilla.novell.com/show_bug.cgi?id=772279
    ref:  https://bugs.launchpad.net/ubuntu/+bug/1069031
    Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=60514
    Signed-off-by: Bryce Harrington <bryce@canonical.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index a2c18eb..258988a 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1147,14 +1147,62 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
         driverList[0] = "i128";
         break;
     case 0x8086:
-        if ((dev->device_id == 0x00d1) || (dev->device_id == 0x7800)) {
-            driverList[0] = "i740";
-        }
-        else if (dev->device_id == 0x8108) {
-            break;              /* "hooray" for poulsbo */
-        }
-        else {
-            driverList[0] = "intel";
+	switch (dev->device_id)
+	{
+		/* Intel i740 */
+		case 0x00d1:
+		case 0x7800:
+			driverList[0] = "i740";
+			break;
+		/* GMA500/Poulsbo */
+		case 0x8108:
+		case 0x8109:
+			/* Try psb driver on Poulsbo - if available */
+			driverList[0] = "psb";
+			driverList[1] = "psb_drv";
+			break;
+		/* GMA600/Oaktrail */
+		case 0x4100:
+		case 0x4101:
+		case 0x4102:
+		case 0x4103:
+		case 0x4104:
+		case 0x4105:
+		case 0x4106:
+		case 0x4107:
+		/* Atom E620/Oaktrail */
+		case 0x4108:
+		/* Medfield */
+		case 0x0130:
+		case 0x0131:
+		case 0x0132:
+		case 0x0133:
+		case 0x0134:
+		case 0x0135:
+		case 0x0136:
+		case 0x0137:
+		/* GMA 3600/CDV */
+		case 0x0be0:
+		case 0x0be1:
+		case 0x0be2:
+		case 0x0be3:
+		case 0x0be4:
+		case 0x0be5:
+		case 0x0be6:
+		case 0x0be7:
+		case 0x0be8:
+		case 0x0be9:
+		case 0x0bea:
+		case 0x0beb:
+		case 0x0bec:
+		case 0x0bed:
+		case 0x0bee:
+		case 0x0bef:
+			/* Use fbdev/vesa driver on Oaktrail, Medfield, CDV */
+			break;
+		default:
+			driverList[0] = "intel";
+			break;
         }
         break;
     case 0x102b:

commit c1602d1c17967bdd4db9db19b3a9c0dfca6a58aa
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Feb 5 07:46:06 2013 -0800

    randr: bump advertised RandR version to 1.4
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
    Tested-by: Aaron Plattner <aplattner@nvidia.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/include/protocol-versions.h b/include/protocol-versions.h
index 10f5117..5ceaeb0 100644
--- a/include/protocol-versions.h
+++ b/include/protocol-versions.h
@@ -65,7 +65,7 @@
 
 /* RandR */
 #define SERVER_RANDR_MAJOR_VERSION		1
-#define SERVER_RANDR_MINOR_VERSION		3
+#define SERVER_RANDR_MINOR_VERSION		4
 
 /* Record */
 #define SERVER_RECORD_MAJOR_VERSION		1
diff --git a/randr/randrstr.h b/randr/randrstr.h
index a16302f..f52d0f2 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -57,7 +57,7 @@
 #define RANDR_13_INTERFACE 1    /* requires RANDR_12_INTERFACE */
 #define RANDR_GET_CRTC_INTERFACE 1
 
-#define RANDR_INTERFACE_VERSION 0x0103
+#define RANDR_INTERFACE_VERSION 0x0104
 
 typedef XID RRMode;
 typedef XID RROutput;

commit 9f79e93b6b3416055d08a0e8f9f16d5fd0649e36
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jan 30 03:20:07 2013 +0000

    Short-cut the input device cleanup process during AbortServer()
    
    If we're about to abort, we're already in the signal handler and cannot call
    down to the default device cleanup routines (which reset, free, alloc, and
    do a bunch of other things).
    
    Add a new DEVICE_ABORT mode to signal a driver's DeviceProc that it must
    reset the hardware if needed but do nothing else. An actual HW reset is only
    required for some drivers dealing with the HW directly.
    
    This is largely backwards-compatible, hence the input ABI minor bump only.
    
    Drivers we care about either return BadValue on a mode that's not
    DEVICE_{INIT|ON|OFF|CLOSE} or print an error and return BadValue. Exception
    here is vmmouse, which currently ignores it and would not reset anything.
    This should be fixed if the reset is required.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/devices.c b/dix/devices.c
index 530f15d..be236dd 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1056,6 +1056,25 @@ CloseDownDevices(void)
 }
 
 /**
+ * Signal all devices that we're in the process of aborting.
+ * This function is called from a signal handler.
+ */
+void
+AbortDevices(void)
+{
+    DeviceIntPtr dev;
+    nt_list_for_each_entry(dev, inputInfo.devices, next) {
+        if (!IsMaster(dev))
+            (*dev->deviceProc) (dev, DEVICE_ABORT);
+    }
+
+    nt_list_for_each_entry(dev, inputInfo.off_devices, next) {
+        if (!IsMaster(dev))
+            (*dev->deviceProc) (dev, DEVICE_ABORT);
+    }
+}
+
+/**
  * Remove the cursor sprite for all devices. This needs to be done before any
  * resources are freed or any device is deleted.
  */
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index e545c14..1393427 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -81,7 +81,7 @@ typedef enum {
  */
 #define ABI_ANSIC_VERSION	SET_ABI_VERSION(0, 4)
 #define ABI_VIDEODRV_VERSION	SET_ABI_VERSION(14, 1)
-#define ABI_XINPUT_VERSION	SET_ABI_VERSION(19, 0)
+#define ABI_XINPUT_VERSION	SET_ABI_VERSION(19, 1)
 #define ABI_EXTENSION_VERSION	SET_ABI_VERSION(7, 0)
 #define ABI_FONT_VERSION	SET_ABI_VERSION(0, 6)
 
diff --git a/include/input.h b/include/input.h
index 7b5ab94..5c65597 100644
--- a/include/input.h
+++ b/include/input.h
@@ -62,6 +62,7 @@ SOFTWARE.
 #define DEVICE_ON	1
 #define DEVICE_OFF	2
 #define DEVICE_CLOSE	3
+#define DEVICE_ABORT	4
 
 #define POINTER_RELATIVE	(1 << 1)
 #define POINTER_ABSOLUTE	(1 << 2)
@@ -269,6 +270,7 @@ extern void DisableAllDevices(void);
 extern int InitAndStartDevices(void);
 
 extern void CloseDownDevices(void);
+extern void AbortDevices(void);
 
 extern void UndisplayDevices(void);
 
diff --git a/os/log.c b/os/log.c
index 7b5c9ee..2697ace 100644
--- a/os/log.c
+++ b/os/log.c
@@ -663,7 +663,7 @@ AbortServer(void)
 #endif
     CloseWellKnownConnections();
     OsCleanup(TRUE);
-    CloseDownDevices();
+    AbortDevices();
     AbortDDX(EXIT_ERR_ABORT);
     fflush(stderr);
     if (CoreDump)

commit b58221f9da8c549d979215271359c6cd88b5568a
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Feb 8 14:52:02 2013 +1000

    dix: support the transformation matrix for relative devices.
    
    The transformation matrix we previously stored was a scaled matrix based on
    the axis ranges of the device. For relative movements, the scaling is not
    required (or desired).
    
    Store two separate matrices, one as requested by the client, one as the
    product of [scale . matrix . inv_scale]. Depending on the type of movement,
    apply the respective matrix.
    
    For relative movements, also drop the translation component since it doesn't
    really make sense to use that bit.
    
    Input ABI 19
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/devices.c b/dix/devices.c
index 172fc04..530f15d 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -93,9 +93,10 @@ SOFTWARE.
 static void RecalculateMasterButtons(DeviceIntPtr slave);
 
 static void
-DeviceSetTransform(DeviceIntPtr dev, float *transform)
+DeviceSetTransform(DeviceIntPtr dev, float *transform_data)
 {
     struct pixman_f_transform scale;
+    struct pixman_f_transform transform;
     double sx, sy;
     int x, y;
 
@@ -122,16 +123,21 @@ DeviceSetTransform(DeviceIntPtr dev, float *transform)
     /* transform */
     for (y = 0; y < 3; y++)
         for (x = 0; x < 3; x++)
-            dev->transform.m[y][x] = *transform++;
+            transform.m[y][x] = *transform_data++;
 
-    pixman_f_transform_multiply(&dev->transform, &scale, &dev->transform);
+    pixman_f_transform_multiply(&dev->scale_and_transform, &scale, &transform);
 
     /* scale */
     pixman_f_transform_init_scale(&scale, 1.0 / sx, 1.0 / sy);
     scale.m[0][2] = -dev->valuator->axes[0].min_value / sx;
     scale.m[1][2] = -dev->valuator->axes[1].min_value / sy;
 
-    pixman_f_transform_multiply(&dev->transform, &dev->transform, &scale);
+    pixman_f_transform_multiply(&dev->scale_and_transform, &dev->scale_and_transform, &scale);
+
+    /* remove translation component for relative movements */
+    dev->relative_transform = transform;
+    dev->relative_transform.m[0][2] = 0;
+    dev->relative_transform.m[1][2] = 0;
 }
 
 /**
@@ -308,9 +314,10 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
     /* unity matrix */
     memset(transform, 0, sizeof(transform));
     transform[0] = transform[4] = transform[8] = 1.0f;
-    dev->transform.m[0][0] = 1.0;
-    dev->transform.m[1][1] = 1.0;
-    dev->transform.m[2][2] = 1.0;
+    dev->relative_transform.m[0][0] = 1.0;
+    dev->relative_transform.m[1][1] = 1.0;
+    dev->relative_transform.m[2][2] = 1.0;
+    dev->scale_and_transform = dev->relative_transform;
 
     XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_TRANSFORM),
                            XIGetKnownProperty(XATOM_FLOAT), 32,
diff --git a/dix/getevents.c b/dix/getevents.c
index 7cc8d8c..a4f192c 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1202,6 +1202,27 @@ transform(struct pixman_f_transform *m, double *x, double *y)
     *y = p.v[1];
 }
 
+static void
+transformRelative(DeviceIntPtr dev, ValuatorMask *mask)
+{
+    double x = 0, y = 0;
+
+    valuator_mask_fetch_double(mask, 0, &x);
+    valuator_mask_fetch_double(mask, 1, &y);
+
+    transform(&dev->relative_transform, &x, &y);
+
+    if (x)
+        valuator_mask_set_double(mask, 0, x);
+    else
+        valuator_mask_unset(mask, 0);
+
+    if (y)
+        valuator_mask_set_double(mask, 1, y);
+    else
+        valuator_mask_unset(mask, 1);
+}
+
 /**
  * Apply the device's transformation matrix to the valuator mask and replace
  * the scaled values in mask. This transformation only applies to valuators
@@ -1229,7 +1250,7 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
         ox = dev->last.valuators[0];
         oy = dev->last.valuators[1];
 
-        pixman_f_transform_invert(&invert, &dev->transform);
+        pixman_f_transform_invert(&invert, &dev->scale_and_transform);
         transform(&invert, &ox, &oy);
 
         x = ox;
@@ -1242,7 +1263,7 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
     if (valuator_mask_isset(mask, 1))
         oy = y = valuator_mask_get_double(mask, 1);
 
-    transform(&dev->transform, &x, &y);
+    transform(&dev->scale_and_transform, &x, &y);
 
     if (valuator_mask_isset(mask, 0) || ox != x)
         valuator_mask_set_double(mask, 0, x);
@@ -1403,6 +1424,8 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
             set_raw_valuators(raw, &mask, raw->valuators.data);
     }
     else {
+        transformRelative(pDev, &mask);
+
         if (flags & POINTER_ACCELERATE)
             accelPointer(pDev, &mask, ms);
         if ((flags & POINTER_NORAW) == 0)
diff --git a/include/inputstr.h b/include/inputstr.h
index 48a29be..de96fae 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -588,8 +588,12 @@ typedef struct _DeviceIntRec {
         XIPropertyHandlerPtr handlers;  /* NULL-terminated */
     } properties;
 
-    /* coordinate transformation matrix for absolute input devices */
-    struct pixman_f_transform transform;
+    /* coordinate transformation matrix for relative movement. Matrix with
+     * the translation component dropped */
+    struct pixman_f_transform relative_transform;
+    /* scale matrix for absolute devices, this is the combined matrix of
+       [1/scale] . [transform] . [scale]. See DeviceSetTransform */
+    struct pixman_f_transform scale_and_transform;
 
     /* XTest related master device id */
     int xtest_master_id;

commit b173eb2ae3349c557db1ff9e424fa540b8289bb2
Author: Keith Packard <keithp@keithp.com>
Date:   Fri Feb 8 08:57:43 2013 -0800

    os: Round fraction in pnprintf %f format
    
    Truncating the fraction part leads to a test failure where -1203.30 is
    printed as -1203.29. Round this to the nearest value instead by adding
    0.5 before converting to an integer
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/os/utils.c b/os/utils.c
index 3ba6499..60e828e 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1999,7 +1999,7 @@ FormatDouble(double dbl, char *string)
     int slen = 0;
     uint64_t frac;
 
-    frac = (dbl > 0 ? dbl : -dbl) * 100.0;
+    frac = (dbl > 0 ? dbl : -dbl) * 100.0 + 0.5;
     frac %= 100;
 
     /* write decimal part to string */

commit 509b3c3dc82e7abce1900d5e1cddd90f23be5a87
Author: Carlos Garnacho <carlosg@gnome.org>
Date:   Wed Feb 6 14:07:22 2013 +0100

    dix: Set focus field on XI2 crossing events
    
    Set on DeviceEnterLeaveEvent() the xXIEnterEvent->focus field
    similarly to how the CoreEnterLeaveEvent() function above does
    for core events.
    
    This fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=677329
    reported to GTK+, where focus handling on window managers with
    sloppy focus or no window manager present was broken due to this
    field being always set to FALSE.
    
    Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/dix/events.c b/dix/events.c
index f72cdc7..2682ecd 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4569,6 +4569,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
 {
     GrabPtr grab = mouse->deviceGrab.grab;
     xXIEnterEvent *event;
+    WindowPtr focus;
     int filter;
     int btlen, len, i;
     DeviceIntPtr kbd;
@@ -4610,6 +4611,11 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
         event->group.locked_group = kbd->key->xkbInfo->state.locked_group;
     }
 
+    focus = (kbd) ? kbd->focus->win : None;
+    if ((focus != NoneWin) &&
+        ((pWin == focus) || (focus == PointerRootWin) || IsParent(focus, pWin)))
+        event->focus = TRUE;
+
     FixUpEventFromWindow(mouse->spriteInfo->sprite, (xEvent *) event, pWin,
                          None, FALSE);
 

commit 3e4be4033aed78b2bb3a18d51f0963989efd1af3
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jan 25 11:47:32 2013 +1000

    dix: when shutting down slave devices, shut down xtest devices last
    
    XTest devices are the first ones in the list, being initialised together
    with the master devices. If we disable the devices in-order and a device has
    a button down when being disabled, the XTest device is checked for a
    required button release (xkbAccessX.c's ProcessPointerEvent). This fails if
    the device is already NULL.
    
    Instead of putting the check there, disable the devices in the reverse order
    they are initialised. Disable physical slaves first, then xtest devices,
    then the master devices.
    
    Testcase: shut down server with a button still held down on a physical
    device
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/devices.c b/dix/devices.c
index 3c7d480..172fc04 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -516,6 +516,12 @@ DisableAllDevices(void)
 {
     DeviceIntPtr dev, tmp;
 
+    /* Disable slave devices first, excluding XTest devices */
+    nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
+        if (!IsXTestDevice(dev, NULL) && !IsMaster(dev))
+            DisableDevice(dev, FALSE);
+    }
+    /* Disable XTest devices */
     nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
         if (!IsMaster(dev))
             DisableDevice(dev, FALSE);

commit 61a99aff9d33728a0b67920254d2d4d79f80cf39
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jan 11 14:22:07 2013 +1000

    dix: pre-scale relative events from abs devices to desktop ratio (#31636)
    
    Absolute devices may send relative events depending on the mode (synaptics
    by default, wacom per option). The relative events are added to the previous
    position, converted into device coordinates and then scaled into desktop
    coordinates for pointer movement.
    
    Because the device range must be mapped into the desktop coordinate range,
    this results in uneven scaling depending dimensions, e.g. on a setup with
    width == 2 * height, a relative movement of 10/10 in device coordinates
    results in a cursor movement of 20/10 (+ acceleration)
    
    Other commonly user-visible results:
    * the touchpad changing acceleration once an external monitor as added.
    * drawing a circle on a wacom tablet in relative mode gives an ellipsis in
      the same ratio as the desktop dimensions.
    
    Solution: pre-scale the incoming relative x/y coordinates by width/height
    ratio of the total desktop size. Then add them to the previous
    coordinates and scale back with the previous mapping, which will undo the
    pre-scaling and give us the right movement.
    
    X.Org Bug 31636 <http://bugs.freedesktop.org/show_bug.cgi?id=31636>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index a1e1938..5100607 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -776,11 +776,33 @@ add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, doubl
  * @param[in,out] mask Valuator data for this event, modified in-place.
  */
 static void
-moveRelative(DeviceIntPtr dev, ValuatorMask *mask)
+moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask)
 {
     int i;
     Bool clip_xy = IsMaster(dev) || !IsFloating(dev);
 
+    /* for abs devices in relative mode, we've just scaled wrong, since we
+       mapped the device's shape into the screen shape. Undo this. */
+    if ((flags & POINTER_ABSOLUTE) == 0 && dev->valuator &&
+        dev->valuator->axes[0].min_value < dev->valuator->axes[0].max_value) {
+
+        double ratio = 1.0 * screenInfo.width/screenInfo.height;
+
+        if (ratio > 1.0) {
+            double y;
+            if (valuator_mask_fetch_double(mask, 1, &y)) {
+                y *= ratio;
+                valuator_mask_set_double(mask, 1, y);
+            }
+        } else {
+            double x;
+            if (valuator_mask_fetch_double(mask, 0, &x)) {
+                x *= ratio;
+                valuator_mask_set_double(mask, 0, x);
+            }
+        }
+    }
+
     /* calc other axes, clip, drop back into valuators */
     for (i = 0; i < valuator_mask_size(mask); i++) {
         double val = dev->last.valuators[i];
@@ -1380,7 +1402,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
         if ((flags & POINTER_NORAW) == 0)
             set_raw_valuators(raw, &mask, raw->valuators.data);
 
-        moveRelative(pDev, &mask);
+        moveRelative(pDev, flags, &mask);
     }
 
     /* valuators are in device coordinate system in absolute coordinates */

commit a6ba2b79ae8ad0fdee3f208d5e030b012df48785
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jan 11 08:53:24 2013 +1000

    dix: unify prefix for ptraccel debugging in DebugAccelF macro
    
    If we're already using our own custom macro, might as well use it properly.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index b6d2dae..d6fef9c 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -77,7 +77,7 @@ DeletePredictableAccelerationProperties(DeviceIntPtr,
 /*#define PTRACCEL_DEBUGGING*/
 
 #ifdef PTRACCEL_DEBUGGING
-#define DebugAccelF ErrorFSigSafe
+#define DebugAccelF(...) ErrorFSigSafe("dix/ptraccel: " __VA_ARGS__)
 #else
 #define DebugAccelF(...)        /* */
 #endif
@@ -421,7 +421,7 @@ void
 InitTrackers(DeviceVelocityPtr vel, int ntracker)
 {
     if (ntracker < 1) {
-        ErrorF("(dix ptracc) invalid number of trackers\n");
+        ErrorF("invalid number of trackers\n");
         return;
     }
     free(vel->tracker);
@@ -566,7 +566,7 @@ FeedTrackers(DeviceVelocityPtr vel, double dx, double dy, int cur_t)
     vel->tracker[n].dy = 0.0;
     vel->tracker[n].time = cur_t;
     vel->tracker[n].dir = GetDirection(dx, dy);
-    DebugAccelF("(dix prtacc) motion [dx: %f dy: %f dir:%d diff: %d]\n",
+    DebugAccelF("motion [dx: %f dy: %f dir:%d diff: %d]\n",
                 dx, dy, vel->tracker[n].dir,
                 cur_t - vel->tracker[vel->cur_tracker].time);
     vel->cur_tracker = n;
@@ -614,7 +614,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
 
         /* bail out if data is too old and protect from overrun */
         if (age_ms >= vel->reset_time || age_ms < 0) {
-            DebugAccelF("(dix prtacc) query: tracker too old (reset after %d, age is %d)\n",
+            DebugAccelF("query: tracker too old (reset after %d, age is %d)\n",
                         vel->reset_time, age_ms);
             break;
         }
@@ -627,7 +627,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
          */
         dir &= tracker->dir;
         if (dir == 0) {         /* we've changed octant of movement (e.g. NE → NW) */
-            DebugAccelF("(dix prtacc) query: no longer linear\n");
+            DebugAccelF("query: no longer linear\n");
             /* instead of breaking it we might also inspect the partition after,
              * but actual improvement with this is probably rare. */
             break;
@@ -648,7 +648,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
                 velocity_diff / (initial_velocity + tracker_velocity) >=
                 vel->max_rel_diff) {
                 /* we're not in range, quit - it won't get better. */
-                DebugAccelF("(dix prtacc) query: tracker too different:"
+                DebugAccelF("query: tracker too different:"
                             " old %2.2f initial %2.2f diff: %2.2f\n",
                             tracker_velocity, initial_velocity, velocity_diff);
                 break;
@@ -661,14 +661,14 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
         }
     }
     if (offset == vel->num_tracker) {
-        DebugAccelF("(dix prtacc) query: last tracker in effect\n");
+        DebugAccelF("query: last tracker in effect\n");
         used_offset = vel->num_tracker - 1;
     }
     if (used_offset >= 0) {
 #ifdef PTRACCEL_DEBUGGING
         MotionTracker *tracker = TRACKER(vel, used_offset);
 
-        DebugAccelF("(dix prtacc) result: offset %i [dx: %f dy: %f diff: %i]\n",
+        DebugAccelF("result: offset %i [dx: %f dy: %f diff: %i]\n",
                     used_offset, tracker->dx, tracker->dy,
                     cur_t - tracker->time);
 #endif
@@ -694,6 +694,8 @@ ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time)
 
     velocity = QueryTrackers(vel, time);
 
+    DebugAccelF("velocity is %f\n", velocity);
+
     vel->velocity = velocity;
     return velocity == 0;
 }
@@ -769,7 +771,7 @@ ComputeAcceleration(DeviceIntPtr dev,
     double result;
 
     if (vel->velocity <= 0) {
-        DebugAccelF("(dix ptracc) profile skipped\n");
+        DebugAccelF("profile skipped\n");
         /*
          * If we have no idea about device velocity, don't pretend it.
          */
@@ -793,13 +795,13 @@ ComputeAcceleration(DeviceIntPtr dev,
                                             threshold,
                                             acc);
         result /= 6.0f;
-        DebugAccelF("(dix ptracc) profile average [%.2f ... %.2f] is %.3f\n",
+        DebugAccelF("profile average [%.2f ... %.2f] is %.3f\n",
                     vel->velocity, vel->last_velocity, result);
     }
     else {
         result = BasicComputeAcceleration(dev, vel,
                                           vel->velocity, threshold, acc);
-        DebugAccelF("(dix ptracc) profile sample [%.2f] is %.3f\n",
+        DebugAccelF("profile sample [%.2f] is %.3f\n",
                     vel->velocity, result);
     }
 
@@ -1111,6 +1113,7 @@ acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime)
                                        (double) dev->ptrfeed->ctrl.num /
                                        (double) dev->ptrfeed->ctrl.den);
 
+            DebugAccelF("mult is %f\n", mult);
             if (mult != 1.0f || velocitydata->const_acceleration != 1.0f) {
                 if (mult > 1.0f && soften)
                     ApplySoftening(velocitydata, &dx, &dy);

commit 0d7d79406011169ad95e23c6e937f6d15a5ec3cc
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jan 11 08:52:08 2013 +1000

    dix: use BUG_RETURN_VAL for an error message
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 6994bd5..b6d2dae 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -1051,11 +1051,8 @@ SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel,
 DeviceVelocityPtr
 GetDevicePredictableAccelData(DeviceIntPtr dev)
 {
-    /*sanity check */
-    if (!dev) {
-        ErrorF("[dix] accel: DeviceIntPtr was NULL");
-        return NULL;
-    }
+    BUG_RETURN_VAL(!dev, NULL);
+
     if (dev->valuator &&
         dev->valuator->accelScheme.AccelSchemeProc ==
         acceleratePointerPredictable &&

commit a0c38ea6cbad61edcfefff0e5dd6330edb706f13
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jan 11 08:49:15 2013 +1000

    dix: add some more info to a ptraccel debug msg
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index b95f194..6994bd5 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -614,7 +614,8 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
 
         /* bail out if data is too old and protect from overrun */
         if (age_ms >= vel->reset_time || age_ms < 0) {
-            DebugAccelF("(dix prtacc) query: tracker too old\n");
+            DebugAccelF("(dix prtacc) query: tracker too old (reset after %d, age is %d)\n",
+                        vel->reset_time, age_ms);
             break;
         }
 

commit 95125a7c0cbbbae40216a0497acdd863ddc645ed
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Jan 10 13:19:27 2013 +1000

    dix: fix ptraccel debugging printfs
    
    This is mostly sigsafe code, so use sigsave printf. And update some fields
    to double that used to be int.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index c7994b0..b95f194 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -77,7 +77,7 @@ DeletePredictableAccelerationProperties(DeviceIntPtr,
 /*#define PTRACCEL_DEBUGGING*/
 
 #ifdef PTRACCEL_DEBUGGING
-#define DebugAccelF ErrorF
+#define DebugAccelF ErrorFSigSafe
 #else
 #define DebugAccelF(...)        /* */
 #endif
@@ -566,7 +566,7 @@ FeedTrackers(DeviceVelocityPtr vel, double dx, double dy, int cur_t)
     vel->tracker[n].dy = 0.0;
     vel->tracker[n].time = cur_t;
     vel->tracker[n].dir = GetDirection(dx, dy);
-    DebugAccelF("(dix prtacc) motion [dx: %i dy: %i dir:%i diff: %i]\n",
+    DebugAccelF("(dix prtacc) motion [dx: %f dy: %f dir:%d diff: %d]\n",
                 dx, dy, vel->tracker[n].dir,
                 cur_t - vel->tracker[vel->cur_tracker].time);
     vel->cur_tracker = n;
@@ -667,7 +667,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
 #ifdef PTRACCEL_DEBUGGING
         MotionTracker *tracker = TRACKER(vel, used_offset);
 
-        DebugAccelF("(dix prtacc) result: offset %i [dx: %i dy: %i diff: %i]\n",
+        DebugAccelF("(dix prtacc) result: offset %i [dx: %f dy: %f diff: %i]\n",
                     used_offset, tracker->dx, tracker->dy,
                     cur_t - tracker->time);
 #endif
@@ -799,7 +799,7 @@ ComputeAcceleration(DeviceIntPtr dev,
         result = BasicComputeAcceleration(dev, vel,
                                           vel->velocity, threshold, acc);
         DebugAccelF("(dix ptracc) profile sample [%.2f] is %.3f\n",
-                    vel->velocity, res);
+                    vel->velocity, result);
     }
 
     return result;
@@ -1122,8 +1122,7 @@ acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime)
                     valuator_mask_set_double(val, 0, mult * dx);
                 if (dy != 0.0)
                     valuator_mask_set_double(val, 1, mult * dy);
-                DebugAccelF("pos (%i | %i) delta x:%.3f y:%.3f\n", mult * dx,
-                            mult * dy);
+                DebugAccelF("delta x:%.3f y:%.3f\n", mult * dx, mult * dy);
             }
         }
     }

commit b33fcb149710a28fd8767b2307a97bf367de695e
Author: Andreas Wettstein <wettstein509@solnet.ch>
Date:   Tue Jan 29 21:49:20 2013 +0100

    xkb: Fix repeat behaviour of redirect and message actions


Reply to: