summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnestas Kulik <ernestask@gnome.org>2017-08-23 16:02:42 +0300
committerErnestas Kulik <ernestask@gnome.org>2017-08-23 17:09:41 +0300
commit3bed0e62439af8970d79150fcfceba6210702629 (patch)
treee184cd437d987cef57743bd0d895e93fd8e22993
parentee9f23187ecb15438b6cc839de7e2d6e443a80ef (diff)
downloadnautilus-3bed0e62439af8970d79150fcfceba6210702629.tar.gz
window-slot: hide search bar on ESC presses
This supposedly regressed after some version of Nautilus. https://bugzilla.gnome.org/show_bug.cgi?id=685120
-rw-r--r--src/nautilus-window-slot.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 17aa99986..d364115a9 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -625,6 +625,18 @@ nautilus_window_slot_handle_event (NautilusWindowSlot *self,
action = g_action_map_lookup_action (G_ACTION_MAP (priv->slot_action_group),
"search-visible");
+ if (event->keyval == GDK_KEY_Escape)
+ {
+ g_autoptr (GVariant) state = NULL;
+
+ state = g_action_get_state (action);
+
+ if (g_variant_get_boolean (state))
+ {
+ nautilus_window_slot_set_search_visible (self, FALSE);
+ }
+ }
+
/* If the action is not enabled, don't try to handle search */
if (g_action_get_enabled (action))
{