GNOME Bugzilla – Bug 123546
Tablet doesn't work in Window mode
Last modified: 2011-02-04 16:12:10 UTC
I'm using a new Wacom USB Graphire2 tablet with GIMP 1.3.20 and it only works in Screen mode. In Window mode the X axis is stuck at -INT_MAX (according to the warning messages that stream on the console), which coincidentally causes GIMP 1.2.x to crash... :) Here is a sample warning message: (gimp-1.3:11828): GLib-GObject-WARNING **: value "-2147483648.000000" of type `gdouble' is invalid or out of range for property `fixed-width' of type `gdouble' The tablet otherwise works great, and xidump shows that we're getting valid X axis values from the tablet. I'm not using the tablet as a core pointer and it is configured to *not* send core events.
This is very likely a GTK+ bug but we will need detailed version information about the GTK+ library and X11 server in order to reassign this report.
Michael, did you try to run the "testinput" program provided in the GTK+ source tree (in the "test" directory). Did you see anything unusual with this program or other test programs?
Sven: I updated to the current RedHat "rawhide" RPMs for GTK+ 2.2.4 and GLIB 2.2.3; this is with XF86 4.3 and the updated Wacom kernel driver. Raphael: I'll build from source tonight to use the testinput program and see what it produces. It *would* be nice to eliminate this problem once and for all... :)
Raphael, I've run the testinput program and get the following output when Window mode is selected: TabletStylus nan 108.812 0 -0.00787402 -0.00787402 5.23656 I'm assuming the "nan" (not a number) is the X axis value...
*** Bug 124644 has been marked as a duplicate of this bug. ***
It is a wacom driver problem with a quick GDK fix for unreasonable values. I have been able to track the problem to (in gtk-2.2.4) gdk/x11/gdkinput-x11.c:466 in gdk_input_translate_coordinates: It tries to use calculate the device_aspect ratio by: double device_aspect = (device_height*gdkdev->axes[y_axis].resolution) / (device_width*gdkdev->axes[x_axis].resolution); Where device_height and device_width is the the difference between AXIS_MIN and AXIS_MAX for the x and y axis. The problem is that resolution here is 0. The resolution represents the spacial resolution of the digitizer in the tablet. The algorithm used in gdk only depends on the ratio of the two resolutions, not their absolute values, so a good quick fix would be to assume the resolution is one when the resolution is reported as zero, (which should never be, btw). The real problem here is that the wacom driver is not correctly reporting the resolution of my tablet. I am willing to debug this (I have been looking at the source of the xfree86 wacom driver) but I can't build a new driver without an XFree86 build enviroment, which I don't feel like constructing right now. My opinion, though, is that the resolution should never be zero, and it should correctly detect my tablet's resolution. I can however, fix gdk so that the algorithm doesn't break when the resolution is wrong. I'll attach a patch shortly. This bug report should probably be reassigned.
Created attachment 21877 [details] [review] fix to make sreen mode work for extended input devices when the resolution is incorrectly reported as 0
Also, for the record, the problem occurs with my 6x8 Intuos 2 tablet as well. I will also take the liberty of reporting this bug to the wacom driver people. The above patch, btw, is against gtk+-2.2.4
Yup, that patch seems to fix the problem on my system, thanks!
The bug should be reassigned to GTK+ then. You should also consider to redo the patch to match the GTK+ coding style (it's missing a few spaces). Otherwise it won't be accepted.
I have no power. I can't reassign this bug.
Created attachment 21905 [details] [review] fixes the missing spaces to conform with the coding style
This report was originally reported against GIMP-1.3.20. It has a patch for GTK+ version 2.2.4 attached.
There is a 0.5.3-beta package of the linuxwacom drivers that fixes this problem. This package is not linked to on the front page. One must look at the "All Packages" link, to get the sourceforge view, to find the latest drivers.
One trivial problem with the patch is that we don't allow C99 style variable declarations.
What about my variable declarations are C99 specific?
The double device_aspect declaration is after the if statement.
Could be applied gtk-2-2 and HEAD, though the patch absolutely requires a comment to describe what it is doing, and the C99-ism needs to be fixed.
Created attachment 22268 [details] [review] clean diff against gtk-2.2.4 and HEAD. Fixes C99ism and adds a comment.
What is the deal here? Is this a happy patch? Am I expected to apply it to CVS myself?
*** Bug 83779 has been marked as a duplicate of this bug. ***
Since Owen has already in general OKed it, and your latest version includes his comments, I'd say go ahead and commit it. Please add a ChangeLog entry and include a reference to this bug in it. Thanks.
patch applied to gtk-2-2 and HEAD. Marking as closed