[anjuta] bgo #782633 - Scintilla editor occupies 100% of a core after switching tabs.
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] bgo #782633 - Scintilla editor occupies 100% of a core after switching tabs.
- Date: Thu, 25 May 2017 15:51:21 +0000 (UTC)
commit 28aa0540d261bae253f82f53d24754662fc53307
Author: Sébastien Granjoux <seb sfo free fr>
Date: Thu May 25 16:11:17 2017 +0200
bgo #782633 - Scintilla editor occupies 100% of a core after switching tabs.
plugins/document-manager/search-box.c | 49 +++++++++++++++++---------------
1 files changed, 26 insertions(+), 23 deletions(-)
---
diff --git a/plugins/document-manager/search-box.c b/plugins/document-manager/search-box.c
index 15a12a3..0349b27 100644
--- a/plugins/document-manager/search-box.c
+++ b/plugins/document-manager/search-box.c
@@ -582,38 +582,41 @@ highlight_in_background (SearchBox *search_box)
{
gboolean found = FALSE;
- GTimer *timer = g_timer_new();
if (search_box->priv->start_highlight != NULL)
{
const gchar* search_text = gtk_entry_get_text (GTK_ENTRY (search_box->priv->search_entry));
+ GTimer *timer = g_timer_new();
- do
+ if (*search_text != '\0')
{
- IAnjutaEditorCell* result_start;
- IAnjutaEditorCell* result_end;
-
- found = editor_search (search_box->priv->current_editor,
- search_text,
- search_box->priv->case_sensitive,
- TRUE,
- search_box->priv->regex_mode,
- search_box->priv->start_highlight,
- search_box->priv->end_highlight,
- &result_start,
- &result_end);
- if (found)
+ do
{
- ianjuta_indicable_set(IANJUTA_INDICABLE(search_box->priv->current_editor),
- IANJUTA_ITERABLE (result_start),
- IANJUTA_ITERABLE (result_end),
- IANJUTA_INDICABLE_IMPORTANT, NULL);
- g_object_unref (result_start);
- g_object_unref (search_box->priv->start_highlight);
- search_box->priv->start_highlight = result_end;
+ IAnjutaEditorCell* result_start;
+ IAnjutaEditorCell* result_end;
+
+ found = editor_search (search_box->priv->current_editor,
+ search_text,
+ search_box->priv->case_sensitive,
+ TRUE,
+ search_box->priv->regex_mode,
+ search_box->priv->start_highlight,
+ search_box->priv->end_highlight,
+ &result_start,
+ &result_end);
+ if (found)
+ {
+
ianjuta_indicable_set(IANJUTA_INDICABLE(search_box->priv->current_editor),
+ IANJUTA_ITERABLE (result_start),
+ IANJUTA_ITERABLE (result_end),
+ IANJUTA_INDICABLE_IMPORTANT, NULL);
+ g_object_unref (result_start);
+ g_object_unref (search_box->priv->start_highlight);
+ search_box->priv->start_highlight = result_end;
+ }
}
+ while (found && g_timer_elapsed(timer, NULL) < CONTINUOUS_SEARCH_TIMEOUT);
}
- while (found && g_timer_elapsed(timer, NULL) < CONTINUOUS_SEARCH_TIMEOUT);
g_timer_destroy (timer);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]