From d6a81377b11e15493ea3598cf0457c07b40b7b09 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 10 Jun 2019 14:16:38 -0400 Subject: [PATCH] popover: Sync parent state when needed When the relative-to widget changes, we need to re-sync our parent state. Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1943 --- gtk/gtkpopover.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 26f967394f..59d1bc8587 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -2069,6 +2069,7 @@ gtk_popover_update_relative_to (GtkPopover *popover, GtkWidget *relative_to) { GtkPopoverPrivate *priv = popover->priv; + GtkStateFlags old_state = 0; if (priv->widget == relative_to) return; @@ -2085,6 +2086,7 @@ gtk_popover_update_relative_to (GtkPopover *popover, if (priv->widget) { + old_state = gtk_widget_get_state_flags (priv->widget); if (g_signal_handler_is_connected (priv->widget, priv->hierarchy_changed_id)) g_signal_handler_disconnect (priv->widget, priv->hierarchy_changed_id); if (g_signal_handler_is_connected (priv->widget, priv->size_allocate_id)) @@ -2141,6 +2143,9 @@ gtk_popover_update_relative_to (GtkPopover *popover, if (priv->widget) gtk_popover_update_scrollable (popover); + if (priv->widget) + _gtk_popover_parent_state_changed (priv->widget, old_state, popover); + _gtk_widget_update_parent_muxer (GTK_WIDGET (popover)); g_object_unref (popover); }