summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2014-02-18 15:47:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-18 15:47:08 +0900
commit601856ede71c1d98197933695e2d04128b915ec5 (patch)
treed2b965ab70349cb2dac2b8fdc02088ffe3d333ea
parent2f51a93795d1dc886864863de269ba90cdfedebe (diff)
[DnD] Fix bug of hard-coded type when drag
Summary: When we start dragging, the type is always set to "text/uri-list" no matter the format type set by application. This patch fixs this hard-coded type issue. It will set types corresponding to the format type set by application. For example, if application set format as ELM_SEL_FORMAT_TEXT, it will set types UTF8_STRING, STRING, COMPOUND_TEXT, TEXT, text/plain, text/plain;charset=utf-8. Reviewers: JackDanielZ, raster Reviewed By: raster CC: woohyun, seoz Differential Revision: https://phab.enlightenment.org/D546
-rw-r--r--src/lib/elm_cnp.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index f4880036c..a6a11484e 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -2024,6 +2024,7 @@ _x11_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
2024 Evas_Object *icon = NULL; 2024 Evas_Object *icon = NULL;
2025 int w = 0, h = 0; 2025 int w = 0, h = 0;
2026 Ecore_X_Atom actx; 2026 Ecore_X_Atom actx;
2027 int i;
2027 2028
2028 _x11_elm_cnp_init(); 2029 _x11_elm_cnp_init();
2029 2030
@@ -2035,7 +2036,24 @@ _x11_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
2035 return EINA_FALSE; 2036 return EINA_FALSE;
2036 } 2037 }
2037 2038
2038 ecore_x_dnd_type_set(xwin, "text/uri-list", EINA_TRUE); 2039 ecore_x_dnd_types_set(xwin, NULL, 0);
2040 for (i = 0; i < CNP_N_ATOMS; i++)
2041 {
2042 if (_x11_atoms[i].formats == ELM_SEL_FORMAT_TARGETS)
2043 {
2044 if (format == ELM_SEL_FORMAT_TARGETS)
2045 {
2046 ecore_x_dnd_type_set(xwin, _x11_atoms[i].name, EINA_TRUE);
2047 cnp_debug("set dnd type: %s\n", _x11_atoms[i].name);
2048 }
2049 }
2050 else if (_x11_atoms[i].formats & format)
2051 {
2052 ecore_x_dnd_type_set(xwin, _x11_atoms[i].name, EINA_TRUE);
2053 cnp_debug("set dnd type: %s\n", _x11_atoms[i].name);
2054 }
2055 }
2056
2039 sel = _x11_selections + ELM_SEL_TYPE_XDND; 2057 sel = _x11_selections + ELM_SEL_TYPE_XDND;
2040 sel->active = EINA_TRUE; 2058 sel->active = EINA_TRUE;
2041 sel->widget = obj; 2059 sel->widget = obj;