Tablets with GIMP

Neil Whelchel neil.whelchel at
Sun Nov 21 18:20:40 PST 2010

On Sunday, November 21, 2010 05:44:32 pm Peter Hutterer wrote:
> On Sat, Nov 20, 2010 at 10:53:52PM -0800, Neil Whelchel wrote:
> > I have been trying to get a VisTablet working with the GIMP with limited
> > success. I am not interested in the tablet acting as a core pointer so
> > I added a section to the xorg configuration:
> > 
> > Section "InputClass"
> > 
> >         Identifier "evdev tablet"
> >         MatchVendor "WALTOP"
> >         MatchDevicePath "/dev/input/event*"
> >         Option "SendCoreEvents" "false"
> >         Driver "evdev"
> > 
> > EndSection
> > 
> > And in the GIMP extended input device configuration  I selected the
> > tablet device and set its mode to window.
> > At first glance all worked as expected, then I ran into a problem...
> > If I center a small drawing window in the middle of my screen, and start
> > drawing in the middle, all is fine, and I can draw to the edges, however,
> > if I start from a corner, the GIMP doesn't see the events from the
> > tablet. My guess is that xorg assumes that the coordinates from the
> > tablet corners are outside of the GIMP window and does not send events.
> > This looks like a bug, because if I start in the middle, and go to the
> > edge, all is fine until I release the pen.
> gimp grabs the device when a button press is registered on the canvas, but
> does not do so for events outside the canvas (well, because it wouldn't get
> them since they don't arrive on the canvas)

Maybe I was not clear. The GIMP scales the entire tablet area to the size of 
the canvas when it is in Window mode.  Even though the actual tool is on the 
canvas because of scaling, clicks are not passed to the GIMP if you are 
outside of the area that the pointer would be on the canvas if GIMP was not 
scaling it.

I can see this by the way that it acts. There is a problem there, however. 
Since SendCoreEvents is false, the core pointer moves in response to the 
mouse, not the tablet. In this case, you would think that having the window 
active would be enough to allow it to receive tablet events (since GIMP is 
configured to look for the tablet events in its exended input configuration), 
but that is not how it works.

The point is that when GIMP is set in Window mode, the entire tablet surface 
is scaled to the size of the drawing window. As I move the pen to the edge of 
the tablet, the tool is positioned at the edge of the window. Where things go 
bad is that even though the tool is in the window, when I click the pen, GIMP 
does not see the event. It is like xorg is not seeing the fact that GIMP is 
scaling the input and that the tool *IS* in the window. If you don't account 
for scaling and click in a place where the tool WOULD be in the window if 
scaling were not applied, it works as expected, and continues to work when you 
drag the pen outside of the unscaled area. There is no documentation to 
explain this or work around this issue.

> > Another problem is that I am unable to find any real documentation on
> > InputClass. All I can find is bits here and there. Am I looking in the
> > wrong places or do I need to take on a documentation project?
> xorg.conf(5) isn't enough?
Not really. While it covers the basics, it really doesn't get into things like 
whre MatchIsTablet and such decide if it is true or false. After some digging, 
I figured out how udev sets the environment, and the relation is clear, but 
that is not in the documentation that I can find. Also there is little mention 
of how devices that are not set as Core are dealt with.

> Cheers,
>   Peter

More information about the xorg mailing list