diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2009-12-27 23:56:37 -0200 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2009-12-27 23:56:37 -0200 |
commit | 9ae04fea3f8be56d7ad017d71f2acad1c6e32db8 (patch) | |
tree | 35535c1c588afa37579b48f9732962fe81e5078a /hardinfo2 | |
parent | 000ade2d1866021554cbb04f77174638d3c1706c (diff) |
Don't scroll back when reloading a section (part two)
Diffstat (limited to 'hardinfo2')
-rw-r--r-- | hardinfo2/shell.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/hardinfo2/shell.c b/hardinfo2/shell.c index 912515da..0765158f 100644 --- a/hardinfo2/shell.c +++ b/hardinfo2/shell.c @@ -855,14 +855,14 @@ static gboolean reload_section(gpointer data) gtk_tree_view_set_cursor(GTK_TREE_VIEW(shell->info->view), path, NULL, FALSE); gtk_tree_path_free(path); - } - + } else { + /* restore position */ + RANGE_SET_VALUE(info, vscrollbar, pos_info_scroll); + RANGE_SET_VALUE(moreinfo, vscrollbar, pos_more_scroll); + } + /* make the window drawable again */ gdk_window_thaw_updates(shell->window->window); - - /* restore position */ - RANGE_SET_VALUE(info, vscrollbar, pos_info_scroll); - RANGE_SET_VALUE(moreinfo, vscrollbar, pos_more_scroll); } /* destroy the timeout: it'll be set up again */ @@ -1506,6 +1506,12 @@ static void info_selected(GtkTreeSelection * ts, gpointer data) if (!gtk_tree_selection_get_selected(ts, &model, &parent)) return; + + if (shell->view_type == SHELL_VIEW_NORMAL || + shell->view_type == SHELL_VIEW_PROGRESS) { + gtk_tree_selection_unselect_all(ts); + return; + } gtk_tree_model_get(model, &parent, INFO_TREE_COL_DATA, &datacol, -1); info_selected_show_extra(datacol); |