forked from enlightenment/efl
efl_ui_focus_manager: fix sub manager logical handling
This commit is contained in:
parent
a4616bb6fe
commit
924033e88a
|
@ -674,7 +674,7 @@ _efl_ui_focus_manager_unregister(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Data
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_ui_focus_manager_redirect_set(Eo *obj, Efl_Ui_Focus_Manager_Data *pd, Efl_Ui_Focus_Manager *redirect)
|
_efl_ui_focus_manager_redirect_set(Eo *obj, Efl_Ui_Focus_Manager_Data *pd, Efl_Ui_Focus_Manager *redirect)
|
||||||
{
|
{
|
||||||
printf("Now redirect %p\n", redirect);
|
Efl_Ui_Focus_Manager *old_manager;
|
||||||
|
|
||||||
if (pd->redirect == redirect) return;
|
if (pd->redirect == redirect) return;
|
||||||
|
|
||||||
|
@ -683,10 +683,13 @@ _efl_ui_focus_manager_redirect_set(Eo *obj, Efl_Ui_Focus_Manager_Data *pd, Efl_U
|
||||||
if (pd->redirect)
|
if (pd->redirect)
|
||||||
efl_wref_del(pd->redirect, &pd->redirect);
|
efl_wref_del(pd->redirect, &pd->redirect);
|
||||||
|
|
||||||
|
old_manager = pd->redirect;
|
||||||
pd->redirect = redirect;
|
pd->redirect = redirect;
|
||||||
|
|
||||||
if (pd->redirect)
|
if (pd->redirect)
|
||||||
efl_wref_add(pd->redirect, &pd->redirect);
|
efl_wref_add(pd->redirect, &pd->redirect);
|
||||||
|
|
||||||
|
efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED , old_manager);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Efl_Ui_Focus_Manager *
|
EOLIAN static Efl_Ui_Focus_Manager *
|
||||||
|
|
|
@ -73,7 +73,7 @@ _border_flush(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd)
|
||||||
|
|
||||||
elem = efl_parent_get(obj);
|
elem = efl_parent_get(obj);
|
||||||
manager = efl_ui_focus_user_manager_get(elem);
|
manager = efl_ui_focus_user_manager_get(elem);
|
||||||
logical = efl_ui_focus_user_parent_get(elem);
|
logical = elem;
|
||||||
borders = efl_ui_focus_manager_border_elements_get(obj);
|
borders = efl_ui_focus_manager_border_elements_get(obj);
|
||||||
|
|
||||||
selection = NULL;
|
selection = NULL;
|
||||||
|
@ -136,8 +136,18 @@ _parent_manager_pre_flush(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||||
_border_flush(data, pd);
|
_border_flush(data, pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_redirect_changed_cb(void *data, const Efl_Event *ev)
|
||||||
|
{
|
||||||
|
//if (efl_ui_focus_manager_redirect_get(ev->object) != data) return;
|
||||||
|
|
||||||
|
MY_DATA(data, pd);
|
||||||
|
_border_flush(data, pd);
|
||||||
|
}
|
||||||
|
|
||||||
EFL_CALLBACKS_ARRAY_DEFINE(parent_manager,
|
EFL_CALLBACKS_ARRAY_DEFINE(parent_manager,
|
||||||
{EFL_UI_FOCUS_MANAGER_EVENT_PRE_FLUSH, _parent_manager_pre_flush}
|
{EFL_UI_FOCUS_MANAGER_EVENT_PRE_FLUSH, _parent_manager_pre_flush},
|
||||||
|
{EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, _redirect_changed_cb}
|
||||||
);
|
);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -206,12 +216,14 @@ _efl_ui_focus_manager_sub_efl_object_parent_set(Eo *obj, Efl_Ui_Focus_Manager_Su
|
||||||
old_parent = efl_parent_get(obj);
|
old_parent = efl_parent_get(obj);
|
||||||
|
|
||||||
efl_event_callback_forwarder_del(obj, EFL_UI_FOCUS_MANAGER_EVENT_PRE_FLUSH, old_parent);
|
efl_event_callback_forwarder_del(obj, EFL_UI_FOCUS_MANAGER_EVENT_PRE_FLUSH, old_parent);
|
||||||
|
efl_event_callback_forwarder_del(obj, EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, old_parent);
|
||||||
efl_event_callback_array_del(old_parent, self_manager(), obj);
|
efl_event_callback_array_del(old_parent, self_manager(), obj);
|
||||||
|
|
||||||
efl_parent_set(efl_super(obj, MY_CLASS), parent);
|
efl_parent_set(efl_super(obj, MY_CLASS), parent);
|
||||||
|
|
||||||
new_parent = efl_parent_get(obj);
|
new_parent = efl_parent_get(obj);
|
||||||
efl_event_callback_forwarder_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_PRE_FLUSH, new_parent);
|
efl_event_callback_forwarder_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_PRE_FLUSH, new_parent);
|
||||||
|
efl_event_callback_forwarder_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, new_parent);
|
||||||
efl_event_callback_array_add(new_parent, self_manager(), obj);
|
efl_event_callback_array_add(new_parent, self_manager(), obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue