sync with 0.7.5cvs9
[claws.git] / src / summary_search.c
index 568b8895eb8b185e87db406fa43015d5be84d3d3..60e517d618dd821f2bd1b9fa9ec2be5d915c0b36 100644 (file)
@@ -232,6 +232,9 @@ static void summary_search_execute(GtkButton *button, gpointer data)
        wchar_t *(* WCSFindFunc) (const wchar_t *haystack,
                                  const wchar_t *needle);
 
+       if (summary_is_locked(summaryview)) return;
+       summary_lock(summaryview);
+
        case_sens = gtk_toggle_button_get_active
                (GTK_TOGGLE_BUTTON(case_checkbtn));
        backward = gtk_toggle_button_get_active
@@ -267,7 +270,10 @@ static void summary_search_execute(GtkButton *button, gpointer data)
                else
                        node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
-               if (!node) return;
+               if (!node) {
+                       summary_unlock(summaryview);
+                       return;
+               }
        } else {
                if (backward)
                        node = GTK_CTREE_NODE_PREV(summaryview->selected);
@@ -349,8 +355,10 @@ static void summary_search_execute(GtkButton *button, gpointer data)
                                gtk_ctree_select(ctree, node);
                        else {
                                if (summaryview->msg_is_toggled_on) {
+                                       summary_unlock(summaryview);
                                        summary_select_node
                                                (summaryview, node, TRUE, TRUE);
+                                       summary_lock(summaryview);
                                        if (body_matched) {
                                                messageview_search_string
                                                        (summaryview->messageview,
@@ -370,6 +378,8 @@ static void summary_search_execute(GtkButton *button, gpointer data)
 
        if (*body_str)
                main_window_cursor_normal(summaryview->mainwin);
+
+       summary_unlock(summaryview);
 }
 
 static void summary_search_clear(GtkButton *button, gpointer data)