unset wl selection target client if that client is deleted

the frame deletion callback would trigger far too late, allowing
crashes to occur if the selection target client exited between the
time of the drop event and the selection send event
This commit is contained in:
Mike Blumenkrantz 2017-05-12 12:09:18 -04:00
parent 43157cb1f5
commit d0b6ff11fa
2 changed files with 1 additions and 13 deletions

View File

@ -2442,6 +2442,7 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec)
ec->parent->lock_close = EINA_FALSE;
ec->parent->modal = NULL;
}
if (e_comp_wl->selection.target == ec) e_comp_wl->selection.target = NULL;
if ((ec == e_client_focused_get()) && ec->visible) _e_comp_wl_keyboard_leave(ec);

View File

@ -940,15 +940,6 @@ _e_comp_wl_clipboard_create(void)
wl_signal_add(&e_comp_wl->selection.signal, &e_comp_wl->clipboard.listener);
}
static void
_e_comp_wl_data_device_target_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
E_Client *ec = data;
if (e_comp_wl->selection.target == ec)
e_comp_wl->selection.target = NULL;
}
E_API void
e_comp_wl_data_device_send_enter(E_Client *ec)
{
@ -976,8 +967,6 @@ e_comp_wl_data_device_send_enter(E_Client *ec)
}
}
e_comp_wl->selection.target = ec;
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_DEL,
_e_comp_wl_data_device_target_del, ec);
#ifndef HAVE_WAYLAND_ONLY
if (e_client_has_xwindow(ec))
@ -1036,8 +1025,6 @@ e_comp_wl_data_device_send_leave(E_Client *ec)
e_client_has_xwindow(e_comp_wl->drag_client))
return;
if (e_comp_wl->drag && (e_comp_wl->drag->object == ec->frame)) return;
evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_DEL,
_e_comp_wl_data_device_target_del, ec);
if (e_comp_wl->selection.target == ec)
e_comp_wl->selection.target = NULL;
#ifndef HAVE_WAYLAND_ONLY