diff options
author | Milan Crha <mcrha@redhat.com> | 2012-01-11 02:30:23 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-01-11 02:30:23 +0800 |
commit | 73fe6fb330ac9fab009d2bcb5766a2b908a201c7 (patch) | |
tree | 4085c894c691cd75b8040e3fffd6eaf5f6752ff0 /mail/e-mail-reader.c | |
parent | fea81db90a01ce184e5955c19d4c340aeb1cbfff (diff) | |
download | gsoc2013-evolution-73fe6fb330ac9fab009d2bcb5766a2b908a201c7.tar.gz gsoc2013-evolution-73fe6fb330ac9fab009d2bcb5766a2b908a201c7.tar.zst gsoc2013-evolution-73fe6fb330ac9fab009d2bcb5766a2b908a201c7.zip |
Bug #667398 - Automatic mark-as-seen too aggressive
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r-- | mail/e-mail-reader.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 12e3a8ac92..8f51972c25 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -2482,6 +2482,9 @@ mail_reader_message_seen_cb (EMailReaderClosure *closure) formatter = e_mail_reader_get_formatter (reader); message_list = e_mail_reader_get_message_list (reader); + if (e_tree_is_dragging (E_TREE (message_list))) + return FALSE; + current_uid = EM_FORMAT (formatter)->uid; uid_is_current &= (g_strcmp0 (current_uid, message_uid) == 0); @@ -2517,7 +2520,8 @@ schedule_timeout_mark_seen (EMailReader *reader) shell_settings = e_shell_get_shell_settings (shell); message_uid = message_list->cursor_uid; - if (message_uid == NULL) + if (message_uid == NULL || + e_tree_is_dragging (E_TREE (message_list))) return FALSE; schedule_timeout = @@ -2550,6 +2554,24 @@ schedule_timeout_mark_seen (EMailReader *reader) return schedule_timeout; } +static gboolean +discard_timeout_mark_seen_cb (EMailReader *reader) +{ + MessageList *message_list; + + g_return_val_if_fail (reader != NULL, FALSE); + + message_list = MESSAGE_LIST (e_mail_reader_get_message_list (reader)); + g_return_val_if_fail (message_list != NULL, FALSE); + + if (message_list->seen_id > 0) { + g_source_remove (message_list->seen_id); + message_list->seen_id = 0; + } + + return FALSE; +} + static void mail_reader_message_loaded_cb (CamelFolder *folder, GAsyncResult *result, @@ -3758,10 +3780,24 @@ connect_signals: message_list, "message-selected", G_CALLBACK (mail_reader_message_selected_cb), reader); + /* re-schedule mark-as-seen,... */ g_signal_connect_swapped ( message_list, "cursor-change", G_CALLBACK (mail_reader_message_cursor_change_cb), reader); + /* but do not mark-as-seen if... */ + g_signal_connect_swapped ( + message_list, "tree-drag-begin", + G_CALLBACK (discard_timeout_mark_seen_cb), reader); + + g_signal_connect_swapped ( + message_list, "tree-drag-end", + G_CALLBACK (discard_timeout_mark_seen_cb), reader); + + g_signal_connect_swapped ( + message_list, "right-click", + G_CALLBACK (discard_timeout_mark_seen_cb), reader); + g_signal_connect_swapped ( message_list, "message-list-built", G_CALLBACK (mail_reader_emit_folder_loaded), reader); |