implemtent RFE 4255, "Switching 'Thread view' on/off discards message selection"
authorPaul <paul@claws-mail.org>
Sun, 6 Oct 2019 11:45:59 +0000 (12:45 +0100)
committerPaul <paul@claws-mail.org>
Sun, 6 Oct 2019 11:45:59 +0000 (12:45 +0100)
src/mainwindow.c

index 9001ba2..62eea35 100644 (file)
@@ -4654,9 +4654,13 @@ static void thread_cb(GtkAction *action, gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
        gboolean threaded = FALSE;
+       guint selected_msgnum = 0;
+
        if (mainwin->menu_lock_count) return;
        if (!mainwin->summaryview->folder_item) return;
 
+       selected_msgnum = summary_get_msgnum(mainwin->summaryview, mainwin->summaryview->selected);
+
        threaded = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
 
        mainwin->summaryview->folder_item->threaded = threaded; 
@@ -4665,6 +4669,7 @@ static void thread_cb(GtkAction *action, gpointer data)
 
        summary_show(mainwin->summaryview, 
                        mainwin->summaryview->folder_item);
+       summary_select_by_msgnum(mainwin->summaryview, selected_msgnum, FALSE);
 }
 
 static void expand_threads_cb(GtkAction *action, gpointer data)