All tools on the same tablet share the rotation value, so if one of them is
rotated, all of them must be. Since the property value is stored in the
server, we need to trigger it explicitly.

Test case:
$> xsetwacom set "device name stylus" Rotate half
$> xsetwacom get "device name eraser" Rotate

Should print out the correct rotation value.

Fixes #3070450

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
 src/wcmXCommand.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index 64ebb8d..9e0b1e8 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -540,6 +540,33 @@ static int wcmSetStripProperty(DeviceIntPtr dev, Atom 
property,
 }
 
 /**
+ * Update the rotation property for all tools on the same physical tablet as
+ * pInfo.
+ */
+static void wcmUpdateRotationProperty(WacomDevicePtr priv)
+{
+       WacomCommonPtr common = priv->common;
+       WacomDevicePtr other;
+       char rotation = common->wcmRotate;
+
+       for (other = common->wcmDevices; other; other = other->next)
+       {
+               InputInfoPtr pInfo;
+               DeviceIntPtr dev;
+
+               if (other == priv)
+                       continue;
+
+               pInfo = other->pInfo;
+               dev = pInfo->dev;
+
+               XIChangeDeviceProperty(dev, prop_rotation, XA_INTEGER, 8,
+                                      PropModeReplace, 1, &rotation,
+                                      TRUE);
+       }
+}
+
+/**
  * Only allow deletion of a property if it is not being used by any of the
  * button actions.
  */
@@ -643,7 +670,10 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, 
XIPropertyValuePtr prop,
                        return BadValue;
 
                if (!checkonly && common->wcmRotate != value)
+               {
                        wcmRotateTablet(pInfo, value);
+                       wcmUpdateRotationProperty(priv);
+               }
        } else if (property == prop_serials)
        {
                return BadValue; /* Read-only */
-- 
1.7.4.2


------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to