Elm dnd: abort drop_target_add if this is not an X window.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 12 Jul 2011 12:16:58 +0000 (12:16 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 12 Jul 2011 12:16:58 +0000 (12:16 +0000)
This fixes the issue with the shot module, and possibly when
running on other non-X engines when elementary is built with X support.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@61287 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_cnp_helper.c

index 3f3d2cb..77b3969 100644 (file)
@@ -1348,8 +1348,11 @@ elm_drop_target_add(Evas_Object *obj, Elm_Sel_Type format, Elm_Drop_Cb dropcb, v
    Ecore_X_Window xwin;
    Eina_List *item;
    int first;
+   Evas_Object *top;
 
    if (!obj) return EINA_FALSE;
+   top = elm_widget_top_get(obj);
+   if (!top || !elm_win_xwindow_get(top)) return EINA_FALSE;
    if (!_elm_cnp_init_count) _elm_cnp_init();
 
    /* Is this the first? */