summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserwidget.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-06-27 01:23:16 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-07-04 00:29:24 -0400
commite0b81faadee8e1d1d9092e3ef47c4beb7f5a341d (patch)
tree64062e2148ba7204e9a07320b70c31e7a8c27fee /gtk/gtkfilechooserwidget.c
parent0f9b87cfeb77e9fb9b9d3511dcf8c6bf6ea86e4e (diff)
downloadgtk+-e0b81faadee8e1d1d9092e3ef47c4beb7f5a341d.tar.gz
file chooser: Make Escape work in search entry
Arrange things so that hitting Escape during a running search stops the search, but leaves the search results around, and hitting Escape again leaves the search mode.
Diffstat (limited to 'gtk/gtkfilechooserwidget.c')
-rw-r--r--gtk/gtkfilechooserwidget.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 05393cabcb..1c24421883 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -6283,8 +6283,6 @@ search_engine_error_cb (GtkSearchEngine *engine,
search_stop_searching (impl, TRUE);
error_message (impl, _("Could not send the search request"), message);
-
- set_busy_cursor (impl, FALSE);
}
/* Frees the data in the search_model */
@@ -6323,6 +6321,7 @@ search_stop_searching (GtkFileChooserWidget *impl,
g_signal_handlers_disconnect_by_data (priv->search_engine, impl);
g_object_unref (priv->search_engine);
priv->search_engine = NULL;
+ set_busy_cursor (impl, FALSE);
}
}
@@ -6444,7 +6443,10 @@ search_entry_activate_cb (GtkFileChooserWidget *impl)
static void
search_entry_stop_cb (GtkFileChooserWidget *impl)
{
- g_object_set (impl, "search-mode", FALSE, NULL);
+ if (impl->priv->search_engine)
+ search_stop_searching (impl, FALSE);
+ else
+ g_object_set (impl, "search-mode", FALSE, NULL);
}
/* Hides the path bar and creates the search entry */