Respect quicksearch focus when refreshing summaryview to show new messages
authorAndrej Kacian <ticho@claws-mail.org>
Sun, 30 Dec 2018 00:12:27 +0000 (01:12 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Sun, 30 Dec 2018 00:12:27 +0000 (01:12 +0100)
Fixes bug #2131: Focus stealing after mail check

src/summaryview.c

index a4709c93df35fdde27cd83dc0251f78bbf2588ed..99b30c80589e30ea9afa4a3364a8f6af728bd6e7 100644 (file)
@@ -2349,7 +2349,11 @@ void summary_select_node(SummaryView *summaryview, GtkCMCTreeNode *node,
                summary_lock(summaryview);
                GTK_EVENTS_FLUSH();
                summary_unlock(summaryview);
-               gtk_widget_grab_focus(GTK_WIDGET(ctree));
+
+               /* If quicksearch has focus, let's keep it there. */
+               if (!quicksearch_has_focus(summaryview->quicksearch))
+                       summary_grab_focus(summaryview);
+
                gtkut_ctree_node_move_if_on_the_edge(ctree, node, -1);
 
                if (display_msg && summaryview->displayed == node)