xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Mon Jul 22 16:21:36 PDT 2013


 dix/getevents.c                |    6 +++---
 hw/xfree86/common/xf86Module.h |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 21ea7ebb6a1ad56f3060747af0df235ca6ff27fa
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jul 19 08:56:38 2013 +1000

    dix: scale y back instead of x up when pre-scaling coordinates
    
    The peculiar way we handle coordinates results in relative coordinates on
    absolute devices being added to the last value, then that value is mapped to
    the screen (taking the device dimensions into account). From that mapped
    value we get the final coordinates, both screen and device coordinates.
    
    To avoid uneven scaling on relative coordinates, they are pre-scaled by
    screen ratio:resolution:device ratio factor before being mapped. This
    ensures that a circle drawn on the device is a circle on the screen.
    
    Previously, we used the ratio to scale x up. Synaptics already does its own
    scaling based on the resolution and that is done by scaling y down by the
    ratio. So we can remove the code from the driver and get approximately the
    same behaviour here.
    
    Minor ABI bump, so we can remove this from synaptics.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Emmanuel Benisty <benisty.e at gmail.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index 51d4fd4..f5ab8c4 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -773,7 +773,7 @@ add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, doubl
 static void
 scale_for_device_resolution(DeviceIntPtr dev, ValuatorMask *mask)
 {
-    double x;
+    double y;
     ValuatorClassPtr v = dev->valuator;
     int xrange = v->axes[0].max_value - v->axes[0].min_value + 1;
     int yrange = v->axes[1].max_value - v->axes[1].min_value + 1;
@@ -783,14 +783,14 @@ scale_for_device_resolution(DeviceIntPtr dev, ValuatorMask *mask)
     double resolution_ratio = 1.0;
     double ratio;
 
-    if (!valuator_mask_fetch_double(mask, 0, &x))
+    if (!valuator_mask_fetch_double(mask, 1, &y))
         return;
 
     if (v->axes[0].resolution != 0 && v->axes[1].resolution != 0)
         resolution_ratio = 1.0 * v->axes[0].resolution/v->axes[1].resolution;
 
     ratio = device_ratio/resolution_ratio/screen_ratio;
-    valuator_mask_set_double(mask, 0, x * ratio);
+    valuator_mask_set_double(mask, 1, y / ratio);
 }
 
 /**
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 1393427..e0cec05 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, 1)
+#define ABI_XINPUT_VERSION	SET_ABI_VERSION(19, 2)
 #define ABI_EXTENSION_VERSION	SET_ABI_VERSION(7, 0)
 #define ABI_FONT_VERSION	SET_ABI_VERSION(0, 6)
 


More information about the xorg-commit mailing list