aboutsummaryrefslogtreecommitdiff
path: root/src/folderview.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-04-07 09:04:51 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-04-07 09:04:51 +0000
commit3030a5e737c738c7b9466786c8696ee68c04f547 (patch)
treeda41d0acfb2e660675dbf5d4473881d481039798 /src/folderview.c
parent39c49cbb79d346f277d236c6b069a9de7dad4211 (diff)
don't let GtkTreeView grab focus after opening a folder by button press.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@203 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/folderview.c')
-rw-r--r--src/folderview.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/folderview.c b/src/folderview.c
index 05930860..15bcd746 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -1568,6 +1568,15 @@ static gboolean folderview_key_pressed(GtkWidget *widget, GdkEventKey *event,
return FALSE;
}
+static gboolean folderview_focus_idle_func(gpointer data)
+{
+ FolderView *folderview = (FolderView *)data;
+
+ GTK_WIDGET_SET_FLAGS(folderview->treeview, GTK_CAN_FOCUS);
+
+ return FALSE;
+}
+
static void folderview_selection_changed(GtkTreeSelection *selection,
FolderView *folderview)
{
@@ -1624,6 +1633,13 @@ static void folderview_selection_changed(GtkTreeSelection *selection,
gtk_tree_view_scroll_to_cell
(GTK_TREE_VIEW(folderview->treeview), path, NULL, FALSE,
0.0, 0.0);
+ if (item->total > 0) {
+ /* don't let GtkTreeView::gtk_tree_view_button_press()
+ * grab focus */
+ GTK_WIDGET_UNSET_FLAGS(folderview->treeview,
+ GTK_CAN_FOCUS);
+ g_idle_add(folderview_focus_idle_func, folderview);
+ }
} else
folderview_select_row_ref(folderview, folderview->opened);