forked from enlightenment/efl
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
This commit is contained in:
parent
2ace38aba0
commit
3096e62408
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue