E_Comp_Wl_Data_Source *source;
Eina_List *l;
struct wl_resource *res;
- E_Client *ec = NULL;
+ E_Client *drag_icon_ec = NULL, *ec = NULL;
int x, y;
DBG("Data Device Drag Start");
- if ((e_comp_wl->kbd.focus) &&
- (e_comp_wl->kbd.focus != origin_resource) &&
- (e_comp_wl->kbd.focus != icon_resource))
+ if (e_comp_wl->drag_source)
+ {
+ ERR("Drag already in progress");
+ return;
+ }
+
+ if (!(source = wl_resource_get_user_data(source_resource)))
return;
- if (!(source = wl_resource_get_user_data(source_resource))) return;
e_comp_wl->drag_source = source;
if (icon_resource)
{
DBG("\tHave Icon Resource: %p", icon_resource);
- ec = e_client_from_surface_resource(icon_resource);
- if (!ec->re_manage)
+ drag_icon_ec = e_client_from_surface_resource(icon_resource);
+ if (!drag_icon_ec->re_manage)
{
- ec->re_manage = 1;
- ec->new_client = 1;
-
- ec->lock_focus_out = ec->override = 1;
- ec->icccm.title = eina_stringshare_add("noshadow");
- e_client_layer_set(ec, E_LAYER_CLIENT_DRAG);
- ec->netwm.type = E_WINDOW_TYPE_DND;
- e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), ec));
- EC_CHANGED(ec);
+ drag_icon_ec->re_manage = 1;
+ drag_icon_ec->new_client = 1;
+
+ drag_icon_ec->lock_focus_out = drag_icon_ec->override = 1;
+ drag_icon_ec->icccm.title = eina_stringshare_add("noshadow");
+ e_client_layer_set(drag_icon_ec, E_LAYER_CLIENT_DRAG);
+ drag_icon_ec->netwm.type = E_WINDOW_TYPE_DND;
+ e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), drag_icon_ec));
+ EC_CHANGED(drag_icon_ec);
e_comp_override_add();
}
- e_comp_wl->drag_client = ec;
+ e_comp_wl->drag_client = drag_icon_ec;
}
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ ec = e_client_from_surface_resource(origin_resource);
+ if (ec && ec->pointer_enter_sent)
{
- if (!e_comp_wl_input_pointer_check(res)) continue;
- if (wl_resource_get_client(res) != client) continue;
- wl_pointer_send_leave(res, serial, e_comp_wl->kbd.focus);
+ EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ {
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+ if (wl_resource_get_client(res) != client) continue;
+ if (!ec->comp_data) continue;
+ wl_pointer_send_leave(res, serial, ec->comp_data->surface);
+ }
+
+ ec->pointer_enter_sent = EINA_FALSE;
}
evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
e_comp_wl->drag = e_drag_new(x, y,
NULL, 0, NULL, 0, NULL, _e_comp_wl_data_device_drag_finished);
e_comp_wl->drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
- if (ec)
+ if (drag_icon_ec)
{
- e_drag_object_set(e_comp_wl->drag, ec->frame);
- e_drag_resize(e_comp_wl->drag, ec->w, ec->h);
+ e_drag_object_set(e_comp_wl->drag, drag_icon_ec->frame);
+ e_drag_resize(e_comp_wl->drag, drag_icon_ec->w, drag_icon_ec->h);
}
e_drag_start(e_comp_wl->drag, x, y);
if (e_comp_wl->ptr.ec)