aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-09-22 21:22:51 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-09-23 11:15:14 +0200
commit57d97b4df933f435715a10568ae3851c93a9b8d3 (patch)
tree6d0855f189ebf66183553e712ea288cc1bbc4314
parentecore_wl2: introduce offer api (diff)
downloadefl-57d97b4df933f435715a10568ae3851c93a9b8d3.tar.gz
elm_cnp: handle actions probebly
ecore_wl2 passes the action which should be performed, this action is now converted and passed to the action of the elm callback.
-rw-r--r--src/lib/elementary/elm_cnp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_cnp.c b/src/lib/elementary/elm_cnp.c
index 08b5ebb5b3..5d399382ba 100644
--- a/src/lib/elementary/elm_cnp.c
+++ b/src/lib/elementary/elm_cnp.c
@@ -3610,6 +3610,16 @@ _wl_dnd_position(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
return ECORE_CALLBACK_PASS_ON;
}
+static Elm_Xdnd_Action
+_wl_to_elm(Ecore_Wl2_Drag_Action action)
+{
+ #define CONV(wl, elm) if (action == wl) return elm;
+ CONV(ECORE_WL2_DRAG_ACTION_COPY, ELM_XDND_ACTION_COPY);
+ CONV(ECORE_WL2_DRAG_ACTION_MOVE, ELM_XDND_ACTION_MOVE);
+ CONV(ECORE_WL2_DRAG_ACTION_ASK, ELM_XDND_ACTION_ASK);
+ #undef CONV
+ return ELM_XDND_ACTION_UNKNOWN;
+}
static Eina_Bool
_wl_dnd_receive(void *data, int type EINA_UNUSED, void *event)
@@ -3628,6 +3638,11 @@ _wl_dnd_receive(void *data, int type EINA_UNUSED, void *event)
Ecore_Wl2_Drag_Action action;
action = ecore_wl2_offer_action_get(ev->offer);
+ if (action == ECORE_WL2_DRAG_ACTION_ASK)
+ ecore_wl2_offer_actions_set(ev->offer, ECORE_WL2_DRAG_ACTION_COPY, ECORE_WL2_DRAG_ACTION_COPY);
+ action = ecore_wl2_offer_action_get(ev->offer);
+
+ wl_cnp_selection.action = _wl_to_elm(action);
_wl_dropable_data_handle(&wl_cnp_selection, ev);
evas_object_event_callback_del_full(wl_cnp_selection.requestwidget,