discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=6929256a472bc5113c7128e24d909585a33e091c

commit 6929256a472bc5113c7128e24d909585a33e091c
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu Aug 13 14:51:17 2015 -0400

    cnp: fix wayland drop format selection
    
    previously the drop format was chosen in a manner unrelated to what
    the offered format was, leading to applications receiving either the correct
    data with the wrong format, the wrong data with the wrong format, or
    the wrong data with the correct format. by comparing the drop handler
    types with the offered type and ensuring that there is a match, the
    correctness of the format that the application receives is more reliable
    
    @fix
---
 src/lib/elm_cnp.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index 98835b6..1bb657a 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -3240,17 +3240,15 @@ _wl_dropable_data_handle(Wl_Cnp_Selection *sel, char 
*data)
         Dropable_Cbs *cbs;
         EINA_INLIST_FOREACH_SAFE(drop->cbs_list, itr, cbs)
           {
-             if (cbs->types && drop->last.format)
+             if (cbs->types & drop->last.format)
                {
-                  /* If it's markup that also supports images */
-                  if (cbs->types & (ELM_SEL_FORMAT_MARKUP | 
ELM_SEL_FORMAT_IMAGE))
+                  if ((cbs->types & ELM_SEL_FORMAT_IMAGE) && 
(drop->last.format & ELM_SEL_FORMAT_IMAGE))
                     {
-                       sdata.format = ELM_SEL_FORMAT_MARKUP;
-                       sdata.data = (char *)savedtypes.imgfile;
-                    }
-                  else if (cbs->types & ELM_SEL_FORMAT_IMAGE)
-                    {
-                       sdata.format = ELM_SEL_FORMAT_IMAGE;
+                       /* If it's markup that also supports images */
+                       if ((cbs->types & ELM_SEL_FORMAT_MARKUP) && 
(drop->last.format & ELM_SEL_FORMAT_MARKUP))
+                         sdata.format = ELM_SEL_FORMAT_MARKUP;
+                       else
+                         sdata.format = ELM_SEL_FORMAT_IMAGE;
                        sdata.data = (char *)savedtypes.imgfile;
                     }
                   else

-- 


Reply via email to