Commit 5c7e0663 authored by Sebastien Bacher's avatar Sebastien Bacher

* debian/oatches/gitlab_idle_handling.patch:

  - use gitlab pr#34's patch to fix an incorrect handling of idle
    callbacks, thanks Andrea Azzarone (lp: #1646762)
parent a235bef8
gedit (3.32.0-2) UNRELEASED; urgency=medium
* debian/oatches/gitlab_idle_handling.patch:
- use gitlab pr#34's patch to fix an incorrect handling of idle
callbacks, thanks Andrea Azzarone (lp: #1646762)
-- Sebastien Bacher <seb128@ubuntu.com> Wed, 03 Apr 2019 11:30:24 +0200
gedit (3.32.0-1) experimental; urgency=medium
* New upstream release
......
From e0c78486c5b7ac198bb1a76872225063f5944f4c Mon Sep 17 00:00:00 2001
From: Andrea Azzarone <andrea.azzarone@canonical.com>
Date: Tue, 2 Apr 2019 17:33:12 +0100
Subject: [PATCH] open-document-selector: Properly remove idle
It's not possible to use g_idle_remove_by_data when the idle was added with
gdk_threads_add_idle_full. gdk_threads_add_idle_full uses g_idle_add_full
internally but it creates a temporary data strucuture. The address of this
temporary data structure should be passed to g_idle_remove_by_data. For obvious
reasons we cannot do that, so let's use g_source_remove.
Close: https://bugs.launchpad.net/bugs/1646762
---
gedit/gedit-open-document-selector.c | 34 ++++++++--------------------
1 file changed, 10 insertions(+), 24 deletions(-)
diff --git a/gedit/gedit-open-document-selector.c b/gedit/gedit-open-document-selector.c
index 847807a51..67e2d4b39 100644
--- a/gedit/gedit-open-document-selector.c
+++ b/gedit/gedit-open-document-selector.c
@@ -51,6 +51,8 @@ struct _GeditOpenDocumentSelector
GtkWidget *placeholder_box;
GtkWidget *scrolled_window;
+ guint populate_listbox_id;
+
GdkRGBA name_label_color;
PangoFontDescription *name_font;
GdkRGBA path_label_color;
@@ -66,9 +68,6 @@ struct _GeditOpenDocumentSelector
GList *active_doc_dir_items;
GList *current_docs_items;
GList *all_items;
-
- guint populate_liststore_is_idle : 1;
- guint populate_scheduled : 1;
};
typedef enum
@@ -540,7 +539,6 @@ real_populate_liststore (gpointer data)
GList *filter_items = NULL;
gchar *filter;
GRegex *filter_regex = NULL;
- selector->populate_liststore_is_idle = FALSE;
DEBUG_SELECTOR_TIMER_DECL
DEBUG_SELECTOR_TIMER_NEW
@@ -608,33 +606,23 @@ real_populate_liststore (gpointer data)
selector, DEBUG_SELECTOR_TIMER_GET););
DEBUG_SELECTOR_TIMER_DESTROY
- if (selector->populate_scheduled)
- {
- selector->populate_scheduled = FALSE;
- return G_SOURCE_CONTINUE;
- }
- else
- {
- return G_SOURCE_REMOVE;
- }
+
+ selector->populate_listbox_id = 0;
+ return G_SOURCE_REMOVE;
}
static void
populate_liststore (GeditOpenDocumentSelector *selector)
{
/* Populate requests are compressed */
- if (selector->populate_liststore_is_idle)
+ if (selector->populate_listbox_id != 0)
{
DEBUG_SELECTOR (g_print ("Selector(%p): populate liststore: idle\n", selector););
-
- selector->populate_scheduled = TRUE;
return;
}
DEBUG_SELECTOR (g_print ("Selector(%p): populate liststore: scheduled\n", selector););
-
- selector->populate_liststore_is_idle = TRUE;
- gdk_threads_add_idle_full (G_PRIORITY_HIGH_IDLE + 30, real_populate_liststore, selector, NULL);
+ selector->populate_listbox_id = gdk_threads_add_idle_full (G_PRIORITY_HIGH_IDLE + 30, real_populate_liststore, selector, NULL);
}
static gboolean
@@ -740,12 +728,10 @@ gedit_open_document_selector_dispose (GObject *object)
{
GeditOpenDocumentSelector *selector = GEDIT_OPEN_DOCUMENT_SELECTOR (object);
- while (TRUE)
+ if (selector->populate_listbox_id)
{
- if (!g_idle_remove_by_data (selector))
- {
- break;
- }
+ g_source_remove (selector->populate_listbox_id);
+ selector->populate_listbox_id = 0;
}
g_clear_pointer (&selector->name_font, pango_font_description_free);
--
2.18.1
01_gedit-bugreport-location.patch
08_multiarch_fallback.patch
gitlab_idle_handling.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment