From 3bcd30f9a280202b1f35820b67c83bc701a8b084 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 13 Feb 2019 15:29:00 +0900 Subject: [PATCH] Add back key no grab mode using environment variable Change-Id: I459b432558ef612f4526fa611b0b3a424cb16f5d Signed-off-by: Jihoon Kim --- ism/extras/wayland_immodule/wayland_imcontext.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index ce5f2df..ba55a48 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -794,6 +794,17 @@ _ecore_event_to_ecore_imf_key_up_event(Ecore_Event_Key *ecore_event, Ecore_IMF_E imf_event->locks = _ecore_key_modifiers_to_ecore_imf_locks(ecore_event->modifiers); } +static Eina_Bool check_nograb_backkey() +{ + char *nograb_backkey = getenv ("ISF_KEY_NOGRAB_BACKKEY"); + if (nograb_backkey) { + if (atoi (nograb_backkey) != 0) + return EINA_TRUE; /* the event is kept */ + } + + return EINA_FALSE; +} + static Eina_Bool key_down_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { @@ -804,6 +815,8 @@ key_down_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) if (!active_ctx) return EINA_TRUE; /* the event is kept */ + if (check_nograb_backkey()) return EINA_TRUE; /* the event is kept */ + if ((_input_panel_state == ECORE_IMF_INPUT_PANEL_STATE_SHOW || _input_panel_state == ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW) && check_hide_key(ev->keyname)) { @@ -836,6 +849,8 @@ key_up_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) if (!active_ctx) return EINA_TRUE; /* the event is kept */ + if (check_nograb_backkey()) return EINA_TRUE; /* the event is kept */ + if (_input_panel_state == ECORE_IMF_INPUT_PANEL_STATE_HIDE || !check_hide_key(ev->keyname)) return EINA_TRUE; /* the event is kept */ -- 2.7.4