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
10b1ba2b23
commit
3a83c9db9e
|
@ -536,7 +536,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"))
|
||||||
|
@ -554,7 +556,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))
|
||||||
{
|
{
|
||||||
|
@ -566,15 +567,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) >=
|
||||||
|
@ -587,8 +583,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())
|
||||||
{
|
{
|
||||||
|
@ -599,7 +594,6 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
|
||||||
#endif
|
#endif
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue