Fix key down event callback 09/84109/3
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 16 Aug 2016 22:40:22 +0000 (07:40 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 16 Aug 2016 23:13:09 +0000 (08:13 +0900)
Change-Id: Idfcee0112c85a1bb9c14597710f887b3c4eff4cd
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
syspopup/syspopup_efl.c
syspopup/syspopup_wayland.c
syspopup/syspopup_x.c

index 14c23bd..2d2ceb7 100755 (executable)
@@ -38,15 +38,18 @@ static Eina_Bool __keydown_cb(void *data, int type, void *event)
 {
        int id = (int)((intptr_t)data);
        Ecore_Event_Key *ev = event;
+       int ret;
 
        if (ev == NULL)
                return ECORE_CALLBACK_DONE;
 
 #if defined(X11)
-       x_syspopup_process_keypress(id, ev->keyname);
+       ret = x_syspopup_process_keypress(id, ev->keyname);
 #elif defined(WAYLAND)
-       wl_syspopup_process_keypress(id, ev->keyname);
+       ret = wl_syspopup_process_keypress(id, ev->keyname);
 #endif
+       if (ret < 0)
+               return ECORE_CALLBACK_PASS_ON;
 
        return ECORE_CALLBACK_DONE;
 }
@@ -104,8 +107,10 @@ int syspopup_efl_create(const char *popup_name, bundle *b, Evas_Object *parent,
 #endif
 
        _syspopup_reset_timeout(sp, info);
-       ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, __keydown_cb,
+       if (sp->endkey_act != SYSPOPUP_KEYEND_IGNORE) {
+               ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, __keydown_cb,
                                        (const void *)((intptr_t)sp->id));
+       }
 
        _syspopup_info_free(info);
 
index fcfe26e..2d1f4cb 100644 (file)
@@ -167,16 +167,16 @@ int wl_syspopup_process_keypress(int id, const char *keyname)
        syspopup *sp;
 
        if (keyname == NULL)
-               return 0;
+               return -1;
 
        _D("key press - %s", keyname);
 
        if (strcmp(keyname, KEY_END) != 0)
-               return 0;
+               return -1;
 
        sp = _syspopup_find_by_id(id);
        if (sp == NULL)
-               return 0;
+               return -1;
 
        _D("find key down - %s", sp->name);
        if (sp->endkey_act == SYSPOPUP_KEYEND_TERM) {
index 6ec9702..2775385 100644 (file)
@@ -335,16 +335,16 @@ int x_syspopup_process_keypress(int id, const char *keyname)
        syspopup *sp = NULL;
 
        if (keyname == NULL)
-               return 0;
+               return -1;
 
        _D("key press - %s", keyname);
 
        if (strcmp(keyname, KEY_END) != 0)
-               return 0;
+               return -1;
 
        sp = _syspopup_find_by_id(id);
        if (sp == NULL)
-               return 0;
+               return -1;
 
        dpy = XOpenDisplay(NULL);