[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Aug 18 08:35:46 UTC 2021
vcl/unx/gtk3/gtkinst.cxx | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit 033dbb01f0688610338c80136ed73f2b412397ec
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Aug 17 14:59:32 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Aug 18 10:35:10 2021 +0200
gtk3: fix warning about GtkBin already containing a widget
Change-Id: I9df18e9cc865a8600f26605530eb99b9ba8f0d36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120607
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index afe7bef66f16..824f6214917c 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -2293,6 +2293,12 @@ namespace
}
#endif
+#if !GTK_CHECK_VERSION(4, 0, 0)
+ // for gtk3 remove before replacement inserted, or there are warnings
+ // from GTK_BIN about having two children
+ container_remove(pParent, pWidget);
+#endif
+
gtk_widget_set_visible(pReplacement, gtk_widget_get_visible(pWidget));
#if !GTK_CHECK_VERSION(4, 0, 0)
gtk_widget_set_no_show_all(pReplacement, gtk_widget_get_no_show_all(pWidget));
@@ -2354,7 +2360,10 @@ namespace
gtk_widget_set_halign(pReplacement, gtk_widget_get_halign(pWidget));
gtk_widget_set_valign(pReplacement, gtk_widget_get_valign(pWidget));
+#if GTK_CHECK_VERSION(4, 0, 0)
+ // for gtk4 remove after replacement inserted so we could use gtk_box_insert_child_after
container_remove(pParent, pWidget);
+#endif
// coverity[freed_arg : FALSE] - this does not free pWidget, it is reffed by pReplacement
g_object_unref(pWidget);
More information about the Libreoffice-commits
mailing list