Compare commits

...

2 Commits

Author SHA1 Message Date
Marcel Hollerbach 1de0f8df08 ecore_evas: fix fallback code
this was using a stringshare reference that was deleted. While that is
true, the stringshare reference will always be alive, because 2 people
took a reference. Anyways, this code is now searching the other way
arround, which makes the code also easier.

CID1420331
2020-04-15 15:47:35 +02:00
Marcel Hollerbach dba78b8471 elm: add accidently removed API symbol
it seems that this was a public symbol, and should not be removed.
2020-04-15 15:33:36 +02:00
2 changed files with 12 additions and 10 deletions

View File

@ -56,22 +56,18 @@ fallback_selection_has_owner(Ecore_Evas *ee EINA_UNUSED, unsigned int seat EINA_
Eina_Stringshare* Eina_Stringshare*
available_types(Eina_Array *acceptable_types, Eina_Array *available_types) available_types(Eina_Array *acceptable_types, Eina_Array *available_types)
{ {
unsigned int found_type_id = INT_MAX;
Eina_Stringshare *found_type = NULL; Eina_Stringshare *found_type = NULL;
Eina_Stringshare *type; Eina_Stringshare *type;
for (unsigned int i = 0; i < eina_array_count_get(acceptable_types); ++i) for (unsigned int i = 0; i < eina_array_count_get(available_types); ++i)
{ {
unsigned int out = -1; unsigned int out = -1;
type = eina_array_data_get(available_types, i);
type = eina_array_data_get(acceptable_types, i); if (!found_type && eina_array_find(acceptable_types, type, &out))
{
if (!eina_array_find(available_types, type, &out)) found_type = eina_stringshare_ref(type);
continue; }
if (out >= found_type_id)
continue;
found_type_id = out;
found_type = type;
eina_stringshare_del(type); eina_stringshare_del(type);
} }
eina_array_free(acceptable_types); eina_array_free(acceptable_types);

View File

@ -126,6 +126,12 @@ elm_object_cnp_selection_clear(Evas_Object *obj,
return ecore_evas_selection_set(ee, _default_seat(obj), _elm_sel_type_to_ee_type(selection), NULL); return ecore_evas_selection_set(ee, _default_seat(obj), _elm_sel_type_to_ee_type(selection), NULL);
} }
EAPI Eina_Bool
elm_selection_selection_has_owner(Evas_Object *obj)
{
return elm_cnp_clipboard_selection_has_owner(obj);
}
EAPI Eina_Bool EAPI Eina_Bool
elm_cnp_clipboard_selection_has_owner(Evas_Object *obj) elm_cnp_clipboard_selection_has_owner(Evas_Object *obj)
{ {