selection handling - donmt use null string selections if they are

fix a corner case where string selection is null when selection is
requested (empty selection). @fix
This commit is contained in:
Carsten Haitzler 2018-04-05 01:23:08 +09:00
parent c87c78ca8c
commit 0f24619dfa
1 changed files with 9 additions and 5 deletions

View File

@ -2236,11 +2236,14 @@ _lost_selection_reset_job(void *data)
EINA_SAFETY_ON_NULL_RETURN(sd); EINA_SAFETY_ON_NULL_RETURN(sd);
sd->sel_reset_job = NULL; sd->sel_reset_job = NULL;
elm_cnp_selection_set(sd->win, sd->sel_type, if (sd->sel_str)
ELM_SEL_FORMAT_TEXT, {
sd->sel_str, strlen(sd->sel_str)); elm_cnp_selection_set(sd->win, sd->sel_type,
elm_cnp_selection_loss_callback_set(sd->win, sd->sel_type, ELM_SEL_FORMAT_TEXT,
_lost_selection, data); sd->sel_str, strlen(sd->sel_str));
elm_cnp_selection_loss_callback_set(sd->win, sd->sel_type,
_lost_selection, data);
}
} }
static void static void
@ -2249,6 +2252,7 @@ _lost_selection(void *data, Elm_Sel_Type selection)
Eina_List *l; Eina_List *l;
Evas_Object *obj; Evas_Object *obj;
double t = ecore_time_get(); double t = ecore_time_get();
EINA_LIST_FOREACH(terms, l, obj) EINA_LIST_FOREACH(terms, l, obj)
{ {
Termio *sd = evas_object_smart_data_get(obj); Termio *sd = evas_object_smart_data_get(obj);