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 167000 - Wacom Tablet: source clone area is lost when pen goes out of tablet range
Wacom Tablet: source clone area is lost when pen goes out of tablet range
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.6.x
Other Windows
: Normal minor
: Small fix
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-02-10 22:26 UTC by gary
Modified: 2005-07-28 21:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for discussion, delays proximity out handling (1.85 KB, patch)
2005-07-13 13:44 UTC, Robert Ögren
none Details | Review
Updated patch (3.24 KB, patch)
2005-07-28 10:24 UTC, Robert Ögren
none Details | Review

Description gary 2005-02-10 22:26:14 UTC
Version details: also occurs in 2.2.1
Distribution/Version: XP Pro SP2

Using Wacom Graphire 3 tablet and pen, open an image. Select the Clone tool.
Ctrl+click to select clone source area. When pen moves out of range of the
tablet, selected source is lost and you must re Ctrl-click to select clone
source again.
Comment 1 Raphaël Quinet 2005-02-10 23:27:27 UTC
I suppose that the loss of source area could happen if the tool context is lost.
Do you see the active tool switching to something else when you move the pen out
of the tablet?  Do you see any changes in the toolbox or tool options?
Comment 2 gary 2005-02-11 02:38:59 UTC
Yes, the active tool seems to switch to the paintbrush when the pen is moved out
of range of the tablet. I tested this with the bucket fill tool, the crop tool,
and the clone tool. 

In 2.2.3, when the pen moves back into range of the tablet, the active tool
switches back to whatever you were using in the first place. But in the case of
the clone tool, the selection is lost.

I *think* in 2.2.1 (I only used it with my tablet briefly until I realized there
was an update available), when the pen would move out of range of the tablet,
the tool would switch to the paintbursh, but would *not* automatically switch
back when the pen was moved back into range. I could be wrong about this tho.

In the tools pallet, when the pen is moved away from the tablet, whichever tool
is selected (ie: it looks like a depressed button) changes from the tool you're
using to the brush. It then changes back (in 2.2.3) when the pen gets back into
range.
Comment 3 Raphaël Quinet 2005-02-11 09:01:24 UTC
I haven't had the opportunity to test this with my tablet yet, but I suppose
that what happens is this: when you move the pen out of range, the tool switches
from the one assigned to the extended input device (tablet pen) to the one
assigned to the default input device (mouse).  You should be able to see that
clearly if you open the dialog showing the status of the various input devices:
you will see that the current device changes and this results in a change of
tool (and brush, pattern, ...).

The annoying thing is that this temporary switch of tool context seems to cause
the source area for the clone tool to be lost.  It would be nice if that could
be avoided by keeping this useful info in the tool context for a while (for
example, at least until the other tool is really used to perform some operation)
Comment 4 gary 2005-02-11 22:33:41 UTC
Yes, that appears to be what is happening. When the pen is in range of the
tablet, either the "WACOM Tablet Pressure Stylus" or "WACOM Tablet Eraser
Stylus" is active (depending on which end of the pen is in range). When the pen
moves out of range, the active device changes to "Core Pointer". When you move
the pen back into range, it becomes the active device again.
Comment 5 Michael Schumacher 2005-04-01 08:39:16 UTC
*** Bug 171725 has been marked as a duplicate of this bug. ***
Comment 6 Robert Ögren 2005-07-13 13:37:07 UTC
I have looked into this and the reason a tool switch occurs when the pen is
lifted is this:

GTK+ on Windows initializes the tablet to use a so called system context, which
means that the tablet driver will move the system cursor. This makes the tablet
send both regular mouse movement events and tablet movement events to GTK+.
Since this is not desirable, the regular mouse events are ignored by GTK+ as
long as the pen is on the tablet (in proximity).

The problem is that when lifting the pen, sometimes a mouse move event can get
received just _after_ the proximity out event is received, which makes GTK+
treat it as a normal mouse movement and send a core pointer event.

This looks fixable by slightly delaying the handling of the proximity out
events, and I have an experimental patch for GTK+ that does just that.

I'll reassign this to GTK+ and provide a patch for discussion shortly. I hope
this is acceptable to the GIMP maintainers.

I will also reopen bug #171725 ("clone source is lost on tool change"), since
that still seems to be a valid bug report or enhancement request for GIMP.
Comment 7 Robert Ögren 2005-07-13 13:44:30 UTC
Created attachment 49090 [details] [review]
Patch for discussion, delays proximity out handling

Here's a possible way to fix it. The main thing I think need review on this
patch is the fact that I've used g_timeout_add/g_source_remove in the GDK win32
backend, and I don't know if this is acceptable (it requires a mainloop,
doesn't it?). If that is not acceptable, I can rewrite the patch to use the
Win32 SetTimer/KillTimer API functions instead. Please comment.
Comment 8 Robert Ögren 2005-07-25 15:37:27 UTC
Could any GTK+ maintainer please tell me if it is acceptable or not to use
g_timeout_add in the GDK win32 backend?
Comment 9 Robert Ögren 2005-07-27 22:18:23 UTC
Personally I think it would be OK since gdk/gdkwindow uses g_idle_add_full and
g_source_remove.

Tor, what do you think? Does the attached patch look OK?
Comment 10 Tor Lillqvist 2005-07-28 00:10:42 UTC
Looks fine to me. Perhaps 500 ms is a bit too long, though? 
Comment 11 Robert Ögren 2005-07-28 10:23:06 UTC
Yeah I guess so, that number was pretty arbitrarily chosen. I'll attach a new
patch that makes it a #define, and cuts it down to 200 ms. I don't think many
people will be able to drop the pen and pick up the mouse in less than 200 ms :)
Comment 12 Robert Ögren 2005-07-28 10:24:57 UTC
Created attachment 49872 [details] [review]
Updated patch

Now with ChangeLog entry and lowered delay.

Tested with my Wacom Graphire 3, driver version 4.90-3.
Comment 13 Tor Lillqvist 2005-07-28 21:55:28 UTC
Thanks! Patch applied to gtk-2-6 and HEAD.