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 681083 - imon USB touchscreen is not reported as GDK_SOURCE_TOUCHSCREEN
imon USB touchscreen is not reported as GDK_SOURCE_TOUCHSCREEN
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GdkDevice
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Carlos Garnacho
Depends on:
Blocks:
 
 
Reported: 2012-08-02 16:22 UTC by Felix Braun
Modified: 2018-04-15 00:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Felix Braun 2012-08-02 16:22:28 UTC
I have an imon USB touchscreen on which I am trying to run a GTK application. Unfortunately, this touchscreen is not recognised as a GDK_SOURCE_TOUCHSCREEN but as a GDK_SOURCE_MOUSE, so that kinetic scrolling is not enabled.

Library is libgtk-3.4.2-0ubuntu0.4

Output from gdk_device_manager_list_sources()
Eee PC WMI hotkeys <enum GDK_SOURCE_KEYBOARD of type GdkInputSource>
iMON Remote (15c2:0035) <enum GDK_SOURCE_KEYBOARD of type GdkInputSource>
iMON USB Touchscreen (15c2:0035) <enum GDK_SOURCE_MOUSE of type GdkInputSource>
iMON Panel, Knob and Mouse(15c2:0035) <enum GDK_SOURCE_MOUSE of type GdkInputSource>
Power Button <enum GDK_SOURCE_KEYBOARD of type GdkInputSource>
Power Button <enum GDK_SOURCE_KEYBOARD of type GdkInputSource>
Virtual core XTEST keyboard <enum GDK_SOURCE_KEYBOARD of type GdkInputSource>
Virtual core XTEST pointer <enum GDK_SOURCE_MOUSE of type GdkInputSource>

Is there a way to force touchscreen mode? I have included gtk-touchscreen-mode=1 in .gtkrc2.0, but I guess that applies only to gtk+2.x

Thanks for any pointers.
Comment 1 Matthias Clasen 2012-08-07 04:03:31 UTC
Lets try to get some diagnostics. Can you run

xinput list

identify the touchscreen device in the output, and then run

xinput query-state <device id>
xinput list-props <device id>

?
Comment 2 Felix Braun 2012-08-07 05:10:42 UTC
$ xinput query-state 9
2 classes :
ButtonClass
	button[1]=up
	button[2]=up
	button[3]=up
	button[4]=up
	button[5]=up
ValuatorClass Mode=Absolute Proximity=In
	valuator[0]=320
	valuator[1]=180

$ xinput list-props 9
Device 'iMON USB Touchscreen (15c2:0035)':
	Device Enabled (132):	1
	Coordinate Transformation Matrix (134):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (257):	0
	Device Accel Constant Deceleration (258):	1.000000
	Device Accel Adaptive Deceleration (259):	1.000000
	Device Accel Velocity Scaling (260):	10.000000
	Device Product ID (252):	5570, 53
	Device Node (253):	"/dev/input/event4"
	Evdev Axis Inversion (261):	0, 0
	Evdev Axis Calibration (262):	62, 3824, 358, 3839
	Evdev Axes Swap (263):	0
	Axis Labels (264):	"Abs X" (278), "Abs Y" (279)
	Button Labels (265):	"Button Unknown" (255), "Button Unknown" (255), "Button Unknown" (255), "Button Wheel Up" (138), "Button Wheel Down" (139)
	Evdev Middle Button Emulation (266):	0
	Evdev Middle Button Timeout (267):	50
	Evdev Third Button Emulation (268):	0
	Evdev Third Button Emulation Timeout (269):	1000
	Evdev Third Button Emulation Button (270):	3
	Evdev Third Button Emulation Threshold (271):	20
	Evdev Wheel Emulation (272):	0
	Evdev Wheel Emulation Axes (273):	0, 0, 4, 5
	Evdev Wheel Emulation Inertia (274):	10
	Evdev Wheel Emulation Timeout (275):	200
	Evdev Wheel Emulation Button (276):	4
	Evdev Drag Lock Buttons (277):	0
Comment 3 Matthias Clasen 2012-08-08 19:41:36 UTC
ok, so the reason we don't consider this a touch device is that it doesn't have a touch class. Peter, any advice for how to best recognize such devices. Just look for 'touchscreen' in the name ? :-(
Comment 4 Felix Braun 2012-08-09 12:16:11 UTC
The kernel driver knows this is a touch screen because of the device id. Maybe it doesn't export this flag to the XInput layer?
Comment 5 Peter Hutterer 2012-08-10 07:07:14 UTC
Unfortunately not, it's missing from XI2. You can query the XI 1.x XDeviceInfo->type and check if it matches "TOUCHSCREEN" but I'm not sure that's always set correctly. This would still be the most reliable approach.

Alternatively, you can check the axes and assume that something with 2 absolute axes is a touchscreen but that's prone to errors too. Sorry, I don't really have any better suggestions here.
Comment 6 Felix Braun 2012-08-20 17:52:48 UTC
Well, if it is complicated to autodetect the correct settings, it should at least be possible to override the detection manually. But setting gtk_touchscreen_mode=1 in .gtkrc2.0 does not seem to have any effect.
Comment 7 Daniel Boles 2018-03-16 09:33:25 UTC
A setting in the GTK+ 2 config isn't going to affect GTK+ 3.

The setting was moved to GtkSettings:gtk-touchscreen-mode in GTK+ 3, although it's deprecated. You could try it, though, if this is still a problem in 3.22. And on that note: is it?
Comment 8 Matthias Clasen 2018-04-15 00:27:47 UTC
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla.

If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab:

https://gitlab.gnome.org/GNOME/gtk/issues/new