diff -Nru gedit-3.28.1/debian/changelog gedit-3.28.1/debian/changelog --- gedit-3.28.1/debian/changelog 2018-12-17 15:49:11.000000000 +0000 +++ gedit-3.28.1/debian/changelog 2019-04-11 14:25:57.000000000 +0000 @@ -1,3 +1,11 @@ +gedit (3.28.1-1ubuntu1.2) bionic; 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 Thu, 11 Apr 2019 16:25:40 +0200 + gedit (3.28.1-1ubuntu1.1) bionic; urgency=medium * debian/patches/document-selector-make-search-caseless.patch diff -Nru gedit-3.28.1/debian/patches/gitlab_idle_handling.patch gedit-3.28.1/debian/patches/gitlab_idle_handling.patch --- gedit-3.28.1/debian/patches/gitlab_idle_handling.patch 1970-01-01 00:00:00.000000000 +0000 +++ gedit-3.28.1/debian/patches/gitlab_idle_handling.patch 2019-04-11 14:24:25.000000000 +0000 @@ -0,0 +1,102 @@ +From e0c78486c5b7ac198bb1a76872225063f5944f4c Mon Sep 17 00:00:00 2001 +From: Andrea Azzarone +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(-) + +Index: gedit-3.30.2/gedit/gedit-open-document-selector.c +=================================================================== +--- gedit-3.30.2.orig/gedit/gedit-open-document-selector.c ++++ gedit-3.30.2/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; +@@ -65,9 +67,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 +@@ -534,7 +533,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 +@@ -602,33 +600,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 +@@ -734,12 +722,10 @@ gedit_open_document_selector_dispose (GO + { + 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); diff -Nru gedit-3.28.1/debian/patches/series gedit-3.28.1/debian/patches/series --- gedit-3.28.1/debian/patches/series 2018-12-17 15:45:05.000000000 +0000 +++ gedit-3.28.1/debian/patches/series 2019-04-11 14:26:11.000000000 +0000 @@ -2,3 +2,4 @@ 03_no_gnu_gettext.patch 08_multiarch_fallback.patch document-selector-make-search-caseless.patch +gitlab_idle_handling.patch