[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-857-gcd4940b85

paul at claws-mail.org paul at claws-mail.org
Mon Nov 25 13:07:11 CET 2019


The branch, gtk3 has been updated
       via  cd4940b85698a76965a181a3eba5bbe035dbfdcf (commit)
       via  67c288116ae3cad0f949e6a52e162612243abde7 (commit)
      from  c25cd494328a72d50880aa1e6c479bbe1496c567 (commit)

Summary of changes:
 src/action.c                             |   4 +-
 src/folderview.c                         |   6 +-
 src/imap_gtk.c                           |   2 +-
 src/mainwindow.c                         |   8 +--
 src/mh_gtk.c                             |   2 +-
 src/news_gtk.c                           |   2 +-
 src/plugins/mailmbox/plugin_gtk.c        |   4 +-
 src/plugins/vcalendar/vcal_meeting_gtk.c |   4 +-
 src/plugins/vcalendar/vcalendar.c        |   8 +--
 src/prefs_folder_item.c                  |   2 +-
 src/summaryview.c                        | 101 +++++++++++++++++--------------
 src/summaryview.h                        |   3 +-
 12 files changed, 79 insertions(+), 67 deletions(-)


- Log -----------------------------------------------------------------
commit cd4940b85698a76965a181a3eba5bbe035dbfdcf
Author: Paul <paul at claws-mail.org>
Date:   Mon Nov 25 12:56:52 2019 +0000

    fix last commit

diff --git a/src/summaryview.c b/src/summaryview.c
index 9eeb50be2..9c40eebab 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -1285,7 +1285,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item, gboolean avoid
 	
 	utils_free_regex();
 
-	is_refresh = (item == summaryview->folder_item && !manual_filtering) ? TRUE : FALSE;
+	is_refresh = (item == summaryview->folder_item && !avoid_refresh) ? TRUE : FALSE;
 
 	if (item && item->folder->klass->item_opened) {
 		item->folder->klass->item_opened(item);

commit 67c288116ae3cad0f949e6a52e162612243abde7
Author: Paul <paul at claws-mail.org>
Date:   Mon Nov 25 12:52:44 2019 +0000

    avoid unwanted summaryview refresh...
    
    ... such as when modifying a msg by Actions
    Should also fix bug 4277, 'INBOX being "read" automatically - being
    marked as read before being selected'

diff --git a/src/action.c b/src/action.c
index 55552aabb..9200e3463 100644
--- a/src/action.c
+++ b/src/action.c
@@ -753,7 +753,7 @@ static gboolean execute_filtering_actions(gchar *action, GSList *msglist)
 		summary_thaw(summaryview);		
 		main_window_cursor_normal(mainwin);	
 		summary_unlock(summaryview);				
-		summary_show(summaryview, summaryview->folder_item);
+		summary_show(summaryview, summaryview->folder_item, FALSE);
 	}
 	for (p = action_list; p; p = g_slist_next(p))
 		if (p->data) filteringaction_free(p->data);	
@@ -1484,7 +1484,7 @@ static void catch_status(GPid pid, gint status, gpointer data)
 		}
 		if (modified_something && last_item && 
 		    summaryview && summaryview->folder_item == last_item) {
-			summary_show (summaryview, summaryview->folder_item);
+			summary_show (summaryview, summaryview->folder_item, FALSE);
 		}
 		g_slist_free (child_info->msginfo_list);
 		child_info->msginfo_list = NULL;
diff --git a/src/folderview.c b/src/folderview.c
index 2e362a4b4..1eb2dd9ed 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -1796,7 +1796,7 @@ static gboolean folderview_update_item_claws(gpointer source, gpointer data)
 		     update_info->item == folderview->summaryview->folder_item &&
 		     update_info->item != NULL)
 			if (!quicksearch_has_sat_predicate(folderview->summaryview->quicksearch))
-				summary_show(folderview->summaryview, update_info->item);
+				summary_show(folderview->summaryview, update_info->item, FALSE);
 	}
 	
 	return FALSE;
@@ -2228,7 +2228,7 @@ void folderview_close_opened(FolderView *folderview, gboolean dirty)
 			main_window_cursor_wait(folderview->mainwin);
 			g_free(buf);
 			summary_save_prefs_to_folderitem(folderview->summaryview, olditem);
-			summary_show(folderview->summaryview, NULL);
+			summary_show(folderview->summaryview, NULL, FALSE);
 			folder_item_close(olditem);
 			main_window_cursor_normal(folderview->mainwin);
 			STATUSBAR_POP(folderview->mainwin);
@@ -2361,7 +2361,7 @@ static void folderview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
 
 	/* Show messages */
 	summary_set_prefs_from_folderitem(folderview->summaryview, item);
-	opened = summary_show(folderview->summaryview, item);
+	opened = summary_show(folderview->summaryview, item, FALSE);
 	
 	folder_clean_cache_memory(item);
 
diff --git a/src/imap_gtk.c b/src/imap_gtk.c
index e7bcbd91b..e631f9397 100644
--- a/src/imap_gtk.c
+++ b/src/imap_gtk.c
@@ -404,7 +404,7 @@ static void update_tree_cb(GtkAction *action, gpointer data)
 	item = folderview_get_selected_item(folderview);
 	cm_return_if_fail(item != NULL);
 
-	summary_show(folderview->summaryview, NULL);
+	summary_show(folderview->summaryview, NULL, FALSE);
 
 	cm_return_if_fail(item->folder != NULL);
 
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 33ad22f46..5359ea1f0 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -2779,7 +2779,7 @@ void main_window_toggle_message_view(MainWindow *mainwin)
 	}
 	summary_grab_focus(summaryview);
 	if (!summary_is_list(summaryview)) {
-		summary_show(summaryview, summaryview->folder_item);
+		summary_show(summaryview, summaryview->folder_item, FALSE);
 	}
 }
 
@@ -3946,7 +3946,7 @@ static void add_mailbox_cb(GtkAction *action, gpointer data)
 static void update_folderview_cb(GtkAction *action, gpointer data)
 {
 	MainWindow *mainwin = (MainWindow *)data;
-	summary_show(mainwin->summaryview, NULL);
+	summary_show(mainwin->summaryview, NULL, FALSE);
 	folderview_check_new_all();
 }
 
@@ -4634,7 +4634,7 @@ static void thread_cb(GtkAction *action, gpointer data)
 	mainwin->summaryview->threaded = threaded;
 
 	summary_show(mainwin->summaryview, 
-			mainwin->summaryview->folder_item);
+			mainwin->summaryview->folder_item, FALSE);
 	summary_select_by_msgnum(mainwin->summaryview, selected_msgnum, FALSE);
 }
 
@@ -4826,7 +4826,7 @@ static void update_summary_cb(GtkAction *action, gpointer data)
 
 	folder_update_op_count();
 	folder_item_scan(fitem);
-	summary_show(mainwin->summaryview, fitem);
+	summary_show(mainwin->summaryview, fitem, FALSE);
 }
 
 static void prev_cb(GtkAction *action, gpointer data)
diff --git a/src/mh_gtk.c b/src/mh_gtk.c
index d5867f751..f70162ab9 100644
--- a/src/mh_gtk.c
+++ b/src/mh_gtk.c
@@ -345,7 +345,7 @@ static void update_tree_cb(GtkAction *action, gpointer data)
 	item = folderview_get_selected_item(folderview);
 	cm_return_if_fail(item != NULL);
 
-	summary_show(folderview->summaryview, NULL);
+	summary_show(folderview->summaryview, NULL, FALSE);
 
 	cm_return_if_fail(item->folder != NULL);
 
diff --git a/src/news_gtk.c b/src/news_gtk.c
index 78a31aa6f..7b861c231 100644
--- a/src/news_gtk.c
+++ b/src/news_gtk.c
@@ -329,7 +329,7 @@ static void update_tree_cb(GtkAction *action, gpointer data)
 	if (mainwin->lock_count || news_folder_locked(item->folder))
 		return;
 
-	summary_show(folderview->summaryview, NULL);
+	summary_show(folderview->summaryview, NULL, FALSE);
 
 	cm_return_if_fail(item->folder != NULL);
 
diff --git a/src/plugins/mailmbox/plugin_gtk.c b/src/plugins/mailmbox/plugin_gtk.c
index cecc93d2d..ab7c86409 100644
--- a/src/plugins/mailmbox/plugin_gtk.c
+++ b/src/plugins/mailmbox/plugin_gtk.c
@@ -172,7 +172,7 @@ static void update_tree_cb(GtkAction *action, gpointer data)
 	item = folderview_get_selected_item(folderview);
 	g_return_if_fail(item != NULL);
 
-	summary_show(folderview->summaryview, NULL);
+	summary_show(folderview->summaryview, NULL, FALSE);
 
 	g_return_if_fail(item->folder != NULL);
 
