diff -Nru gedit-3.28.1/debian/changelog gedit-3.28.1/debian/changelog --- gedit-3.28.1/debian/changelog 2018-04-13 17:26:00.000000000 +0000 +++ gedit-3.28.1/debian/changelog 2019-04-11 14:25:57.000000000 +0000 @@ -1,3 +1,19 @@ +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 + - 'document selector: make search caseless', it makes the filter in + the open document dialog work in a more logical way (lp: #1800179) + + -- Sebastien Bacher Mon, 17 Dec 2018 16:46:15 +0100 + gedit (3.28.1-1ubuntu1) bionic; urgency=medium * Sync with Debian. Remaining change: diff -Nru gedit-3.28.1/debian/patches/document-selector-make-search-caseless.patch gedit-3.28.1/debian/patches/document-selector-make-search-caseless.patch --- gedit-3.28.1/debian/patches/document-selector-make-search-caseless.patch 1970-01-01 00:00:00.000000000 +0000 +++ gedit-3.28.1/debian/patches/document-selector-make-search-caseless.patch 2018-12-17 15:46:05.000000000 +0000 @@ -0,0 +1,74 @@ +From: Sebastien Lafargue +Date: Mon, 19 Nov 2018 19:46:56 +0100 +Subject: document selector: make search caseless + +(cherry picked from commit a622fda63726adaabd02fa0c1786b75a921b1973) +--- + gedit/gedit-open-document-selector.c | 36 ++++++++++++++++++++++++++++++------ + 1 file changed, 30 insertions(+), 6 deletions(-) + +diff --git a/gedit/gedit-open-document-selector.c b/gedit/gedit-open-document-selector.c +index 5389ef0..3e3d9a2 100644 +--- a/gedit/gedit-open-document-selector.c ++++ b/gedit/gedit-open-document-selector.c +@@ -436,6 +436,23 @@ fileitem_setup (FileItem *item) + return candidate; + } + ++static inline gboolean ++is_filter_in_candidate (const gchar *candidate, ++ const gchar *filter) ++{ ++ gchar *candidate_fold; ++ gboolean ret; ++ ++ g_assert (candidate != NULL); ++ g_assert (filter != NULL); ++ ++ candidate_fold = g_utf8_casefold (candidate, -1); ++ ret = (strstr (candidate_fold, filter) != NULL); ++ ++ g_free (candidate_fold); ++ return ret; ++} ++ + /* If filter == NULL then items are + * not checked against the filter. + */ +@@ -445,6 +462,10 @@ fileitem_list_filter (GList *items, + { + GList *new_items = NULL; + GList *l; ++ gchar *filter_fold = NULL; ++ ++ if (filter != NULL) ++ filter_fold = g_utf8_casefold (filter, -1); + + for (l = items; l != NULL; l = l->next) + { +@@ -453,16 +474,19 @@ fileitem_list_filter (GList *items, + + item = l->data; + candidate = fileitem_setup (item); +- +- if (candidate && (filter == NULL || strstr (candidate, filter))) ++ if (candidate != NULL) + { +- new_items = g_list_prepend (new_items, +- gedit_open_document_selector_copy_fileitem_item (item)); +- } ++ if (filter == NULL || is_filter_in_candidate (candidate, filter_fold)) ++ { ++ new_items = g_list_prepend (new_items, ++ gedit_open_document_selector_copy_fileitem_item (item)); ++ } + +- g_free (candidate); ++ g_free (candidate); ++ } + } + ++ g_free (filter_fold); + new_items = g_list_reverse (new_items); + return new_items; + } 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-04-13 17:26:00.000000000 +0000 +++ gedit-3.28.1/debian/patches/series 2019-04-11 14:26:11.000000000 +0000 @@ -1,3 +1,5 @@ 01_gedit-bugreport-location.patch 03_no_gnu_gettext.patch 08_multiarch_fallback.patch +document-selector-make-search-caseless.patch +gitlab_idle_handling.patch