GNOME Bugzilla – Bug 652247
Always rotate touchscreen input in single monitor
Last modified: 2014-02-14 01:39:40 UTC
No point in doing it any other way. We should really find out a way to match XRandR outputs and input devices though.
Peter, if you have an idea about the latter, it would be much appreciated.
right now, you'd have to use the driver-specific rotation options. a set of patches for generic rotation is queued, but it probably won't hit until server 1.12. evdev has Evdev Axis Inversion and Evdev Axis Swap, Wacom has Wacom Rotation. The problem is identifying touchscreens. Most will have XI_TOUCHSCREEN as type, but wacom uses types of "STYLUS", "ERASER", "PAD", "TOUCH", and "CURSOR". Plus, there is no straightforward way yet to know if a wacom tablet was built-in. For now, ignoring wacom is probably the best idea until we have a LUT for each device model
(In reply to comment #2) > right now, you'd have to use the driver-specific rotation options. a set of > patches for generic rotation is queued, but it probably won't hit until server > 1.12. That's fine, we can change that code in the future. FWIW, the code implementing that is already in http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/xrandr/gsd-xrandr-manager.c#n1350 > evdev has Evdev Axis Inversion and Evdev Axis Swap, Wacom has Wacom Rotation. > The problem is identifying touchscreens. Most will have XI_TOUCHSCREEN as type, > but wacom uses types of "STYLUS", "ERASER", "PAD", "TOUCH", and "CURSOR". Plus, > there is no straightforward way yet to know if a wacom tablet was built-in. > > For now, ignoring wacom is probably the best idea until we have a LUT for each > device model Done. But that's not quite what I asked :) For touchscreen devices that use evdev as the driver, we'd really like to know which XRandR output they're attached to, so can know whether to rotate them as well, or not. Right now, the only way to be 100% sure is to only rotate input devices when there's just one output.
I'm not sure you'll like this answer :) We don't map to an output, we map to an area on the screen. That area is defined by the transformation matrix of the device (which uses a range of 0..1 for width/height mapping). A device is mapped to a particular output if the transformation matrix happens to coincide with the output. e.g. if you have two identical monitors and the matrix claims the device is mapped to 50% of the screen at an offset of 50%, the device is effectively mapped to the right screen. You need to extract that from the matrix. http://wiki.x.org/wiki/XInputCoordinateTransformationMatrixUsage http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Dual_and_Multi-Monitor_Set_Up
The patches in #709600 address the issue at hand here, so closing this bug as a dup. *** This bug has been marked as a duplicate of bug 709600 ***