ctxpopup: sd->box null check and event_flag set for previous and next focus move.
authorJaeun Choi <jaeun12.choi@samsung.com>
Thu, 17 Apr 2014 06:23:00 +0000 (15:23 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Thu, 17 Apr 2014 06:23:00 +0000 (15:23 +0900)
Summary:
The original code was missing
- null check of sd->box
- event_flag value set
for previous and next focus move.
@fix

Test Plan: None

Reviewers: raster, seoz, Hermet

Differential Revision: https://phab.enlightenment.org/D753

legacy/elementary/src/lib/elc_ctxpopup.c

index 0812098..5dffe28 100644 (file)
@@ -103,18 +103,16 @@ _elc_ctxpopup_elm_widget_event(Eo *obj, Elc_Ctxpopup_Data *sd, Evas_Object *src,
    if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
 
-   if (!strcmp(ev->key, "Tab"))
-     {
-        if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
-          elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
-        else
-          elm_widget_focus_cycle(sd->box, ELM_FOCUS_NEXT);
-        return EINA_TRUE;
-     }
-
    if (sd->box)
      {
-        if ((!strcmp(ev->key, "Left")) ||
+        if (!strcmp(ev->key, "Tab"))
+          {
+             if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
+               elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
+             else
+               elm_widget_focus_cycle(sd->box, ELM_FOCUS_NEXT);
+          }
+        else if ((!strcmp(ev->key, "Left")) ||
             ((!strcmp(ev->key, "KP_Left")) && (!ev->string)))
           elm_widget_focus_cycle(sd->box, ELM_FOCUS_LEFT);
         else if ((!strcmp(ev->key, "Right")) ||