summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas/ecore_evas_fallback_selection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore_evas/ecore_evas_fallback_selection.c')
-rw-r--r--src/lib/ecore_evas/ecore_evas_fallback_selection.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_fallback_selection.c b/src/lib/ecore_evas/ecore_evas_fallback_selection.c
index b3f59c7921..1abdfa29cd 100644
--- a/src/lib/ecore_evas/ecore_evas_fallback_selection.c
+++ b/src/lib/ecore_evas/ecore_evas_fallback_selection.c
@@ -56,22 +56,18 @@ fallback_selection_has_owner(Ecore_Evas *ee EINA_UNUSED, unsigned int seat EINA_
56Eina_Stringshare* 56Eina_Stringshare*
57available_types(Eina_Array *acceptable_types, Eina_Array *available_types) 57available_types(Eina_Array *acceptable_types, Eina_Array *available_types)
58{ 58{
59 unsigned int found_type_id = INT_MAX;
60 Eina_Stringshare *found_type = NULL; 59 Eina_Stringshare *found_type = NULL;
61 Eina_Stringshare *type; 60 Eina_Stringshare *type;
62 61
63 for (unsigned int i = 0; i < eina_array_count_get(acceptable_types); ++i) 62 for (unsigned int i = 0; i < eina_array_count_get(available_types); ++i)
64 { 63 {
65 unsigned int out = -1; 64 unsigned int out = -1;
65 type = eina_array_data_get(available_types, i);
66 66
67 type = eina_array_data_get(acceptable_types, i); 67 if (!found_type && eina_array_find(acceptable_types, type, &out))
68 68 {
69 if (!eina_array_find(available_types, type, &out)) 69 found_type = eina_stringshare_ref(type);
70 continue; 70 }
71 if (out >= found_type_id)
72 continue;
73 found_type_id = out;
74 found_type = type;
75 eina_stringshare_del(type); 71 eina_stringshare_del(type);
76 } 72 }
77 eina_array_free(acceptable_types); 73 eina_array_free(acceptable_types);