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 129242 - Too many enter/leave events when pointer grabbed (was: Crop tool wraps...)
Too many enter/leave events when pointer grabbed (was: Crop tool wraps...)
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.2.x
Other Windows
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
: 132055 134598 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-12-13 03:44 UTC by leigh
Modified: 2011-02-04 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that prevents unwanted enter/leave/focus-change events while pointer is grabbed (1.08 KB, patch)
2004-01-27 03:25 UTC, Tor Lillqvist
none Details | Review

Description leigh 2003-12-13 03:44:22 UTC
Description of Problem:
once the crop tool is selected and the image is
clicked the crop dialogue window appears. If this
window is over any part of the area to be cropped
(and it usually is) what happens is the selected
area will jump to the side or top bottom of the
crop window. eg:


Steps to reproduce the problem:
1. select crop tool
2. Click on image, crop window appears
3. move crop window to centre of image
4. Start the crop selection area below and to the
right of the window, drag area to above & left of
window.


Actual Results:

instead of entire area dragged being selected the
selection area will jump to the top or left of 
the crop window. It will be much smaller. It
generally snaps to the side of the crop window.

Expected Results:
area dragged should be selected for cropping

How often does this happen? 
90% of the time

Additional Information:
windoze 2k
Comment 1 Sven Neumann 2003-12-13 17:25:42 UTC
Please specify the GIMP version you are using. Otherwise your report
is useless.
Comment 2 Michael Schumacher 2003-12-13 20:48:08 UTC
I get this with Current CVS on WinXP. 
Comment 3 leigh 2003-12-14 01:02:15 UTC
I omitted gimp version... sorry
Gimp 1.3.23
Leigh
Comment 4 leigh 2003-12-14 03:43:48 UTC
I also noticed that the cursor sometimes sticks to the
(busy)"wrist-watch" symbol when over the crop window though it is
still active, ie buttons can still be clicked with it. 
I thought this might be related.
Leigh HTH
Comment 5 leigh 2003-12-14 03:46:53 UTC
I know i should put all this in one message... but as i use it i notice
the top border of the crop selection area does not show, the 2 top
corner boxes are there but there is no joining line as on the sides
and bottom. should this be a seperate post?
Comment 6 Sven Neumann 2003-12-14 11:44:08 UTC
The missing line should have gone into a separate bug report, but it
has been fixed in CVS already.
Comment 7 Michael Natterer 2004-01-21 11:48:05 UTC
Do you mean that as soon as you try to move the crop handle,
the *mouse pointer* jumps to the top left corner of the
drop dialog window?

In this case this would be a duplicate of the just
fixed bug #132041 and you have configured windows
to move the mouse pointer to the top left corner
of each window that gains focus.
Comment 8 Tor Lillqvist 2004-01-25 23:12:45 UTC
Can confirm that this still happens with current CVS GIMP. My initial 
guess is that the root cause is some glitch in GDK event generation. 
Will investigate.
Comment 9 Tor Lillqvist 2004-01-26 00:44:11 UTC
BTW, is it sure that this doesn't happen on X11? Position the crop 
dialog as described on top of the image, and drag the pointer while 
cropping onto the crop dialog and back into the image a few times, 
quickly and slowly. On Windows, what I think happens is that when the 
enter event when the pointer comes back onto the image window 
triggers the call to tool_manager_oper_update_active() in 
gimp_display_shell_canvas_tool_events(), and the pointer coordinates 
happen to be outside the current crop area, gimp_crop_tool_oper_update
() reinitializes the crop setting function to CREATING. Perhaps enter 
and leave events should be ignored in 
gimp_display_shell_canvas_tool_events() if the pointer is grabbed, or 
something? Will investigate more tomorrow, time for sleep now.
Comment 10 Tor Lillqvist 2004-01-26 13:20:32 UTC
Adding a bit of debug printouts to a GIMP running on X11 and 
comparing to what happens on Win32, it seems that the Win32 GDK is 
too eagerly generating leave and enter events, which then confuse 
GIMP. Will have to fix that. Reassigning to GTK+.
Comment 11 Tor Lillqvist 2004-01-27 03:23:59 UTC
Yeah, gdk/win32 should not generate any enter or leave notify events 
while the pointer is grabbed with owner_events FALSE, and such events 
aren't asked for in the grab event mask.

Attaching a patch that fixes this.

While at it, this patch also prevents gdk/win32 from generating focus 
change events in the same situation. Also this helps GIMP's crop 
tool, otherwise when the crop dialog that pops up and gets focus 
(which probably is another issue, it presumably should not?) GIMP 
gets the focus events and gets a bit confused, if you have dragged 
the cursor slowly, the cropping tool gets into the resize_left state, 
even though it should be in the creating state.
Comment 12 Tor Lillqvist 2004-01-27 03:25:14 UTC
Created attachment 23792 [details] [review]
Patch that prevents unwanted enter/leave/focus-change events while pointer is grabbed
Comment 13 Tor Lillqvist 2004-01-28 02:15:07 UTC
Patch applied to gtk-2-2 and HEAD:

2004-01-28  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkevents-win32.c (synthesize_leave_event,
synthesize_enter_event): Don' generate enter or leave events if
the pointer is grabbed with owner_events off, and the grab event
mask doesn't ask for them. (#129242)

(gdk_event_translate): Ditto for focus change events.

Comment 14 Tor Lillqvist 2004-02-01 20:10:47 UTC
*** Bug 132055 has been marked as a duplicate of this bug. ***
Comment 15 Dave Neary 2004-02-17 09:39:23 UTC
*** Bug 134598 has been marked as a duplicate of this bug. ***