forked from enlightenment/enlightenment
more correctly handle dnd completion for wl
* always send cancel when drag is !accepted * always null e_comp_wl->drag_source
This commit is contained in:
parent
b568e7abb1
commit
75ff919036
|
@ -534,7 +534,9 @@ _e_comp_wl_data_device_selection_set(void *data EINA_UNUSED, E_Comp_Wl_Data_Sour
|
||||||
static void
|
static void
|
||||||
_e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
|
_e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
|
||||||
{
|
{
|
||||||
|
struct wl_resource *res = NULL;
|
||||||
Evas_Object *o, *z;
|
Evas_Object *o, *z;
|
||||||
|
E_Comp_Wl_Data_Source *data_source = e_comp_wl->drag_source;
|
||||||
|
|
||||||
o = edje_object_part_swallow_get(drag->comp_object, "e.swallow.content");
|
o = edje_object_part_swallow_get(drag->comp_object, "e.swallow.content");
|
||||||
if (eina_streq(evas_object_type_get(o), "e_comp_object"))
|
if (eina_streq(evas_object_type_get(o), "e_comp_object"))
|
||||||
|
@ -552,7 +554,6 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
|
||||||
e_comp_wl->drag_client = NULL;
|
e_comp_wl->drag_client = NULL;
|
||||||
e_screensaver_inhibit_toggle(0);
|
e_screensaver_inhibit_toggle(0);
|
||||||
if (dropped) return;
|
if (dropped) return;
|
||||||
if (e_comp_wl->selection.target)
|
|
||||||
#ifndef HAVE_WAYLAND_ONLY
|
#ifndef HAVE_WAYLAND_ONLY
|
||||||
if (e_comp_wl->selection.target && e_client_has_xwindow(e_comp_wl->selection.target))
|
if (e_comp_wl->selection.target && e_client_has_xwindow(e_comp_wl->selection.target))
|
||||||
{
|
{
|
||||||
|
@ -564,15 +565,10 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (e_comp_wl->selection.target)
|
|
||||||
{
|
|
||||||
struct wl_resource *res;
|
|
||||||
E_Comp_Wl_Data_Source *data_source = e_comp_wl->drag_source;
|
|
||||||
|
|
||||||
|
if (e_comp_wl->selection.target)
|
||||||
res = e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp_wl->selection.target->comp_data->surface));
|
res = e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp_wl->selection.target->comp_data->surface));
|
||||||
if (res)
|
if (res && data_source->accepted && data_source->current_dnd_action)
|
||||||
{
|
|
||||||
if (data_source->accepted && data_source->current_dnd_action)
|
|
||||||
{
|
{
|
||||||
wl_data_device_send_drop(res);
|
wl_data_device_send_drop(res);
|
||||||
if (wl_resource_get_version(data_source->resource) >=
|
if (wl_resource_get_version(data_source->resource) >=
|
||||||
|
@ -585,8 +581,7 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
|
||||||
else if (wl_resource_get_version(data_source->resource) >=
|
else if (wl_resource_get_version(data_source->resource) >=
|
||||||
WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION)
|
WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION)
|
||||||
wl_data_source_send_cancelled(data_source->resource);
|
wl_data_source_send_cancelled(data_source->resource);
|
||||||
wl_data_device_send_leave(res);
|
if (res) wl_data_device_send_leave(res);
|
||||||
}
|
|
||||||
#ifndef HAVE_WAYLAND_ONLY
|
#ifndef HAVE_WAYLAND_ONLY
|
||||||
if (e_comp_util_has_xwayland())
|
if (e_comp_util_has_xwayland())
|
||||||
{
|
{
|
||||||
|
@ -598,7 +593,6 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
|
||||||
e_comp_wl->selection.target = NULL;
|
e_comp_wl->selection.target = NULL;
|
||||||
e_comp_wl->drag_source = NULL;
|
e_comp_wl->drag_source = NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_comp_wl_data_device_drag_key(E_Drag *drag EINA_UNUSED, Ecore_Event_Key *ev)
|
_e_comp_wl_data_device_drag_key(E_Drag *drag EINA_UNUSED, Ecore_Event_Key *ev)
|
||||||
|
|
Loading…
Reference in New Issue