GNOME Bugzilla – Bug 659519
Tablet tilt output not scaled correctly on Windows
Last modified: 2018-04-14 23:56:55 UTC
Original bug report in MyPaint: https://gna.org/bugs/?18692 After having problems with jerky movement in MyPaint I found that on windows the gdk tilt output was scaled to range -1000...1000. Documentation says the tilt range is in range -1.0...1.0. When MyPaint clamped the tilt the result was mostly either 1.0 or -1.0. Searching through the gdk code I found this gdkinput-win32.c @ ~600 --- GdkAxisUse axis; gdkdev->orientation_axes[0] = axis_or[0]; gdkdev->orientation_axes[1] = axis_or[1]; for (axis = GDK_AXIS_XTILT; axis <= GDK_AXIS_YTILT; axis++) { /* Wintab gives us aximuth and altitude, which * we convert to x and y tilt in the -1000..1000 range */ gdkdev->axes[k].resolution = 1000; gdkdev->axes[k].min_value = -1000; gdkdev->axes[k].max_value = 1000; gdkdev->info.axes[k].use = axis; gdkdev->info.axes[k].min = -1000; gdkdev->info.axes[k].max = 1000; k++; } --- The gdkdev->info.axes[k].min and gdkdev->info.axes[k].max should probably be: gdkdev->info.axes[k].min = -1.0; gdkdev->info.axes[k].max = 1.0; (I have no experience with gtk so I'm not quite sure and I haven't yet been able to compile gtk on windows )
Created attachment 198064 [details] [review] probable fix for gtk <= 2.90.0
this fix is for gtk <= 2.90.0
Looks like this has been fixed with refactoring 2.90.1 and newer in commit eb21a7df29093622.
I can confirm that this bug is still present in gtk-2-24 git. Tested on Windows Vista with Intuos3. In MyPaint, the effect is that tilt is always a multiple of 45 degrees. With the patch applied, tilt works as expected.
I've been testing Windows tilt recently. Once it's patched back into a working state there ☺ this old bug seems to have been resolved by 3.22.1. It's not a crasher, so maybe close it? GTK3 era packet-processing code can be found in decode_tilt() in gdk/win32/gdkdevicemanager-win32.c, which should match the _gdk_device_add_axis() doing the axis setup, for scaling considerations. Code: https://git.gnome.org/browse/gtk+/tree/gdk/win32/gdkdevicemanager-win32.c?h=gtk-3-22#n813
(^ as part of bug 774265)
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
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