vcl/unx/gtk3/gtkinst.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 8087113baf9dfa346f4f8280463ca8bc16106f2e
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Sep 16 12:02:58 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Sep 16 14:45:07 2021 +0200

    gtk4: adjust to GtkMenuButton changes in 4.6 onwards
    
    Change-Id: I892aae979f8fb9b5a7c13a790905d7e7e3f2c087
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122190
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index c3bdb8a197f5..b2f544e4dea8 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -10223,7 +10223,15 @@ public:
         }
         g_list_free(pChildren);
 #else
-        GtkWidget* pChild = 
gtk_widget_get_last_child(GTK_WIDGET(m_pMenuButton));
+        GtkWidget* pChild;
+        if (gtk_check_version(4, 5, 0) == nullptr)
+        {
+            pChild = gtk_widget_get_first_child(GTK_WIDGET(m_pMenuButton));
+            pChild = gtk_widget_get_first_child(pChild);
+            pChild = gtk_widget_get_first_child(pChild);
+        }
+        else
+            pChild = gtk_widget_get_last_child(GTK_WIDGET(m_pMenuButton));
         g_object_ref(pChild);
         gtk_widget_unparent(pChild);
         gtk_button_set_child(GTK_BUTTON(m_pToggleButton), pChild);

Reply via email to