[PATCH] dix: send the current axis value in DeviceChangedEvents (#62321)

Peter Hutterer peter.hutterer at who-t.net
Mon Mar 25 21:39:16 PDT 2013


X.Org Bug 62321 <http://bugs.freedesktop.org/show_bug.cgi?id=62321>

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/eventconvert.c | 4 +---
 dix/getevents.c    | 1 +
 include/eventstr.h | 1 +
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 2c411cf..f931d81 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -501,9 +501,7 @@ appendValuatorInfo(DeviceChangedEvent *dce, xXIValuatorInfo * info,
     info->min.frac = 0;
     info->max.integral = dce->valuators[axisnumber].max;
     info->max.frac = 0;
-    /* FIXME: value */
-    info->value.integral = 0;
-    info->value.frac = 0;
+    info->value = double_to_fp3232(dce->valuators[axisnumber].value);
     info->resolution = dce->valuators[axisnumber].resolution;
     info->number = axisnumber;
     info->mode = dce->valuators[axisnumber].mode;
diff --git a/dix/getevents.c b/dix/getevents.c
index a4f192c..241c7ec 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -277,6 +277,7 @@ CreateClassesChangedEvent(InternalEvent *event,
             dce->valuators[i].mode = slave->valuator->axes[i].mode;
             dce->valuators[i].name = slave->valuator->axes[i].label;
             dce->valuators[i].scroll = slave->valuator->axes[i].scroll;
+            dce->valuators[i].value = slave->valuator->axisVal[i];
         }
     }
     if (slave->key) {
diff --git a/include/eventstr.h b/include/eventstr.h
index 38fab4f..5c1adc4 100644
--- a/include/eventstr.h
+++ b/include/eventstr.h
@@ -175,6 +175,7 @@ struct _DeviceChangedEvent {
     struct {
         uint32_t min;           /**< Minimum value */
         uint32_t max;           /**< Maximum value */
+        double value;           /**< Current value */;
         /* FIXME: frac parts of min/max */
         uint32_t resolution;    /**< Resolution counts/m */
         uint8_t mode;           /**< Relative or Absolute */
-- 
1.8.1.4



More information about the xorg-devel mailing list