jackdanielz pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=754ed5471c34bffc47cacbd393ad383fbc644e0a

commit 754ed5471c34bffc47cacbd393ad383fbc644e0a
Author: Daniel Zaoui <[email protected]>
Date:   Thu Jan 8 11:54:04 2015 +0200

    DnD: fix callbacks deletion for inline windows.
    
    During deletion of a window, widgets considered as droppable targets
    have to remove their DnD callbacks. To achieve this, elm_drop_target_del
    is called from the DEL callback (destructor). This function has to
    determine if X11 or Wayland is used. Since the parent is already unknown
    at this stage, only checking the engine name can give this
    information.
    On a regular window, the engine name is related to the target display.
    
    The problem happens when an inline window is used. The engine is a
    buffer and no information is given regarding the target display.
    
    The patch fixes it by checking the nature of the Ecore Evas parents. It
    supports nested windows (inline inside inline... inside XWin).
    
    @fix
---
 src/lib/elm_cnp.c | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index ee44a3c..363d851 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -1901,7 +1901,23 @@ _x11_elm_widget_xwin_get(const Evas_Object *obj)
         if (!evas) return 0;
         ee = ecore_evas_ecore_evas_get(evas);
         if (!ee) return 0;
-        xwin = _elm_ee_xwin_get(ee);
+
+        while(!xwin)
+          {
+             const char *engine_name = ecore_evas_engine_name_get(ee);
+             if (!strcmp(engine_name, ELM_BUFFER))
+               {
+                  ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
+                  if (!ee) return 0;
+                  xwin = _elm_ee_xwin_get(ee);
+               }
+             else
+               {
+                  /* In case the engine is not a buffer, we want to check 
once. */
+                  xwin = _elm_ee_xwin_get(ee);
+                  if (!xwin) return 0;
+               }
+          }
      }
    return xwin;
 }
@@ -3492,7 +3508,22 @@ _wl_elm_widget_window_get(Evas_Object *obj)
         if (!(ee = ecore_evas_ecore_evas_get(evas)))
           return 0;
 
-        win = ecore_evas_wayland_window_get(ee);
+        while(!win)
+          {
+             const char *engine_name = ecore_evas_engine_name_get(ee);
+             if (!strcmp(engine_name, ELM_BUFFER))
+               {
+                  ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
+                  if (!ee) return 0;
+                  win = ecore_evas_wayland_window_get(ee);
+               }
+             else
+               {
+                  /* In case the engine is not a buffer, we want to check 
once. */
+                  win = ecore_evas_wayland_window_get(ee);
+                  if (!win) return 0;
+               }
+          }
      }
 
    return ecore_wl_window_id_get(win);

-- 


Reply via email to