hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=d2180b235f836ef6b72e3bc21c22fae04ff409d1

commit d2180b235f836ef6b72e3bc21c22fae04ff409d1
Author: ChunEon Park <her...@hermet.pe.kr>
Date:   Thu Aug 27 13:03:54 2015 +0900

    fix broken key input in search/goto
    
    This issue was introduced in 502a8265992b18687b81a6ff8505e6b5d91836de.
    
    Acutally, here is an additional keygrab change.
---
 src/bin/goto.c   | 16 ++++++++++++++++
 src/bin/main.c   | 12 ------------
 src/bin/search.c | 16 ++++++++++++++++
 3 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/src/bin/goto.c b/src/bin/goto.c
index 1c624e7..246c755 100644
--- a/src/bin/goto.c
+++ b/src/bin/goto.c
@@ -84,6 +84,14 @@ btn_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
    goto_line(gd);
 }
 
+static void
+keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
+                       Evas_Object *obj  EINA_UNUSED,
+                       void *event_info EINA_UNUSED)
+{
+   goto_close();
+}
+
 void
 goto_open(Evas_Object *enventor)
 {
@@ -162,6 +170,14 @@ goto_open(Evas_Object *enventor)
                                btn);
    evas_object_show(win);
 
+   //Keygrabber
+   Evas_Object *keygrabber =
+      evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_event_callback_add(keygrabber, EVAS_CALLBACK_KEY_DOWN,
+                                  keygrabber_key_down_cb, gd);
+   if (!evas_object_key_grab(keygrabber, "Escape", 0, 0, EINA_TRUE))
+     EINA_LOG_ERR("Failed to grab key - Escape");
+
    tools_goto_update(enventor, EINA_FALSE);
 
    gd->win = win;
diff --git a/src/bin/main.c b/src/bin/main.c
index 74ba7bb..45f30ea 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -699,18 +699,6 @@ keygrabber_key_down_cb(void *data, Evas *e EINA_UNUSED,
    //Main Menu
    if (!strcmp(ev->key, "Escape"))
      {
-        if (goto_is_opened())
-          {
-             goto_close();
-             enventor_object_focus_set(ad->enventor, EINA_TRUE);
-             return;
-          }
-        if (search_is_opened())
-          {
-             search_close();
-             enventor_object_focus_set(ad->enventor, EINA_TRUE);
-             return;
-          }
         if (live_edit_get())
           {
              live_edit_cancel();
diff --git a/src/bin/search.c b/src/bin/search.c
index cb9e4b4..1450093 100644
--- a/src/bin/search.c
+++ b/src/bin/search.c
@@ -305,6 +305,14 @@ win_unfocused_cb(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED,
    sd->syntax_color--;
 }
 
+static void
+keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
+                       Evas_Object *obj  EINA_UNUSED,
+                       void *event_info EINA_UNUSED)
+{
+   search_close();
+}
+
 void
 search_open(Evas_Object *enventor)
 {
@@ -407,6 +415,14 @@ search_open(Evas_Object *enventor)
 
    tools_search_update(enventor, EINA_FALSE);
 
+   //Keygrabber
+   Evas_Object *keygrabber =
+      evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_event_callback_add(keygrabber, EVAS_CALLBACK_KEY_DOWN,
+                                  keygrabber_key_down_cb, sd);
+   if (!evas_object_key_grab(keygrabber, "Escape", 0, 0, EINA_TRUE))
+     EINA_LOG_ERR("Failed to grab key - Escape");
+
    sd->win = win;
    sd->enventor = enventor;
    sd->layout = layout;

-- 


Reply via email to