GNOME Bugzilla – Bug 736193
changing a GtkPopover's relative widget seems to forcibly destroy its bin child
Last modified: 2014-09-23 01:03:14 UTC
Created attachment 285573 [details] Example program. See the attached Vala program. As it stands right now, clicking the Manager button yields a (login:18686): Gtk-CRITICAL **: gtk_widget_child_focus: assertion 'GTK_IS_WIDGET (widget)' failed on the command line and the popover that does show up is empty. Commenting out line 54 "fixes" the issue, but doesn't change the widget that the popover is relative to. Switching to a set_relative_to() method call also doesn't work. Calling ref_sink() on the GtkGrid also doesn't work for whatever reason... Seems to have always been present (can reproduce in GTK+ 3.12/Ubuntu Utopic daily and on master). Thanks.
One other workaround attempt failed: re-adding the GtkGrid as the bin child in the signal handler didn't work.
The problem here is: gtk_popover_update_relative_to widget_unmanage_popoper _unmanage_popover g_object_run_dispose
Created attachment 286195 [details] [review] popover: Don't run full dispose() when unmanaging the widget A popover can go unmanaged for 2 reasons, when the widget it points to gets destroyed, or transitionally in gtk_popover_set_relative_to(). In both of these cases it makes sense to only unset popover information about the previous widget managing it, if the popover is meant to survive the unmanaging through extra refs. Also, the focus widget prior to a modal popover being shown is considered information about the relative_to widget, unset it on gtk_popover_update_relative_to() with the rest.
Review of attachment 286195 [details] [review]: looks good
Attachment 286195 [details] pushed as 0285a25 - popover: Don't run full dispose() when unmanaging the widget