Bloody arc land! This commit is from Thiep Ha and not from me!

On 10/27/14 08:11, Daniel Zaoui wrote:
> jackdanielz pushed a commit to branch master.
>
> http://git.enlightenment.org/core/efl.git/commit/?id=0961dd92d9771e5fd50991ce4973d7ee0e94e6d8
>
> commit 0961dd92d9771e5fd50991ce4973d7ee0e94e6d8
> Author: Daniel Zaoui <[email protected]>
> Date:   Mon Oct 27 08:10:11 2014 +0200
>
>     dnd/x: fix type set for case there is no type list exists
>     
>     Summary:
>     DND does not work in X11 because we cannot set type.
>     The f8e036d5af3c99d74c3b0f4dcc612c4e0a949e00 causes this.
>     Since the xdnd type list does not exists at the beginning,
>     if we always return without setting new property, we cannot set dnd type.
>     This patch brings dnd work again by correcting the type set operation.
>     
>     @fix
>     
>     Test Plan: Try dnd tests in elementary_test.
>     
>     Reviewers: raster, woohyun, JackDanielZ
>     
>     Reviewed By: JackDanielZ
>     
>     Subscribers: cedric
>     
>     Differential Revision: https://phab.enlightenment.org/D1578
> ---
>  src/lib/ecore_x/xlib/ecore_x_dnd.c | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/src/lib/ecore_x/xlib/ecore_x_dnd.c 
> b/src/lib/ecore_x/xlib/ecore_x_dnd.c
> index cd2ec14..601c8ce 100644
> --- a/src/lib/ecore_x/xlib/ecore_x_dnd.c
> +++ b/src/lib/ecore_x/xlib/ecore_x_dnd.c
> @@ -261,18 +261,18 @@ ecore_x_dnd_type_set(Ecore_X_Window win,
>  
>     LOGFN(__FILE__, __LINE__, __FUNCTION__);
>     atom = ecore_x_atom_get(type);
> -   if (ecore_x_window_prop_property_get(win, ECORE_X_ATOM_XDND_TYPE_LIST,
> -                                        XA_ATOM, 32, &old_data, &num) == 0)
> -     return;
> -   oldset = (Ecore_X_Atom *)old_data;
>  
>     LOGFN(__FILE__, __LINE__, __FUNCTION__);
>     if (on)
>       {
> -        if (ecore_x_dnd_type_isset(win, type))
> +        if (ecore_x_window_prop_property_get(win, 
> ECORE_X_ATOM_XDND_TYPE_LIST,
> +                                             XA_ATOM, 32, &old_data, &num) > 
> 0)
>            {
> -             if (old_data) free(old_data);
> -             return;
> +             if (ecore_x_dnd_type_isset(win, type))
> +               {
> +                  if (old_data) free(old_data);
> +                  return;
> +               }
>            }
>  
>          newset = calloc(num + 1, sizeof(Ecore_X_Atom));
> @@ -282,6 +282,7 @@ ecore_x_dnd_type_set(Ecore_X_Window win,
>               return;
>            }
>  
> +        oldset = (Ecore_X_Atom *)old_data;
>          data = (unsigned char *)newset;
>  
>          for (i = 0; i < num; i++)
> @@ -294,6 +295,9 @@ ecore_x_dnd_type_set(Ecore_X_Window win,
>       }
>     else
>       {
> +        if (ecore_x_window_prop_property_get(win, 
> ECORE_X_ATOM_XDND_TYPE_LIST,
> +                                             XA_ATOM, 32, &old_data, &num) 
> == 0)
> +           return;
>          if (!ecore_x_dnd_type_isset(win, type))
>            {
>               if (old_data) free(old_data);
> @@ -307,6 +311,7 @@ ecore_x_dnd_type_set(Ecore_X_Window win,
>               return;
>            }
>  
> +        oldset = (Ecore_X_Atom *)old_data;
>          data = (unsigned char *)newset;
>          for (i = 0; i < num; i++)
>            if (oldset[i] != atom)
> @@ -316,7 +321,7 @@ ecore_x_dnd_type_set(Ecore_X_Window win,
>                                           XA_ATOM, 32, data, num - 1);
>       }
>  
> -   XFree(oldset);
> +   if (oldset) XFree(oldset);
>     free(newset);
>  }
>  
>


------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to