fix dnd for "below everything"
authorCarsten Haitzler <raster@rasterman.com>
Mon, 16 Oct 2006 10:40:10 +0000 (10:40 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Mon, 16 Oct 2006 10:40:10 +0000 (10:40 +0000)
SVN revision: 26653

src/bin/e_dnd.c
src/bin/e_gadcon.c
src/bin/e_gadcon.h
src/bin/e_shelf.c

index b28f308..ec00d46 100644 (file)
@@ -537,7 +537,7 @@ _e_drag_win_matches(E_Drop_Handler *h, Ecore_X_Window win)
        switch (h->obj->type)
          {
           case E_GADCON_TYPE:
-            hwin = ecore_evas_software_x11_window_get(((E_Gadcon *)(h->obj))->ecore_evas);
+            hwin = e_gadcon_dnd_window_get((E_Gadcon *)(h->obj));
             break;
           case E_WIN_TYPE:
             hwin = ((E_Win *)(h->obj))->evas_win;
index dbcaa7a..b7bbd26 100644 (file)
@@ -622,6 +622,22 @@ e_gadcon_util_menu_attach_func_set(E_Gadcon *gc,
    gc->menu_attach.data = data;
 }
                                                         
+EAPI void
+e_gadcon_dnd_window_set(E_Gadcon *gc, Ecore_X_Window win)
+{
+   E_OBJECT_CHECK(gc);
+   E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
+   gc->dnd_win = win;
+}
+                                                        
+EAPI Ecore_X_Window
+e_gadcon_dnd_window_get(E_Gadcon *gc)
+{
+   E_OBJECT_CHECK_RETURN(gc, 0);
+   E_OBJECT_TYPE_CHECK_RETURN(gc, E_GADCON_TYPE, 0);
+   return gc->dnd_win;
+}
+                                                        
 EAPI E_Gadcon_Client *
 e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id, const char *style, Evas_Object *base_obj)
 {
index 51ed495..2bfab0b 100644 (file)
@@ -80,6 +80,7 @@ struct _E_Gadcon
    
    E_Config_Dialog    *config_dialog;
    unsigned char       editing : 1;
+   Ecore_X_Window      dnd_win;
 };
 
 #define GADCON_CLIENT_CLASS_VERSION 1
@@ -164,7 +165,9 @@ EAPI E_Zone          *e_gadcon_zone_get(E_Gadcon *gc);
 EAPI void             e_gadcon_ecore_evas_set(E_Gadcon *gc, Ecore_Evas *ee);
 EAPI int              e_gadcon_canvas_zone_geometry_get(E_Gadcon *gc, int *x, int *y, int *w, int *h);
 EAPI void             e_gadcon_util_menu_attach_func_set(E_Gadcon *gc, void (*func) (void *data, E_Menu *menu), void *data);
-
+EAPI void             e_gadcon_dnd_window_set(E_Gadcon *gc, Ecore_X_Window win);
+EAPI Ecore_X_Window   e_gadcon_dnd_window_get(E_Gadcon *gc);
+    
 EAPI E_Gadcon_Client *e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id, const char *style, Evas_Object *base_obj);
 EAPI void             e_gadcon_client_edit_begin(E_Gadcon_Client *gcc);
 EAPI void             e_gadcon_client_edit_end(E_Gadcon_Client *gcc);
index ec69461..2e34499 100644 (file)
@@ -105,7 +105,7 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i
      }
    else
      {
-       e_drop_xdnd_register_set(zone->container->bg_win, 1);
+       e_drop_xdnd_register_set(zone->container->event_win, 1);
        es->ee = zone->container->bg_ecore_evas;
        es->evas = zone->container->bg_evas;
      }
@@ -165,6 +165,10 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i
    edje_object_message_signal_process(es->o_base);
    e_gadcon_zone_set(es->gadcon, zone);
    e_gadcon_ecore_evas_set(es->gadcon, es->ee);
+   if (popup)
+     e_gadcon_dnd_window_set(es->gadcon, es->popup->evas_win);
+   else
+     e_gadcon_dnd_window_set(es->gadcon, zone->container->event_win);
    e_gadcon_util_menu_attach_func_set(es->gadcon,
                                      _e_shelf_cb_menu_items_append,
                                      es);