After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730583 - Match touchscreen and display based on physical size
Match touchscreen and display based on physical size
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: xrandr
3.13.x
Other All
: Normal normal
: ---
Assigned To: Carlos Garnacho
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2014-05-22 14:57 UTC by Bastien Nocera
Modified: 2014-05-28 14:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
common: Implement size matching on screen-integrated devices (7.32 KB, patch)
2014-05-26 18:40 UTC, Carlos Garnacho
committed Details | Review

Description Bastien Nocera 2014-05-22 14:57:45 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
Comment 1 Bastien Nocera 2014-05-22 15:39:34 UTC
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!
Comment 2 Carlos Garnacho 2014-05-26 18:40:33 UTC
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.
Comment 3 Bastien Nocera 2014-05-28 10:22:10 UTC
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
Comment 4 Carlos Garnacho 2014-05-28 14:26:01 UTC
Attachment 277241 [details] pushed as bc996ff - common: Implement size matching on screen-integrated devices