summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2015-11-18 19:39:13 +0900
committerSangHyeon Lee <sh10233.lee@samsung.com>2015-11-18 19:39:13 +0900
commitdf93efe12322fcc10d63cc700062ed398dca9bef (patch)
tree6f1d417edcd8e12d583dd7e7bde6552655af6871
parentc63d91aa6dab37e29ccfa4a6e61348378f196e4c (diff)
gengrid: Prevent duplicated selected function calls when item is unselected in the function.
Summary: If item is unselected in a selected function, selected function will be called once more from _elm_gengrid_elm_widget_on_focus. It is happened when elm_gengrid object has no focus and one of item is selected by mouse up event. To fix this issue, we need to set focus to item and keep the address of selected item before calling selected function. @fix Test Plan: 1. Install & Run efbb (Escape From Booty Bay: https://git.enlightenment.org/games/efbb.git/) 2. Select a level in the main menu. (It is using elm_gengrid). 3. See duplicated target images. Reviewers: cedric, SanghyeonLee Reviewed By: SanghyeonLee Differential Revision: https://phab.enlightenment.org/D3323
-rw-r--r--src/lib/elm_gengrid.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index ce189120a..1b6f0b432 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -4125,13 +4125,16 @@ _item_select(Elm_Gen_Item *it)
4125 evas_object_ref(obj); 4125 evas_object_ref(obj);
4126 it->walking++; 4126 it->walking++;
4127 sd->walking++; 4127 sd->walking++;
4128
4129 elm_object_item_focus_set(eo_it, EINA_TRUE);
4130 sd->last_selected_item = eo_it;
4131
4128 if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), eo_it); 4132 if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), eo_it);
4129 if (it->generation == sd->generation) 4133 if (it->generation == sd->generation)
4130 { 4134 {
4131 eo_do(WIDGET(it), eo_event_callback_call(EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, eo_it)); 4135 eo_do(WIDGET(it), eo_event_callback_call(EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, eo_it));
4132 if (_elm_config->atspi_mode) 4136 if (_elm_config->atspi_mode)
4133 elm_interface_atspi_accessible_state_changed_signal_emit(eo_it, ELM_ATSPI_STATE_SELECTED, EINA_TRUE); 4137 elm_interface_atspi_accessible_state_changed_signal_emit(eo_it, ELM_ATSPI_STATE_SELECTED, EINA_TRUE);
4134 elm_object_item_focus_set(eo_it, EINA_TRUE);
4135 } 4138 }
4136 4139
4137 it->walking--; 4140 it->walking--;
@@ -4144,9 +4147,8 @@ _item_select(Elm_Gen_Item *it)
4144 { 4147 {
4145 it->del_cb(it); 4148 it->del_cb(it);
4146 eo_del(eo_it); 4149 eo_del(eo_it);
4150 sd->last_selected_item = NULL;
4147 } 4151 }
4148 else
4149 sd->last_selected_item = eo_it;
4150 } 4152 }
4151 evas_object_unref(obj); 4153 evas_object_unref(obj);
4152} 4154}