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 736193 - changing a GtkPopover's relative widget seems to forcibly destroy its bin child
changing a GtkPopover's relative widget seems to forcibly destroy its bin child
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkPopover
3.13.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-09-06 15:22 UTC by Pietro Gagliardi (andlabs)
Modified: 2014-09-23 01:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example program. (1.77 KB, text/x-vala)
2014-09-06 15:22 UTC, Pietro Gagliardi (andlabs)
  Details
popover: Don't run full dispose() when unmanaging the widget (1.49 KB, patch)
2014-09-15 12:44 UTC, Carlos Garnacho
committed Details | Review

Description Pietro Gagliardi (andlabs) 2014-09-06 15:22:17 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.
Comment 1 Pietro Gagliardi (andlabs) 2014-09-06 15:43:17 UTC
One other workaround attempt failed: re-adding the GtkGrid as the bin child in the signal handler didn't work.
Comment 2 Matthias Clasen 2014-09-06 16:54:05 UTC
The problem here is:

gtk_popover_update_relative_to
  widget_unmanage_popoper
    _unmanage_popover
      g_object_run_dispose
Comment 3 Carlos Garnacho 2014-09-15 12:44:47 UTC
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.
Comment 4 Matthias Clasen 2014-09-18 11:02:37 UTC
Review of attachment 286195 [details] [review]:

looks good
Comment 5 Matthias Clasen 2014-09-18 11:02:47 UTC
Review of attachment 286195 [details] [review]:

looks good
Comment 6 Matthias Clasen 2014-09-23 01:00:41 UTC
Attachment 286195 [details] pushed as 0285a25 - popover: Don't run full dispose() when unmanaging the widget