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 725727 - Fix DnD on popovers
Fix DnD on popovers
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-03-05 14:21 UTC by Carlos Garnacho
Modified: 2014-03-07 04:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: Add private _gtk_window_list_popovers() (1.78 KB, patch)
2014-03-05 14:22 UTC, Carlos Garnacho
none Details | Review
window: Add private _gtk_window_get_popoper_rect() (2.30 KB, patch)
2014-03-05 14:22 UTC, Carlos Garnacho
none Details | Review
dnd: Special case popovers on drag start/motion (3.10 KB, patch)
2014-03-05 14:22 UTC, Carlos Garnacho
none Details | Review
window: Turn popovers into internal children (2.01 KB, patch)
2014-03-06 22:29 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-03-05 14:21:17 UTC
The code in gtkdnd.c checks for the widget below the pointer running recursively through containers from the toplevel under the pointer. As popovers remain out of the GtkContainer knowledge, DnD skips popovers, checking the widgets beneath instead.

I'm adding a few small patches that fix this by special casing popovers there.
Comment 1 Carlos Garnacho 2014-03-05 14:22:35 UTC
Created attachment 270991 [details] [review]
window: Add private _gtk_window_list_popovers()

This function will be useful in situations in GTK+ internals.
Comment 2 Carlos Garnacho 2014-03-05 14:22:39 UTC
Created attachment 270992 [details] [review]
window: Add private _gtk_window_get_popoper_rect()

This function gets the rectangle occupied by the popover, as
opposed to the rectangle it's related to that can be gotten
through _gtk_window_get_popover_position().
Comment 3 Carlos Garnacho 2014-03-05 14:22:44 UTC
Created attachment 270993 [details] [review]
dnd: Special case popovers on drag start/motion

This code runs through the container hierarchy, which unfortunately
doesn't cut it on shown popovers, so first check if there's any
visible popover under the pointer before running through the container
hierarchy.
Comment 4 Matthias Clasen 2014-03-05 17:54:41 UTC
not a great fan, but since it doesn't add api, ok. We'll have to sort out popovers vs container hierarchy eventually
Comment 5 Carlos Garnacho 2014-03-06 22:29:39 UTC
Created attachment 271149 [details] [review]
window: Turn popovers into internal children

It turns out popovers are already smart enough to cope with this
situation, so let popovers be internal children so things that rely
on gtk_container_forall(), like DnD, work without modifications.

--
I've been testing this one extensively and all popover users I
could test do work fine. At least, the most special cased bits like
size allocation is kept out of the gtk_container_forall() loop,
so it all will be ok in that regard.
Comment 6 Matthias Clasen 2014-03-07 04:51:04 UTC
Attachment 271149 [details] pushed as 59a928f - window: Turn popovers into internal children