summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHyoyoung Chang <hyoyoung@gmail.com>2012-01-03 04:44:48 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-01-03 04:44:48 +0000
commitd7fbec35e5eb2207c0f8b749c080b553d9ac1ba0 (patch)
treed2fd3c05cdd7cd4ba6cd0d20402f18cb6781b029 /src
parent56224b15d3443e204e6aa4dd27b9c25bb4d67054 (diff)
From: Hyoyoung Chang <hyoyoung@gmail.com>
Subject: [E-devel] [patch] elm_cnp_helper - bugfix duplicated drag objs Date: Tue, 3 Jan 2012 13:41:09 +0900 Dear all. Currently, dragging is only supported in elm_photo. Normally it works well but in overlapped region, elm_photo makes multiple drag events. However multiple objs dragging isn't supported by elm_cnp_helper(also in xdnd specs) It better to block multiple dragging events. Also I fixed dragdonecb's data argument position. Thank you. SVN revision: 66773
Diffstat (limited to 'src')
-rw-r--r--src/lib/elm_cnp_helper.c16
-rw-r--r--src/lib/elm_photo.c11
2 files changed, 17 insertions, 10 deletions
diff --git a/src/lib/elm_cnp_helper.c b/src/lib/elm_cnp_helper.c
index 23cc42fe5..5b7e0f712 100644
--- a/src/lib/elm_cnp_helper.c
+++ b/src/lib/elm_cnp_helper.c
@@ -1563,7 +1563,7 @@ _drag_mouse_up(void *un __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *
1563 ecore_x_dnd_aware_set(xwin, EINA_FALSE); 1563 ecore_x_dnd_aware_set(xwin, EINA_FALSE);
1564 if (dragdonecb) 1564 if (dragdonecb)
1565 { 1565 {
1566 dragdonecb(dragdonecb,selections[ELM_SEL_TYPE_XDND].widget); 1566 dragdonecb(dragdonedata, selections[ELM_SEL_TYPE_XDND].widget);
1567 dragdonecb = NULL; 1567 dragdonecb = NULL;
1568 } 1568 }
1569 if (dragwin) 1569 if (dragwin)
@@ -1599,9 +1599,15 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void (
1599 1599
1600 cnp_debug("starting drag...\n"); 1600 cnp_debug("starting drag...\n");
1601 1601
1602 ecore_x_dnd_type_set(xwin, "text/uri-list", 1); 1602 if (dragwin)
1603 {
1604 cnp_debug("another obj is dragging...\n");
1605 return EINA_FALSE;
1606 }
1607
1608 ecore_x_dnd_type_set(xwin, "text/uri-list", EINA_TRUE);
1603 sel = selections + ELM_SEL_TYPE_XDND; 1609 sel = selections + ELM_SEL_TYPE_XDND;
1604 sel->active = 1; 1610 sel->active = EINA_TRUE;
1605 sel->widget = obj; 1611 sel->widget = obj;
1606 sel->format = format; 1612 sel->format = format;
1607 sel->selbuf = data ? strdup(data) : NULL; 1613 sel->selbuf = data ? strdup(data) : NULL;
@@ -1618,12 +1624,12 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void (
1618 _dnd_status, NULL); 1624 _dnd_status, NULL);
1619 1625
1620 dragwin = elm_win_add(NULL, "Elm Drag Object", ELM_WIN_UTILITY); 1626 dragwin = elm_win_add(NULL, "Elm Drag Object", ELM_WIN_UTILITY);
1621 elm_win_override_set(dragwin, 1); 1627 elm_win_override_set(dragwin, EINA_TRUE);
1622 1628
1623 /* FIXME: Images only */ 1629 /* FIXME: Images only */
1624 icon = elm_icon_add(dragwin); 1630 icon = elm_icon_add(dragwin);
1625 elm_icon_file_set(icon, data + 7, NULL); /* 7!? "file://" */ 1631 elm_icon_file_set(icon, data + 7, NULL); /* 7!? "file://" */
1626 elm_win_resize_object_add(dragwin,icon); 1632 elm_win_resize_object_add(dragwin, icon);
1627 evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1633 evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1628 evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); 1634 evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
1629 1635
diff --git a/src/lib/elm_photo.c b/src/lib/elm_photo.c
index f54e7a16b..f76ae43c9 100644
--- a/src/lib/elm_photo.c
+++ b/src/lib/elm_photo.c
@@ -189,13 +189,14 @@ _longpress(void *objv)
189 /* FIXME: Deal with relative paths */ 189 /* FIXME: Deal with relative paths */
190 buf = malloc(strlen(file) + strlen("file://") + 1); 190 buf = malloc(strlen(file) + strlen("file://") + 1);
191 sprintf(buf, "%s%s","file://",file); 191 sprintf(buf, "%s%s","file://",file);
192 elm_drag_start(objv, ELM_SEL_FORMAT_IMAGE, 192 if (elm_drag_start(objv, ELM_SEL_FORMAT_IMAGE,
193 buf, _drag_done_cb, NULL); 193 buf, _drag_done_cb, NULL))
194 {
195 elm_object_scroll_freeze_push(objv);
196 evas_object_smart_callback_call(objv, SIG_DRAG_START, NULL);
197 }
194 free(buf); 198 free(buf);
195 } 199 }
196 elm_object_scroll_freeze_push(objv);
197
198 evas_object_smart_callback_call(objv, SIG_DRAG_START, NULL);
199 200
200 return 0; /* Don't call again */ 201 return 0; /* Don't call again */
201} 202}