summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2021-08-12 17:32:59 +0100
committerAntónio Fernandes <antoniojpfernandes@gmail.com>2021-12-22 01:38:47 +0000
commit8cc9209e38aa55abfd75374abf6c0c13dbf3733f (patch)
treed30c2092b10bdb9bc00fa40c339edfefedd8fd49
parent41ee24721ef2ccfeca877e2e3801c37e602660c0 (diff)
downloadnautilus-8cc9209e38aa55abfd75374abf6c0c13dbf3733f.tar.gz
window-slot: Don't forward Escape and BackSpace
Unless it is already visible. This fixes a regression caused by the previous commit. Making it a separate commit because I'm not sure why this is needed now if it wasn't before.
-rw-r--r--src/nautilus-window-slot.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 2fa7c9557..52389641d 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -620,15 +620,21 @@ nautilus_window_slot_handle_event (NautilusWindowSlot *self,
action = g_action_map_lookup_action (G_ACTION_MAP (self->slot_action_group),
"search-visible");
- if (keyval == GDK_KEY_Escape)
+ if (keyval == GDK_KEY_Escape ||
+ keyval == GDK_KEY_BackSpace)
{
g_autoptr (GVariant) action_state = NULL;
action_state = g_action_get_state (action);
- if (g_variant_get_boolean (action_state))
+ if (!g_variant_get_boolean (action_state))
+ {
+ return GDK_EVENT_PROPAGATE;
+ }
+ else if (keyval == GDK_KEY_Escape)
{
nautilus_window_slot_set_search_visible (self, FALSE);
+ return GDK_EVENT_STOP;
}
}