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 659519 - Tablet tilt output not scaled correctly on Windows
Tablet tilt output not scaled correctly on Windows
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: Win32
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-09-19 20:43 UTC by Egon Elbre
Modified: 2018-04-14 23:56 UTC
See Also:
GNOME target: ---
GNOME version: 2.31/2.32


Attachments
probable fix for gtk <= 2.90.0 (821 bytes, patch)
2011-10-03 09:19 UTC, Egon Elbre
none Details | Review

Description Egon Elbre 2011-09-19 20:43:03 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 )
Comment 1 Egon Elbre 2011-10-03 09:19:48 UTC
Created attachment 198064 [details] [review]
probable fix for gtk <= 2.90.0
Comment 2 Egon Elbre 2011-10-03 09:36:55 UTC
this fix is for gtk <= 2.90.0
Comment 3 Egon Elbre 2011-10-03 11:11:18 UTC
Looks like this has been fixed with refactoring 2.90.1 and newer in commit eb21a7df29093622.
Comment 4 Martin Renold 2011-10-23 08:55:37 UTC
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.
Comment 5 Andrew Chadwick 2016-11-14 12:07:26 UTC
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
Comment 6 Andrew Chadwick 2016-11-14 12:08:22 UTC
(^ as part of bug 774265)
Comment 7 Matthias Clasen 2018-02-10 05:11:59 UTC
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.
Comment 8 Matthias Clasen 2018-04-14 23:56:55 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