Selection manager: properly clean in drop_target_del

Summary:
The last lines in _efl_selection_manager_drop_target_del were skipped
when `!pd->drop_list` was met. These lines clear the selection event
handlers. Thus, events kept firing and causing erratic behavior.

Fixes T7130

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7130

Differential Revision: https://phab.enlightenment.org/D6579
This commit is contained in:
Daniel Hirt 2018-07-12 18:16:03 +03:00
parent 92820dbb88
commit e9925e609f
1 changed files with 13 additions and 11 deletions

View File

@ -4988,22 +4988,24 @@ _efl_selection_manager_drop_target_del(Eo *obj EINA_UNUSED, Efl_Selection_Manage
}
}
if (!pd->drop_list) return;
#ifdef HAVE_ELEMENTARY_X
Eina_List *l;
Ecore_X_Window xwin;
Eina_Bool have_drop_list = EINA_FALSE;
xwin = _x11_xwin_get(target_obj);
EINA_LIST_FOREACH(pd->drop_list, l, dropable)
if (pd->drop_list)
{
if (xwin == _x11_xwin_get(dropable->obj))
Eina_List *l;
Ecore_X_Window xwin;
Eina_Bool have_drop_list = EINA_FALSE;
xwin = _x11_xwin_get(target_obj);
EINA_LIST_FOREACH(pd->drop_list, l, dropable)
{
have_drop_list = EINA_TRUE;
break;
if (xwin == _x11_xwin_get(dropable->obj))
{
have_drop_list = EINA_TRUE;
break;
}
}
if (!have_drop_list) ecore_x_dnd_aware_set(xwin, EINA_FALSE);
}
if (!have_drop_list) ecore_x_dnd_aware_set(xwin, EINA_FALSE);
#endif
seat_sel = _sel_manager_seat_selection_init(pd, seat);
ELM_SAFE_FREE(seat_sel->pos_handler, ecore_event_handler_del);