aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-10-29 01:54:05 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-10-29 01:54:05 +0000
commit43273844fccd6990c8716ee67f90eedc105528aa (patch)
tree7c5d8430cca9ac0c7fa1d1ac6e004a147b41f0c3
parent633e485db09881d0c8dc46e76b42c26dc50efc88 (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
-rw-r--r--ChangeLog5
-rw-r--r--src/addressbook.c22
2 files changed, 24 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0b452ffe..1de68091 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,11 @@
* version 3.0.0beta1
+2009-10-29
+
+ * src/addressbook.c: addressbook_list_button_pressed(): change
+ selection if a non-selected row is right-clicked.
+
2009-10-28
* libsylph/socket.c: sock_connect_async_thread(): fixed a crash
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);
}