[evolution-data-server/wip/mcrha/gtk4] Fix ERemindersWidget



commit c6ccf7dcd391342e208ebcf1fe676bde27217aa9
Author: Milan Crha <mcrha redhat com>
Date:   Tue Oct 19 17:26:53 2021 +0200

    Fix ERemindersWidget

 src/libedataserverui/e-reminders-widget.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/libedataserverui/e-reminders-widget.c b/src/libedataserverui/e-reminders-widget.c
index fd863045a..dc5c15f7a 100644
--- a/src/libedataserverui/e-reminders-widget.c
+++ b/src/libedataserverui/e-reminders-widget.c
@@ -1385,7 +1385,6 @@ reminders_widget_snooze_add_custom (ERemindersWidget *reminders)
 
 #if GTK_CHECK_VERSION(4, 0, 0)
                reminders->priv->add_snooze_popover = gtk_popover_new ();
-               gtk_widget_set_parent (reminders->priv->add_snooze_popover, GTK_WIDGET (reminders));
                g_object_set (G_OBJECT (vbox),
                        "margin-start", 6,
                        "margin-end", 6,
@@ -1433,7 +1432,8 @@ reminders_widget_snooze_add_custom (ERemindersWidget *reminders)
 
        gtk_widget_hide (reminders->priv->add_snooze_popover);
 #if GTK_CHECK_VERSION(4, 0, 0)
-       gtk_widget_set_parent (GTK_WIDGET (reminders->priv->add_snooze_popover), 
reminders->priv->snooze_combo);
+       if (gtk_widget_get_parent (GTK_WIDGET (reminders->priv->add_snooze_popover)) == NULL)
+               gtk_widget_set_parent (GTK_WIDGET (reminders->priv->add_snooze_popover), 
reminders->priv->snooze_combo);
 #else
        gtk_popover_set_relative_to (GTK_POPOVER (reminders->priv->add_snooze_popover), 
reminders->priv->snooze_combo);
 #endif
@@ -1824,6 +1824,11 @@ reminders_widget_dispose (GObject *object)
        if (reminders->priv->settings)
                g_signal_handlers_disconnect_by_data (reminders->priv->settings, reminders);
 
+#if GTK_CHECK_VERSION(4, 0, 0)
+       if (reminders->priv->add_snooze_popover)
+               gtk_widget_unparent (reminders->priv->add_snooze_popover);
+#endif
+
        /* Chain up to parent's method. */
        G_OBJECT_CLASS (e_reminders_widget_parent_class)->dispose (object);
 }


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