[nautilus/wip/antoniof/gtk4-preparation-step-event-controllers: 2/5] window-slot: Don't forward Escape and BackSpace
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/gtk4-preparation-step-event-controllers: 2/5] window-slot: Don't forward Escape and BackSpace
- Date: Thu, 12 Aug 2021 17:24:06 +0000 (UTC)
commit bdc1f56b7deac1f64ce6f503882b82a47c776302
Author: António Fernandes <antoniof gnome org>
Date: Thu Aug 12 17:32:59 2021 +0100
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.
src/nautilus-window-slot.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 2a1c79e40..90ce55d23 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -619,13 +619,18 @@ 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]