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

New commits:
commit 3c8e81669f2311dd35aa6787cbf3e5a6a0520433
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Fri Jul 8 21:59:25 2022 -0800
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Sun Jul 17 02:51:46 2022 +0200

    tdf#149279 related: make gtk treeview scroll_to_row more sal like
    
    The SalInstanceTreeView version of scroll_to_row always scrolls a row
    that is not visible to the top visible row. GtkInstanceTreeView
    scroll_to_row does the minimum amount of work to scroll the cell onto
    the screen. This means that the cell will be scrolled to the edge
    closest to its current position. This patch makes the gtk behavior
    always scroll the row so it is the top visible row.
    
    Change-Id: Ib318d7bede3723de9e84ea2db5fbfa951324facd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136934
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 4bd3573bb420..c88c6886ee85 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -14793,7 +14793,7 @@ public:
         assert(gtk_tree_view_get_model(m_pTreeView) && "don't select when 
frozen, select after thaw. Note selection doesn't survive a freeze");
         disable_notify_events();
         GtkTreePath* path = gtk_tree_path_new_from_indices(pos, -1);
-        gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0);
+        gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, true, 0, 0);
         gtk_tree_path_free(path);
         enable_notify_events();
     }
@@ -15470,7 +15470,7 @@ public:
         disable_notify_events();
         const GtkInstanceTreeIter& rGtkIter = static_cast<const 
GtkInstanceTreeIter&>(rIter);
         GtkTreePath* path = gtk_tree_model_get_path(m_pTreeModel, 
const_cast<GtkTreeIter*>(&rGtkIter.iter));
-        gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0);
+        gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, true, 0, 0);
         gtk_tree_path_free(path);
         enable_notify_events();
     }

Reply via email to