[gtk/popover-state-sync: 2/2] popover: Sync parent state when needed



commit a06378cf6539df5508cc50dc267eef259d6f9f10
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jun 10 14:16:38 2019 -0400

    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);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]