[nautilus] window-slot: hide search bar on ESC presses



commit 3bed0e62439af8970d79150fcfceba6210702629
Author: Ernestas Kulik <ernestask gnome org>
Date:   Wed Aug 23 16:02:42 2017 +0300

    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

 src/nautilus-window-slot.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 17aa999..d364115 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))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]