[RFC PATCH] Add XI_PROP_ROTATION property to the server's properties.

Peter Hutterer peter.hutterer at who-t.net
Tue Mar 22 22:13:55 PDT 2011


Having rotation support has been a feature requested for a while
now. Now we've had two independent implementations happen within quite a
short timeframe, one in synaptics, one in evdev (and wacom has had it's own
implementation for a while). So the question is now, how to do this best.

We have the transformation matrix in the server which can be used to rotate
absolute devices. But it's not yet suited for relative devices and I'm not
100% sure it's a trivial task to do so.

The alternative is a separate transformation property. To unify this, I'd
like to see this property defined by the server (but not necessarily
implemented by the server). Since different devices have different
requirements (e.g. synaptics may only allow rotation in 90 deg angles) it
seems best implemented by the driver.

Of course, the exact semantics of where this property fits in have to be
documented to avoid nasty surprises, but that'll happen in the final version
of this patch then.

Does that make sense?

---
 Xi/xiproperty.c              |    3 ++-
 include/xserver-properties.h |    7 +++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 83ce930..61b1fdc 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -179,7 +179,8 @@ static struct dev_properties
     {0, BTN_LABEL_PROP_BTN_GEAR_DOWN},
     {0, BTN_LABEL_PROP_BTN_GEAR_UP},
 
-    {0, XI_PROP_TRANSFORM}
+    {0, XI_PROP_TRANSFORM},
+    {0, XI_PROP_ROTATION},
 };
 
 static long XIPropHandlerID = 1;
diff --git a/include/xserver-properties.h b/include/xserver-properties.h
index c6259ae..cd95a61 100644
--- a/include/xserver-properties.h
+++ b/include/xserver-properties.h
@@ -42,6 +42,13 @@
  * [c6 c7 c8]   [1] */
 #define XI_PROP_TRANSFORM "Coordinate Transformation Matrix"
 
+/* CARD32, 1 value
+ *
+ * Device rotation in 1/10 of a degree. Range 0...3600. This property is
+ * implemented by the driver, and may have additional restrictions.
+ */
+#define XI_PROP_ROTATION "Device Rotation"
+
 /* Pointer acceleration properties */
 /* INTEGER of any format */
 #define ACCEL_PROP_PROFILE_NUMBER "Device Accel Profile"
-- 
1.7.4



More information about the xorg-devel mailing list