summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-05-26 17:35:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-05-26 21:49:56 +0200
commit7768abbf86731a1105fcebe7c2557cb9ac5ba86a (patch)
tree1c6b7fb0ef94f0fdc3ff356ca9177f371db51e01 /vcl
parente38db47fdb50db812d5f0088a5fd394bdd98da38 (diff)
gtk4: add parent-less widgets to default container
Change-Id: Ia0c06db5a4f1c4ce453c424835d032ebb021f40a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116217 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtkinst.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 60f7a68de0d1..c03da186f0af 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -19297,12 +19297,14 @@ public:
//gtk impl emulate this by doing this implicitly at weld time
void auto_add_parentless_widgets_to_container(GtkWidget* pWidget)
{
-#if !GTK_CHECK_VERSION(4, 0, 0)
if (widget_get_root(pWidget) == pWidget && !GTK_IS_POPOVER(pWidget) && !GTK_IS_WINDOW(pWidget))
- gtk_container_add(GTK_CONTAINER(m_pParentWidget), pWidget);
+ {
+#if GTK_CHECK_VERSION(4, 0, 0)
+ gtk_widget_set_parent(pWidget, m_pParentWidget);
#else
- (void)pWidget;
+ gtk_container_add(GTK_CONTAINER(m_pParentWidget), pWidget);
#endif
+ }
}
virtual std::unique_ptr<weld::MessageDialog> weld_message_dialog(const OString &id) override