--- evolution-2.12.3/mail/message-list.h.desel-mail-preview 2009-03-09 18:46:27.000000000 +0100 +++ evolution-2.12.3/mail/message-list.h 2009-03-09 18:46:56.000000000 +0100 @@ -136,6 +136,9 @@ int cursor_row; char *cursor_uid; + /* whether the last selection was on a single row or none/multi */ + gboolean last_sel_single; + /* Row-selection and seen-marking timers */ guint idle_id, seen_id; --- evolution-2.12.3/mail/message-list.c.desel-mail-preview 2009-03-09 18:46:21.000000000 +0100 +++ evolution-2.12.3/mail/message-list.c 2009-03-09 18:50:52.000000000 +0100 @@ -2044,6 +2044,9 @@ message_list->uid_nodemap = g_hash_table_new (g_str_hash, g_str_equal); message_list->async_event = mail_async_event_new(); + message_list->cursor_uid = NULL; + message_list->last_sel_single = FALSE; + /* TODO: Should this only get the selection if we're realised? */ p = message_list->priv = g_malloc0(sizeof(*message_list->priv)); p->invisible = gtk_invisible_new(); @@ -3190,8 +3193,13 @@ else new_uid = get_message_uid (message_list, path); + /* Do not check the cursor_uid and the new_uid values, because the selected item + (set in on_selection_changed_cmd) can be different from the one with a cursor + (when selecting with Ctrl, for example). This has a little side-effect, when + keeping list it that state, then changing folders forth and back will select + and move cursor to that selected item. Does anybody consider it as a bug? */ if ((message_list->cursor_uid == NULL && new_uid == NULL) - || (message_list->cursor_uid != NULL && new_uid != NULL && !strcmp (message_list->cursor_uid, new_uid))) + || (message_list->last_sel_single && message_list->cursor_uid != NULL && new_uid != NULL)) return; message_list->cursor_row = row; @@ -3225,8 +3233,8 @@ /* If the selection isn't empty, then we ignore the no-uid check, since this event is also used for other updating. If it is empty, it might just be a setup event from etree which we do need to ignore */ - if ((newuid == NULL && ml->cursor_uid == NULL && uids->len == 0) - || (uids->len == 1 && newuid != NULL && ml->cursor_uid != NULL && !strcmp(ml->cursor_uid, newuid))) { + if ((newuid == NULL && ml->cursor_uid == NULL && uids->len == 0) || + (ml->last_sel_single && uids->len == 1 && newuid != NULL && ml->cursor_uid != NULL && !strcmp (ml->cursor_uid, newuid))) { /* noop */ } else { g_free(ml->cursor_uid); @@ -3235,6 +3243,8 @@ ml->idle_id = g_idle_add_full (G_PRIORITY_LOW, on_cursor_activated_idle, ml, NULL); } + ml->last_sel_single = uids->len == 1; + message_list_free_uids(ml, uids); }