diff options
author | Thiep Ha <thiepha@gmail.com> | 2015-05-10 16:52:53 +0900 |
---|---|---|
committer | Thiep Ha <thiepha@gmail.com> | 2015-06-02 21:50:24 +0900 |
commit | d322f798e8c7760301cfa4f6d0292e4af24d8344 (patch) | |
tree | 80f865f9b7478e0a3589160c09fb57fbadd88900 | |
parent | f20cd755c0de567793228ed2b35224da02c861f9 (diff) | |
download | elementary-d322f798e8c7760301cfa4f6d0292e4af24d8344.tar.gz |
CnP/Wl: get list of supported types from selection owner
When we get selection, it is better to get the list of supported types
from selection owner first. And then, we can choose correct type we want.
-rw-r--r-- | src/lib/elm_cnp.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c index 55f916144..cdf89fb1a 100644 --- a/src/lib/elm_cnp.c +++ b/src/lib/elm_cnp.c @@ -3245,9 +3245,9 @@ _wl_elm_cnp_selection_get(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form sel->requestformat = format; sel->requestwidget = obj; sel->win = win; - /* sel->request(win, ECORE_X_SELECTION_TARGET_TARGETS); */ sel->datacb = datacb; sel->udata = udata; + sel->requesttype = "TARGETS"; evas_object_event_callback_add(sel->requestwidget, EVAS_CALLBACK_DEL, _wl_sel_obj_del2, @@ -3256,28 +3256,7 @@ _wl_elm_cnp_selection_get(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form if ((selection == ELM_SEL_TYPE_CLIPBOARD) || (selection == ELM_SEL_TYPE_PRIMARY) || (selection == ELM_SEL_TYPE_SECONDARY)) - { - const char *types[10] = {0, }; - int i = -1; - - if ((format & ELM_SEL_FORMAT_MARKUP) || - (format & ELM_SEL_FORMAT_TEXT)) - { - types[++i] = "application/x-elementary-markup"; - types[++i] = "text/plain"; - types[++i] = "text/plain;charset=utf-8"; - } - - if (format & ELM_SEL_FORMAT_HTML) - { - types[++i] = "text/html"; - types[++i] = "text/html;charset=utf-8"; - } - - if (i < 0) return EINA_FALSE; - - ecore_wl_dnd_selection_get(ecore_wl_input_get(), *types); - } + ecore_wl_dnd_selection_get(ecore_wl_input_get(), "TARGETS"); return EINA_TRUE; } |