[gnome-builder/gnome-builder-3-24] diagnostics: introduce delay when queing diagnose
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-24] diagnostics: introduce delay when queing diagnose
- Date: Tue, 4 Apr 2017 22:10:38 +0000 (UTC)
commit 7dadf09a58d5faddb88847245be99aee17cfc966
Author: Christian Hergert <chergert redhat com>
Date: Thu Mar 30 11:52:44 2017 -0600
diagnostics: introduce delay when queing diagnose
This should help a bit with situations where we immediately queue another
parse immediately after returning from a previous one.
In the future, we might want to instead do "penalizing" so that long
running diagnoses introduce more delay.
libide/diagnostics/ide-diagnostics-manager.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/libide/diagnostics/ide-diagnostics-manager.c b/libide/diagnostics/ide-diagnostics-manager.c
index 8daa421..5ae10d5 100644
--- a/libide/diagnostics/ide-diagnostics-manager.c
+++ b/libide/diagnostics/ide-diagnostics-manager.c
@@ -32,6 +32,8 @@
#include "diagnostics/ide-diagnostics-manager.h"
#include "plugins/ide-extension-set-adapter.h"
+#define DEFAULT_DIAGNOSE_DELAY 100
+
typedef struct
{
/*
@@ -523,11 +525,11 @@ ide_diagnostics_group_queue_diagnose (IdeDiagnosticsGroup *group,
group->needs_diagnose = TRUE;
if (group->in_diagnose == 0 && self->queued_diagnose_source == 0)
- self->queued_diagnose_source =
- gdk_threads_add_idle_full (G_PRIORITY_LOW,
- ide_diagnostics_manager_begin_diagnose,
- g_object_ref (self),
- g_object_unref);
+ self->queued_diagnose_source = g_timeout_add_full (G_PRIORITY_LOW,
+ DEFAULT_DIAGNOSE_DELAY,
+ ide_diagnostics_manager_begin_diagnose,
+ g_object_ref (self),
+ g_object_unref);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]