GNOME Bugzilla – Bug 730583
Match touchscreen and display based on physical size
Last modified: 2014-05-28 14:26:06 UTC
When we find a touchscreen, we should be able to match it to an output based on the size of the panel. Through XI2, http://www.x.org/releases/X11R7.6/doc/inputproto/XI2proto.txt -> find AXISCLASS -> there is a resolution field. That will allow us to calculate the size of the touchscreen. If the size of the touchscreen roughly matches that of the output, we would have found a match. See also https://bugs.freedesktop.org/show_bug.cgi?id=79071
That's apparently available through XI2 properties: $ xinput list --long 11 <snip> Class originated from: 11. Type: XIValuatorClass Detail for Valuator 0: Label: Abs MT Position X Range: 0.000000 - 32767.000000 Resolution: 64000 units/m Mode: absolute Current value: 8475.000000 Class originated from: 11. Type: XIValuatorClass Detail for Valuator 1: Label: Abs MT Position Y Range: 0.000000 - 32767.000000 Resolution: 114000 units/m Mode: absolute Current value: 10972.000000 <snip> X = (32767-0) / 64000 = 0.511 m Y = (32767-0) / 114000.0 = 0.2874 m That's 0.58m diagonal or 22.9 inches. The screen is advertised through its EDID as 23 inches!
Created attachment 277241 [details] [review] common: Implement size matching on screen-integrated devices On these devices, attempt to find a match based on device WxH calculations and output size information from EDID. Allow for a certain error threshold as sizes don't exactly match.
Review of attachment 277241 [details] [review]: Looks good to commit. Can you please also stub out the "Hard-coded detection" code in a separate commit? ::: plugins/common/gsd-device-mapper.c @@ +671,3 @@ + gnome_rr_output_get_name (outputs[i]), + output_width, output_height); + return outputs[i]; I would loop through all the outputs to find the one that has the smallest margin instead. ::: plugins/common/gsd-input-helper.h @@ +88,3 @@ const char * xdevice_get_wacom_tool_type (int deviceid); + Whitespace change
Attachment 277241 [details] pushed as bc996ff - common: Implement size matching on screen-integrated devices