GNOME Bugzilla – Bug 725727
Fix DnD on popovers
Last modified: 2014-03-07 04:51:08 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.
Created attachment 270991 [details] [review] window: Add private _gtk_window_list_popovers() This function will be useful in situations in GTK+ internals.
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().
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.
not a great fan, but since it doesn't add api, ok. We'll have to sort out popovers vs container hierarchy eventually
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.
Attachment 271149 [details] pushed as 59a928f - window: Turn popovers into internal children