ecore-wl2: Cleanup dnd drag and selection sources when we delete an

input

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-09-30 13:01:23 -04:00
parent a4b28e0375
commit a084891013
3 changed files with 16 additions and 15 deletions

View File

@ -37,19 +37,6 @@ static const struct wl_data_offer_listener _offer_listener =
_offer_cb_offer
};
static void
_ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source)
{
if (!source) return;
source->refcount--;
if (source->refcount == 0)
{
wl_data_offer_destroy(source->offer);
wl_array_release(&source->types);
free(source);
}
}
static void
_source_cb_target_free(void *data EINA_UNUSED, void *event)
{
@ -410,6 +397,19 @@ _ecore_wl2_dnd_selection(Ecore_Wl2_Input *input, struct wl_data_offer *offer)
}
}
void
_ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source)
{
if (!source) return;
source->refcount--;
if (source->refcount == 0)
{
wl_data_offer_destroy(source->offer);
wl_array_release(&source->types);
free(source);
}
}
EAPI void
ecore_wl2_dnd_drag_types_set(Ecore_Wl2_Input *input, const char **types)
{

View File

@ -1268,8 +1268,8 @@ _ecore_wl2_input_del(Ecore_Wl2_Input *input)
}
if (input->data.source) wl_data_source_destroy(input->data.source);
/* TODO: cleanup dnd */
/* TODO: cleanup selection */
if (input->drag.source) _ecore_wl2_dnd_del(input->drag.source);
if (input->selection.source) _ecore_wl2_dnd_del(input->selection.source);
if (input->data.device) wl_data_device_destroy(input->data.device);
if (input->xkb.state) xkb_state_unref(input->xkb.state);

View File

@ -239,5 +239,6 @@ void _ecore_wl2_dnd_leave(Ecore_Wl2_Input *input);
void _ecore_wl2_dnd_motion(Ecore_Wl2_Input *input, int x, int y, unsigned int timestamp);
void _ecore_wl2_dnd_drop(Ecore_Wl2_Input *input);
void _ecore_wl2_dnd_selection(Ecore_Wl2_Input *input, struct wl_data_offer *offer);
void _ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source);
#endif