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 123546 - Tablet doesn't work in Window mode
Tablet doesn't work in Window mode
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
2.2.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
: 83779 124644 (view as bug list)
Depends on:
Blocks: 127786
 
 
Reported: 2003-09-30 11:14 UTC by Michael Sweet
Modified: 2011-02-04 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix to make sreen mode work for extended input devices when the resolution is incorrectly reported as 0 (1.57 KB, patch)
2003-11-28 04:30 UTC, Daniel Rogers
none Details | Review
fixes the missing spaces to conform with the coding style (2.05 KB, patch)
2003-11-28 16:55 UTC, Daniel Rogers
none Details | Review
clean diff against gtk-2.2.4 and HEAD. Fixes C99ism and adds a comment. (2.59 KB, patch)
2003-12-09 18:03 UTC, Daniel Rogers
none Details | Review

Description Michael Sweet 2003-09-30 11:14:54 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.
Comment 1 Sven Neumann 2003-09-30 11:35:59 UTC
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.
Comment 2 Raphaël Quinet 2003-09-30 12:28:13 UTC
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?
Comment 3 Michael Sweet 2003-09-30 12:43:30 UTC
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... :)
Comment 4 Michael Sweet 2003-10-03 01:03:37 UTC
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...
Comment 5 Sven Neumann 2003-10-15 11:11:10 UTC
*** Bug 124644 has been marked as a duplicate of this bug. ***
Comment 6 Daniel Rogers 2003-11-28 04:23:12 UTC
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.
Comment 7 Daniel Rogers 2003-11-28 04:30:49 UTC
Created attachment 21877 [details] [review]
fix to make sreen mode work for extended input devices when the resolution is incorrectly reported as 0
Comment 8 Daniel Rogers 2003-11-28 04:33:26 UTC
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
Comment 9 Michael Sweet 2003-11-28 13:58:32 UTC
Yup, that patch seems to fix the problem on my system, thanks!
Comment 10 Sven Neumann 2003-11-28 14:08:56 UTC
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.
Comment 11 Daniel Rogers 2003-11-28 16:50:12 UTC
I have no power.  I can't reassign this bug.
Comment 12 Daniel Rogers 2003-11-28 16:55:20 UTC
Created attachment 21905 [details] [review]
fixes the missing spaces to conform with the coding style
Comment 13 Sven Neumann 2003-11-28 17:14:35 UTC
This report was originally reported against GIMP-1.3.20. It has a
patch for GTK+ version 2.2.4 attached.
Comment 14 Daniel Rogers 2003-11-28 20:07:43 UTC
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.
Comment 15 Soren Sandmann Pedersen 2003-12-07 22:15:24 UTC
One trivial problem with the patch is that we don't allow C99 style
variable declarations.
Comment 16 Daniel Rogers 2003-12-08 03:23:28 UTC
What about my variable declarations are C99 specific?
Comment 17 Manish Singh 2003-12-08 03:36:36 UTC
The double device_aspect declaration is after the if statement.
Comment 18 Owen Taylor 2003-12-09 16:32:20 UTC
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.
Comment 19 Daniel Rogers 2003-12-09 18:03:56 UTC
Created attachment 22268 [details] [review]
clean diff against gtk-2.2.4 and HEAD.  Fixes C99ism and adds a comment.
Comment 20 Daniel Rogers 2003-12-30 23:41:49 UTC
What is the deal here?  Is this a happy patch?  Am I expected to apply
it to CVS myself?
Comment 21 Daniel Rogers 2003-12-30 23:46:06 UTC
*** Bug 83779 has been marked as a duplicate of this bug. ***
Comment 22 Matthias Clasen 2003-12-31 01:10:23 UTC
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. 
Comment 23 Daniel Rogers 2003-12-31 22:01:37 UTC
patch applied to gtk-2-2 and HEAD.  Marking as closed