GNOME Bugzilla – Bug 129242
Too many enter/leave events when pointer grabbed (was: Crop tool wraps...)
Last modified: 2011-02-04 16:12:10 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
Please specify the GIMP version you are using. Otherwise your report is useless.
I get this with Current CVS on WinXP.
I omitted gimp version... sorry Gimp 1.3.23 Leigh
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
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?
The missing line should have gone into a separate bug report, but it has been fixed in CVS already.
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.
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.
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.
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+.
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.
Created attachment 23792 [details] [review] Patch that prevents unwanted enter/leave/focus-change events while pointer is grabbed
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.
*** Bug 132055 has been marked as a duplicate of this bug. ***
*** Bug 134598 has been marked as a duplicate of this bug. ***