diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-10-29 01:54:05 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-10-29 01:54:05 +0000 |
commit | 43273844fccd6990c8716ee67f90eedc105528aa (patch) | |
tree | 7c5d8430cca9ac0c7fa1d1ac6e004a147b41f0c3 /src | |
parent | 633e485db09881d0c8dc46e76b42c26dc50efc88 (diff) |
src/addressbook.c: change selection if a non-selected row is right-clicked.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2311 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/addressbook.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/addressbook.c b/src/addressbook.c index 3992ba71..7bfa7915 100644 --- a/src/addressbook.c +++ b/src/addressbook.c @@ -1490,14 +1490,30 @@ static gboolean addressbook_list_button_pressed(GtkWidget *widget, return FALSE; if (event->button == 3) { - gtk_menu_popup(GTK_MENU(addrbook.list_popup), NULL, NULL, NULL, NULL, event->button, event->time); - return TRUE; + GtkTreePath *path; + GtkTreeSelection *selection; + + gtk_menu_popup(GTK_MENU(addrbook.list_popup), NULL, NULL, + NULL, NULL, event->button, event->time); + if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget), + event->x, event->y, + &path, NULL, NULL, NULL)) { + selection = gtk_tree_view_get_selection + (GTK_TREE_VIEW(widget)); + if (gtk_tree_selection_path_is_selected + (selection, path)) { + gtk_tree_path_free(path); + return TRUE; + } + gtk_tree_path_free(path); + } } else if (event->type == GDK_2BUTTON_PRESS) { debug_print("addressbook_list_button_pressed: GDK_2BUTTON_PRESS\n"); /* Handle double click */ if (prefs_common.add_address_by_click && addrbook.target_compose) - addressbook_to_clicked(NULL, GINT_TO_POINTER(COMPOSE_ENTRY_TO)); + addressbook_to_clicked + (NULL, GINT_TO_POINTER(COMPOSE_ENTRY_TO)); else addressbook_edit_address_cb(NULL, 0, NULL); } |