@@ -348,7 +348,7 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
 		alertpanel_error(_("Can't remove the folder '%s'."), name);
 		if (item == opened)
 			summary_show(folderview->summaryview,
-				     folderview->summaryview->folder_item);
+				     folderview->summaryview->folder_item, FALSE);
 		g_free(old_id);
 		return;
 	}
diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c
index 9c89d4b5b..e0440885f 100644
--- a/src/plugins/vcalendar/vcal_meeting_gtk.c
+++ b/src/plugins/vcalendar/vcal_meeting_gtk.c
@@ -1204,7 +1204,7 @@ static gboolean send_meeting_cb(GtkButton *widget, gpointer data)
 		MainWindow *mainwin = mainwindow_get_mainwindow();
 		if (mainwin->summaryview->folder_item == folder->inbox) {
 			redisp = TRUE;
-			summary_show(mainwin->summaryview, NULL);
+			summary_show(mainwin->summaryview, NULL, FALSE);
 		}
 	}
 	gtk_widget_set_sensitive(meet->save_btn, FALSE);
@@ -1317,7 +1317,7 @@ static gboolean send_meeting_cb(GtkButton *widget, gpointer data)
 
 	if (folder && redisp) {
 		MainWindow *mainwin = mainwindow_get_mainwindow();
-		summary_show(mainwin->summaryview, folder->inbox);
+		summary_show(mainwin->summaryview, folder->inbox, FALSE);
 	}
 
 	return res;
diff --git a/src/plugins/vcalendar/vcalendar.c b/src/plugins/vcalendar/vcalendar.c
index f443a09eb..626a3179e 100644
--- a/src/plugins/vcalendar/vcalendar.c
+++ b/src/plugins/vcalendar/vcalendar.c
@@ -927,7 +927,7 @@ void vcalendar_refresh_folder_contents(FolderItem *item)
 		MainWindow *mainwin = mainwindow_get_mainwindow();
 		folder_item_scan(item);
 		if (mainwin->summaryview->folder_item == item) {
-			summary_show(mainwin->summaryview, item);
+			summary_show(mainwin->summaryview, item, FALSE);
 		}
 	}
 }
@@ -971,7 +971,7 @@ void vcalendar_cancel_meeting(FolderItem *item, const gchar *uid)
 		MainWindow *mainwin = mainwindow_get_mainwindow();
 		if (mainwin->summaryview->folder_item == item) {
 			redisp = TRUE;
-			summary_show(mainwin->summaryview, NULL);
+			summary_show(mainwin->summaryview, NULL, FALSE);
 		}
 	}
 	
@@ -986,7 +986,7 @@ void vcalendar_cancel_meeting(FolderItem *item, const gchar *uid)
 
 			if (folder && redisp) {
 				MainWindow *mainwin = mainwindow_get_mainwindow();
-				summary_show(mainwin->summaryview, item);
+				summary_show(mainwin->summaryview, item, FALSE);
 			}
 			return;
 		}
@@ -1002,7 +1002,7 @@ void vcalendar_cancel_meeting(FolderItem *item, const gchar *uid)
 		folder_item_scan(item);
 	if (folder && redisp) {
 		MainWindow *mainwin = mainwindow_get_mainwindow();
-		summary_show(mainwin->summaryview, item);
+		summary_show(mainwin->summaryview, item, FALSE);
 	}
 
 	return;
diff --git a/src/prefs_folder_item.c b/src/prefs_folder_item.c
index 06e16f422..5e1aa1f0e 100644
--- a/src/prefs_folder_item.c
+++ b/src/prefs_folder_item.c
@@ -756,7 +756,7 @@ static void general_save_folder_prefs(FolderItem *folder, FolderItemGeneralPage
 
 	if (folder->opened && summary_update_needed) {
 		summary_set_prefs_from_folderitem(folderview->summaryview, folder);
-		summary_show(folderview->summaryview, folder);
+		summary_show(folderview->summaryview, folder, FALSE);
 	}	
 }	
 
diff --git a/src/summaryview.c b/src/summaryview.c
index 78d5186db..9eeb50be2 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -1258,7 +1258,7 @@ gboolean summaryview_search_root_progress(gpointer data, guint at, guint matched
 	return TRUE;
 }
 
