forked from enlightenment/efl
ecore_wl2: save action of data source in seperated field
the drag.source is only available if the drag is happing inside the same client. So for the case there are two efl apps (A,B) , where A started the dnd and the B is currently entered by the dnd, then A has the data source, and B has the offer, if B sets a action on the offer A tried to set it on a field which does not exist there, this fixes that. It saves the action to a undepended field.
This commit is contained in:
parent
cc7dbde840
commit
7d6fd10523
|
@ -153,8 +153,8 @@ data_source_event_emit(Ecore_Wl2_Input *input, int event)
|
|||
ev->source = input->focus.keyboard->id;
|
||||
|
||||
if (!ev->win) ev->win = ev->source;
|
||||
if (input->drag.source)
|
||||
ev->action = input->drag.source->dnd_action;
|
||||
|
||||
ev->action = input->data.action;
|
||||
|
||||
ecore_event_add(event, ev, NULL, NULL);
|
||||
}
|
||||
|
@ -164,9 +164,8 @@ data_source_cancelled(void *data, struct wl_data_source *source)
|
|||
{
|
||||
Ecore_Wl2_Input *input = data;
|
||||
|
||||
if (input->drag.source)
|
||||
input->drag.source->dnd_action = 0;
|
||||
if (input->data.source == source) input->data.source = NULL;
|
||||
input->data.action = WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE;
|
||||
wl_data_source_destroy(source);
|
||||
data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_END);
|
||||
}
|
||||
|
@ -193,8 +192,7 @@ data_source_action(void *data, struct wl_data_source *source EINA_UNUSED, uint32
|
|||
{
|
||||
Ecore_Wl2_Input *input = data;
|
||||
|
||||
if (input->drag.source)
|
||||
input->drag.source->dnd_action = dnd_action;
|
||||
input->data.action = dnd_action;
|
||||
data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_ACTION);
|
||||
}
|
||||
|
||||
|
|
|
@ -345,6 +345,7 @@ struct _Ecore_Wl2_Input
|
|||
struct wl_data_device *device;
|
||||
struct wl_data_source *source;
|
||||
struct wl_array types;
|
||||
uint32_t action;
|
||||
} data;
|
||||
|
||||
struct
|
||||
|
|
Loading…
Reference in New Issue