From a5a00eb63d01a8d1d6325ee31250ccbc7fb666b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Mon, 18 Apr 2022 14:46:54 +0000 Subject: [PATCH] filechooserwidget: Accept entered path in SELECT_FOLDER mode In GTK 3 there was a bug causing the location entry to be cleared when changed, as explained in the commit message of c99935a54076ab4fcc2349530f21b6315db9f87e But not reacting at all to changes in the entry, means that the default action button in GtkFileChooserDialog doesn't become sensitive when a valid folder path is entered. This can be resolved by removing the condition introduced by the commit mentioned earlier, and doing so doesn't reintroduce the bug that the condition used to avoid. Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4854 --- gtk/gtkfilechooserwidget.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index b365204d88..517f34441e 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -2225,17 +2225,14 @@ location_entry_changed_cb (GtkEditable *editable, switch_to_home_dir (impl); } - if (impl->action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) - { - /* Reset location timeout */ - if (impl->location_changed_id > 0) - g_source_remove (impl->location_changed_id); + /* Reset location timeout */ + if (impl->location_changed_id > 0) + g_source_remove (impl->location_changed_id); - impl->location_changed_id = g_timeout_add (LOCATION_CHANGED_TIMEOUT, - location_changed_timeout_cb, - impl); - gdk_source_set_static_name_by_id (impl->location_changed_id, "[gtk] location_changed_timeout_cb"); - } + impl->location_changed_id = g_timeout_add (LOCATION_CHANGED_TIMEOUT, + location_changed_timeout_cb, + impl); + gdk_source_set_static_name_by_id (impl->location_changed_id, "[gtk] location_changed_timeout_cb"); } static void