ecore-wl2: do not offer a null mime first in ecore_wl2_offer_mimes_set()
authorMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 12 May 2017 16:08:32 +0000 (12:08 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 12 May 2017 16:08:25 +0000 (12:08 -0400)
this seems to have been done to account for the case where no mimes were
passed, but sending null in this way is bad behavior for a client. the
spec indicates that null should be sent only when no mimes are accepted

@fix

src/lib/ecore_wl2/ecore_wl2_dnd.c

index 830ca4e..76e1459 100644 (file)
@@ -738,9 +738,10 @@ ecore_wl2_offer_mimes_set(Ecore_Wl2_Offer *offer, Eina_Array *mimes)
 {
    EINA_SAFETY_ON_NULL_RETURN(offer);
 
-   wl_data_offer_accept(offer->offer, offer->serial, NULL);
    if (mimes)
      eina_array_foreach(mimes, _emit_mime, offer);
+   else
+     wl_data_offer_accept(offer->offer, offer->serial, NULL);
 }
 
 typedef struct {