-gboolean summary_show(SummaryView *summaryview, FolderItem *item)
+gboolean summary_show(SummaryView *summaryview, FolderItem *item, gboolean avoid_refresh)
 {
 	GtkCMCTree *ctree = GTK_CMCTREE(summaryview->ctree);
 	GtkCMCTreeNode *node = NULL;
@@ -1285,7 +1285,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 	
 	utils_free_regex();
 
-	is_refresh = (item == summaryview->folder_item) ? TRUE : FALSE;
+	is_refresh = (item == summaryview->folder_item && !manual_filtering) ? TRUE : FALSE;
 
 	if (item && item->folder->klass->item_opened) {
 		item->folder->klass->item_opened(item);
@@ -1417,7 +1417,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 			main_window_cursor_normal(summaryview->mainwin);
 			summary_unlock(summaryview);
 			inc_unlock();
-			summary_show(summaryview, summaryview->folder_item);
+			summary_show(summaryview, summaryview->folder_item, FALSE);
 			END_TIMING();
 			return FALSE;
 		}
@@ -1500,43 +1500,52 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 
 	g_slist_free(mlist);
 
-	if (quicksearch_is_in_typing(summaryview->quicksearch) ||
-	    quicksearch_is_running(summaryview->quicksearch)) {
-		summaryview->displayed =
-			summary_find_msg_by_msgnum(summaryview,
-						   displayed_msgnum);
-		if (!summaryview->displayed)
-			messageview_clear(summaryview->messageview);
-		summary_unlock(summaryview);
-
-		if (quicksearch_is_running(summaryview->quicksearch))
-			summary_select_by_msgnum(summaryview, selected_msgnum,
-					OPEN_SELECTED_ON_SEARCH_RESULTS);
-		else
-			summary_select_by_msgnum(summaryview, selected_msgnum,
-					FALSE);
-
-		summary_lock(summaryview);
-		if (!summaryview->selected) {
-			/* no selected message - select first unread
-			   message, but do not display it */
-			node = summary_find_next_flagged_msg(summaryview, NULL,
-							     MSG_UNREAD, FALSE);
-			if (node == NULL && GTK_CMCLIST(ctree)->row_list != NULL)
-				node = gtk_cmctree_node_nth
-					(ctree,
-					 item->sort_type == SORT_DESCENDING
-					 ? 0 : GTK_CMCLIST(ctree)->rows - 1);
+	if (is_refresh) {
+		if (!quicksearch_is_in_typing(summaryview->quicksearch)) {
+			summaryview->displayed =
+				summary_find_msg_by_msgnum(summaryview,
+							   displayed_msgnum);
+			if (!summaryview->displayed)
+				messageview_clear(summaryview->messageview);
 			summary_unlock(summaryview);
 
 			if (quicksearch_is_running(summaryview->quicksearch))
-				summary_select_node(summaryview, node,
+				summary_select_by_msgnum(summaryview, selected_msgnum,
 						OPEN_SELECTED_ON_SEARCH_RESULTS);
 			else
-				summary_select_node(summaryview, node,
-						OPEN_SELECTED_ON_FOLDER_OPEN);
+				summary_select_by_msgnum(summaryview, selected_msgnum,
+						FALSE);
 
 			summary_lock(summaryview);
+			if (!summaryview->selected) {
+				/* no selected message - select first unread
+				   message, but do not display it */
+				node = summary_find_next_flagged_msg(summaryview, NULL,
+								     MSG_UNREAD, FALSE);
+				if (node == NULL && GTK_CMCLIST(ctree)->row_list != NULL)
+					node = gtk_cmctree_node_nth
+						(ctree,
+						 item->sort_type == SORT_DESCENDING
+						 ? 0 : GTK_CMCLIST(ctree)->rows - 1);
+				summary_unlock(summaryview);
+
+				if (quicksearch_is_running(summaryview->quicksearch))
+					summary_select_node(summaryview, node,
+							OPEN_SELECTED_ON_SEARCH_RESULTS);
+				else
+					summary_select_node(summaryview, node,
+							OPEN_SELECTED_ON_FOLDER_OPEN);
+
+				summary_lock(summaryview);
+			}
+		} else {
+			/* just select first/last */
+			if (GTK_CMCLIST(ctree)->row_list != NULL)
+				node = gtk_cmctree_node_nth
+					(ctree,
+					 item->sort_type == SORT_DESCENDING
+					 ? 0 : GTK_CMCLIST(ctree)->rows - 1);
+			summary_select_node(summaryview, node, OPEN_SELECTED_ON_SEARCH_RESULTS);
 		}
 	} else {
 		/* backward compat */
@@ -1642,10 +1651,12 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 
 		if (node) {
 			gint open_selected = -1;
-			if (OPEN_SELECTED_ON_FOLDER_OPEN)
-				open_selected = 1;
-			else
-				open_selected = 0;
+			if (!is_refresh) {
+				if (OPEN_SELECTED_ON_FOLDER_OPEN)
+					open_selected = 1;
+				else
+					open_selected = 0;
+			}
 			summary_select_node(summaryview, node, open_selected);
 		}
 
@@ -2991,7 +3002,7 @@ void summary_reflect_prefs(void)
 	summary_relayout(summaryview);
 	
 	if (summaryview->folder_item)
-		summary_show(summaryview, summaryview->folder_item);
+		summary_show(summaryview, summaryview->folder_item, FALSE);
 }
 
 void summary_sort(SummaryView *summaryview,
@@ -5179,7 +5190,7 @@ gboolean summary_execute(SummaryView *summaryview)
 	main_window_cursor_normal(summaryview->mainwin);
 
 	if (move_val < 0) 
-		summary_show(summaryview, summaryview->folder_item);
+		summary_show(summaryview, summaryview->folder_item, FALSE);
 	return TRUE;
 }
 
@@ -5867,7 +5878,7 @@ void summary_filter(SummaryView *summaryview, gboolean selected_only)
 	 * CLAWS: summary_show() only valid after having a lock. ideally
 	 * we want the lock to be context aware...  
 	 */
-	summary_show(summaryview, summaryview->folder_item);
+	summary_show(summaryview, summaryview->folder_item, TRUE);
 }
 
 static void summary_filter_func(MsgInfo *msginfo, PrefsAccount *ac_prefs)
@@ -6849,7 +6860,7 @@ void summary_set_column_order(SummaryView *summaryview)
 	gtk_container_add(GTK_CONTAINER(scrolledwin), ctree);
 	gtk_widget_show(ctree);
 
-	summary_show(summaryview, item);
+	summary_show(summaryview, item, FALSE);
 
 	summary_select_by_msgnum(summaryview, selected_msgnum, FALSE);
 
@@ -7108,7 +7119,7 @@ static void quicksearch_execute_cb(QuickSearch *quicksearch, gpointer data)
 	SummaryView *summaryview = data;
 
 	summaryview_reset_recursive_folder_match(summaryview);
-	if (summary_show(summaryview, summaryview->folder_item))
+	if (summary_show(summaryview, summaryview->folder_item, FALSE))
 		summaryview_quicksearch_recurse(summaryview);
 	else
 		summaryview_reset_recursive_folder_match(summaryview);
@@ -8100,7 +8111,7 @@ void summary_toggle_show_read_messages(SummaryView *summaryview)
 	source.update_flags = F_ITEM_UPDATE_NAME;
 	source.msg = NULL;
 	hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
- 	summary_show(summaryview, summaryview->folder_item);
+ 	summary_show(summaryview, summaryview->folder_item, FALSE);
 }
  
 void summary_toggle_show_del_messages(SummaryView *summaryview)
@@ -8115,7 +8126,7 @@ void summary_toggle_show_del_messages(SummaryView *summaryview)
 	source.update_flags = F_ITEM_UPDATE_NAME;
 	source.msg = NULL;
 	hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
- 	summary_show(summaryview, summaryview->folder_item);
+ 	summary_show(summaryview, summaryview->folder_item, FALSE);
 }
  
 void summary_toggle_show_read_threads(SummaryView *summaryview)
@@ -8130,7 +8141,7 @@ void summary_toggle_show_read_threads(SummaryView *summaryview)
 	source.update_flags = F_ITEM_UPDATE_NAME;
 	source.msg = NULL;
 	hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
- 	summary_show(summaryview, summaryview->folder_item);
+ 	summary_show(summaryview, summaryview->folder_item, FALSE);
 }
  
 static void summary_set_hide_menu (SummaryView *summaryview,
diff --git a/src/summaryview.h b/src/summaryview.h
index ead0e89cb..311e8148e 100644
--- a/src/summaryview.h
+++ b/src/summaryview.h
@@ -188,7 +188,8 @@ SummaryView	*summary_create(MainWindow *mainwin);
 void summaryview_destroy(SummaryView *summaryview);
 void summary_init		  (SummaryView		*summaryview);
 gboolean summary_show		  (SummaryView		*summaryview,
-				   FolderItem		*fitem);
+				   FolderItem		*fitem,
+				   gboolean		 avoid_refresh);
 void summary_clear_list		  (SummaryView		*summaryview);
 void summary_clear_all		  (SummaryView		*summaryview);
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list