vcl/unx/gtk3/gtkinst.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 59fbb0d49dc9dcdc9bb76214949ac0ab4332b9c2
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Oct 15 14:16:31 2021 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Fri Oct 15 17:40:55 2021 +0200

    gtk4: get toolbar popovers in sidebar working
    
    Change-Id: I7ef95a3207c3a10cd541a529c80ef70d55ea2185
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123657
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index c648bfee534d..bd84f41b2d1e 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -2236,11 +2236,13 @@ namespace
 #if !GTK_CHECK_VERSION(4, 0, 0)
         gtk_container_remove(GTK_CONTAINER(pContainer), pChild);
 #else
-        assert(GTK_IS_BOX(pContainer) || GTK_IS_GRID(pContainer));
+        assert(GTK_IS_BOX(pContainer) || GTK_IS_GRID(pContainer) || 
GTK_IS_POPOVER(pContainer));
         if (GTK_IS_BOX(pContainer))
             gtk_box_remove(GTK_BOX(pContainer), pChild);
         else if (GTK_IS_GRID(pContainer))
             gtk_grid_remove(GTK_GRID(pContainer), pChild);
+        else if (GTK_IS_POPOVER(pContainer))
+            gtk_popover_set_child(GTK_POPOVER(pContainer), nullptr);
 #endif
     }
 
@@ -2249,11 +2251,13 @@ namespace
 #if !GTK_CHECK_VERSION(4, 0, 0)
         gtk_container_add(GTK_CONTAINER(pContainer), pChild);
 #else
-        assert(GTK_IS_BOX(pContainer) || GTK_IS_GRID(pContainer));
+        assert(GTK_IS_BOX(pContainer) || GTK_IS_GRID(pContainer) || 
GTK_IS_POPOVER(pContainer));
         if (GTK_IS_BOX(pContainer))
             gtk_box_append(GTK_BOX(pContainer), pChild);
         else if (GTK_IS_GRID(pContainer))
             gtk_grid_attach(GTK_GRID(pContainer), pChild, 0, 0, 1, 1);
+        else if (GTK_IS_POPOVER(pContainer))
+            gtk_popover_set_child(GTK_POPOVER(pContainer), pChild);
 #endif
     }
 

Reply via email to