[gtksourceview] completion: protect against spinning while doing updates
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] completion: protect against spinning while doing updates
- Date: Sun, 12 Jun 2022 03:38:38 +0000 (UTC)
commit 64110c15c1c6238fee8d3cdd63f966b29d21f726
Author: Christian Hergert <chergert redhat com>
Date: Sat Jun 11 20:35:27 2022 -0700
completion: protect against spinning while doing updates
This turns out to happen more than anticipated, and could cause us to get
into a situation where we loose allocations on the source view.
gtksourceview/gtksourcecompletionlistbox.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/gtksourceview/gtksourcecompletionlistbox.c b/gtksourceview/gtksourcecompletionlistbox.c
index 02600900..d685819d 100644
--- a/gtksourceview/gtksourcecompletionlistbox.c
+++ b/gtksourceview/gtksourcecompletionlistbox.c
@@ -903,8 +903,20 @@ gtk_source_completion_list_box_update_cb (GtkWidget *widget,
g_assert (GTK_SOURCE_IS_COMPLETION_LIST_BOX (self));
- gtk_source_completion_list_box_do_update (self, TRUE);
self->queued_update = 0;
+
+ gtk_source_completion_list_box_do_update (self, TRUE);
+
+ /* There is a chance that the update sequence could cause us to need
+ * to queue another update. But we don't actually need it. Just cancel
+ * any additional request immediately.
+ */
+ if (self->queued_update != 0)
+ {
+ gtk_widget_remove_tick_callback (GTK_WIDGET (self), self->queued_update);
+ self->queued_update = 0;
+ }
+
return G_SOURCE_REMOVE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]