GNOME Bugzilla – Bug 749737
DnD breaks button-released events. (Setting a widget as DnD source causes button_released events to have 0 x/y coordinates)
Last modified: 2015-11-11 10:07:11 UTC
If I take a widget and register it as a DnD source and connect it to a button_released event, Then if I start a drag operation on the button and release it, then when the button_released event is triggered, the x/y coordinates are 0. Steps to reproduce: - run test app: make && ./main - click & release the only button. You will see that x/y coords are correct. - now click & hold, move mouse a little bit to trigger a drag. now release the button. You will observe that the mouse-up event was triggered but the x/y coordinates are shown as 0. However, mouse_release event within the same gtk application should have x/y coordinates relative to the root window. Tested on Gtk3.16.3 on Fedora 22. But also believed to occur on Gtk2. ------------------------------ Side note: SWT/Eclipse is affected by this, related bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458820
Created attachment 303830 [details] small snippet to reproduce the issue.
As a note, if the widget is not registered as drag-source, then the issue does not occur.
I was wondering why do we receive a button release event at all, as soon as DnD is triggered, a grab is taken on an invisible window, the drag source widget should just receive GdkEventGrabBroken, and no further mouse events as long as the grab holds. I found out we are faking a button release event when the DnD operation finishes, this seems like really old code, and actually is inconsistent with how things are done currently. I'm attaching a patch to remove this event emission, might not be the fix that you expected though...
Created attachment 304066 [details] [review] dnd: Remove emission of fake button release event Nowadays (and for quite some years now) we rely on GdkEventGrabBroken events to be received. This fake button event seems a remnant of the early Gtk 2.x days, and is currently even inconsistent with our event delivery model, so just remove it.
Attachment 304066 [details] pushed as a0e8056 - dnd: Remove emission of fake button release event
(In reply to Carlos Garnacho from comment #5) > Attachment 304066 [details] pushed as a0e8056 - dnd: Remove emission of fake > button release event thanks for looking into this.
This change breaks evolution's (libgnomecanvas') handling of grabbed events, respectively of the drag end recognition, as noted in bug #755730 comment #8.