Inacurate scrolling of directories tree

Shraght
2009-05-27
2013-04-15
  • Shraght
    Shraght
    2009-05-27

    I'm not sure if it's really a gqview bug, but for versions up to the most recent one I observed an annoying auto-scroll feature of GtkScrolledWindow->GtkTreeView. After some jumping around few dirs, ScrolledWindow would fail to position the TreeView so that the selected row was visible, scrolling it many rows below / above the selected one, effectively removing it from sight. Then I had to manually scroll the ScrolledWindow to right position so that I could select next directory I wanted to enter.

    This behaviour could be "fixed" with the following patch:

    diff -rupN gqview-2.1.5/src/view_dir_tree.c gqview-2.1.5-vdt/src/view_dir_tree.c
    --- gqview-2.1.5/src/view_dir_tree.c    2006-11-18 00:45:30.000000000 +0100
    +++ gqview-2.1.5-vdt/src/view_dir_tree.c    2009-05-27 11:56:26.000000000 +0200
    @@ -1317,16 +1317,10 @@ gint vdtree_set_path(ViewDirTree *vdt, c

        if (vdtree_find_row(vdt, fd, &iter, NULL))
            {
    -       GtkTreeModel *store;
    -       GtkTreePath *tpath;
    -
    +       //scrolls vdt to active path
            tree_view_row_make_visible(GTK_TREE_VIEW(vdt->treeview), &iter, TRUE);

    -       store = gtk_tree_view_get_model(GTK_TREE_VIEW(vdt->treeview));
    -       tpath = gtk_tree_model_get_path(store, &iter);
    -       gtk_tree_view_set_cursor(GTK_TREE_VIEW(vdt->treeview), tpath, NULL, FALSE);
    -       gtk_tree_path_free(tpath);
    -
    +       //and selects row depicting it
            vdtree_select_row(vdt, fd);
            }