vcl/unx/gtk3/gtkinst.cxx |   21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

New commits:
commit b4df7e3da3e5a62116f1b2c85b10ac5cd3dbb662
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Feb 17 16:53:00 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Feb 19 09:30:13 2026 +0100

    warn on mismatching expanders/tree-lines
    
    where we assume we want both or neither
    
    Change-Id: Ida2bbd75e8d164946bc111a8acdebfe0fca2d86a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199562
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index fb8ac9a5b85d..70269889a08f 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -14686,6 +14686,10 @@ public:
             m_Clear = list_store_clear;
         }
 
+        SAL_WARN_IF(gtk_tree_view_get_show_expanders(m_pTreeView) != 
gtk_tree_view_get_enable_tree_lines(m_pTreeView),
+                "vcl.gtk", "GtkTreeView " << 
get_buildable_id(GTK_BUILDABLE(m_pTreeView)) <<
+                " has likely mismatching expander/tree-lists attributes.");
+
         /* The outside concept of a column maps to a gtk CellRenderer, rather 
than
            a TreeViewColumn. If the first TreeViewColumn has a leading Toggle 
Renderer
            and/or a leading Image Renderer, those are considered special 
expander
commit 68d0045b1734d8787aff5982eda8e324577dcd7c
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Feb 17 16:29:11 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Feb 19 09:30:02 2026 +0100

    output a hint if there's a possible GtkListStore optimization
    
    Change-Id: I3e3cc50c5ac5e12f3bbd800ef05aac378e09681a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199560
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 9a4f3f9d2721..fb8ac9a5b85d 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -14649,8 +14649,21 @@ public:
         , 
m_pVAdjustment(gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(pTreeView)))
         , m_pChangeEvent(nullptr)
     {
+        /*
+           Note: tdf#136559 and see 
https://gitlab.gnome.org/GNOME/gtk/-/issues/2693
+           If we only need a list and not a tree we can get a performance boost
+           from using a ListStore.
+
+           If we lock in that all TreeViews that are hierarchical have
+           expanders (or tree lines) then we can assume that should use
+           GtkTreeStore, and those without should use GtkListStore.
+         */
+
         if (GTK_IS_TREE_STORE(m_pTreeModel))
         {
+            SAL_WARN_IF(!gtk_tree_view_get_show_expanders(m_pTreeView),
+                "vcl.gtk", "GtkTreeView " << 
get_buildable_id(GTK_BUILDABLE(m_pTreeView)) <<
+                " could use GtkListStore for better performance.");
             m_Setter = tree_store_set;
             m_InsertWithValues = tree_store_insert_with_values;
             m_Insert = tree_store_insert;
@@ -14662,10 +14675,6 @@ public:
         }
         else
         {
-            /*
-               tdf#136559 see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2693
-               If we only need a list and not a tree we can get a performance 
boost from using a ListStore
-             */
             assert(!gtk_tree_view_get_show_expanders(m_pTreeView) && "a 
liststore can only be used if no tree structure is needed");
             m_Setter = list_store_set;
             m_InsertWithValues = list_store_insert_with_values;

Reply via email to