Hi. For fun I thought I'd have a go at fixing this bug. It seems to be
an old bug going back to at least Geeqie 1.0. It's hardly a serious
issue, but I've noticed it on many occasions.
It seems to be triggered by a call to gtk_tree_view_set_cursor in the
function vficon_set_focus in view_file_icon.c. I found that removing
that call makes the problem go away. But what is the call there for?
The comment above the call says the following:
/* focus is set to an extra column with 0 width to hide focus */
However, try as I might, I cannot see any visual difference if I remove
the call. So maybe it's not needed?
I've included a patch that removes this call (and the similar one in
collect-table.c). This fixes the bug for me, but I have only tested
the patch on GTK2. It is untested on GTK3.
Maybe a GTK wizard can weigh in on correctness here. At the very least
it might act as a starting point for a more correct fix, if there is
one.
Kind regards,
Michael
diff --git a/src/collect-table.c b/src/collect-table.c
index 2695640..b45633b 100644
--- a/src/collect-table.c
+++ b/src/collect-table.c
@@ -1011,13 +1011,6 @@ static void collection_table_set_focus(CollectTable *ct, CollectInfo *info)
GtkTreeModel *store;
tree_view_row_make_visible(GTK_TREE_VIEW(ct->listview), &iter, FALSE);
-
- store = gtk_tree_view_get_model(GTK_TREE_VIEW(ct->listview));
- tpath = gtk_tree_model_get_path(store, &iter);
- /* focus is set to an extra column with 0 width to hide focus, we draw it ourself */
- column = gtk_tree_view_get_column(GTK_TREE_VIEW(ct->listview), COLLECT_TABLE_MAX_COLUMNS);
- gtk_tree_view_set_cursor(GTK_TREE_VIEW(ct->listview), tpath, column, FALSE);
- gtk_tree_path_free(tpath);
}
}
diff --git a/src/view_file_icon.c b/src/view_file_icon.c
index 1457f81..45cb6a9 100644
--- a/src/view_file_icon.c
+++ b/src/view_file_icon.c
@@ -1200,13 +1200,6 @@ static void vficon_set_focus(ViewFile *vf, IconData *id)
GtkTreeModel *store;
tree_view_row_make_visible(GTK_TREE_VIEW(vf->listview), &iter, FALSE);
-
- store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview));
- tpath = gtk_tree_model_get_path(store, &iter);
- /* focus is set to an extra column with 0 width to hide focus, we draw it ourself */
- column = gtk_tree_view_get_column(GTK_TREE_VIEW(vf->listview), VFICON_MAX_COLUMNS);
- gtk_tree_view_set_cursor(GTK_TREE_VIEW(vf->listview), tpath, column, FALSE);
- gtk_tree_path_free(tpath);
}
}