Commit 76a5e3fc authored by Carlos Garnacho's avatar Carlos Garnacho

popover: set priv->window before setting doing add_popover() on it

If the popover's relative-to widget is unparented/reparented, we end
up unparenting/reparenting the popover as well. In that case, at the
moment of reparenting, the widget might have been visible (and is
thus mapped again), but priv->window hasn't been set yet.

We must first set priv->window, and then call gtk_window_add_popover(),
that way gtk_popover_map() has its prerequisites straight.

https://bugzilla.gnome.org/show_bug.cgi?id=766323
parent ebf703ff
......@@ -1755,13 +1755,13 @@ _gtk_popover_parent_hierarchy_changed (GtkWidget *widget,
if (priv->window)
_gtk_window_remove_popover (priv->window, GTK_WIDGET (popover));
if (new_window)
_gtk_window_add_popover (new_window, GTK_WIDGET (popover), priv->widget, TRUE);
priv->window = new_window;
if (new_window)
gtk_popover_update_position (popover);
{
_gtk_window_add_popover (new_window, GTK_WIDGET (popover), priv->widget, TRUE);
gtk_popover_update_position (popover);
}
if (gtk_widget_is_visible (GTK_WIDGET (popover)))
gtk_widget_queue_resize (GTK_WIDGET (popover));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment