summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2014-12-21 15:47:07 +0200
committerYakov Goldberg <yakov.g@samsung.com>2014-12-21 15:52:18 +0200
commit3661d523561e093d9293934b07189d0e99f499f5 (patch)
tree0a47afb5475d54f4c161b1b49c358494823b46e8 /src/bin
parent775c7ac17639ed196bc01ff8b2ea091ef0ae6225 (diff)
DnD: fix. Clicking on empty window
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/egui_gui/editor.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bin/egui_gui/editor.c b/src/bin/egui_gui/editor.c
index aeeb13f..7d26d16 100644
--- a/src/bin/egui_gui/editor.c
+++ b/src/bin/egui_gui/editor.c
@@ -547,6 +547,14 @@ _mouse_down_main(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_
547 Evas_Coord x, y; 547 Evas_Coord x, y;
548 eo_do(obj, evas_obj_position_get(&x, &y)); 548 eo_do(obj, evas_obj_position_get(&x, &y));
549 _drag_widget_iterate(&drag_candidate, session, ev->canvas.x - x, ev->canvas.y - y); 549 _drag_widget_iterate(&drag_candidate, session, ev->canvas.x - x, ev->canvas.y - y);
550 /* Case, when clicking on empty window. */
551 if (drag_candidate == wdg_main)
552 {
553 _editor_wdg_selected_set(wdg_main);
554 objtree_item_selected_set(wdg_main);
555 drag_start(NULL, NULL, EDITOR_DRAG_DATA, NULL, NULL);
556 return;
557 }
550 558
551 wdg = drag_candidate; 559 wdg = drag_candidate;
552 wdg_eo = session_eo_get(session, wdg); 560 wdg_eo = session_eo_get(session, wdg);
@@ -567,6 +575,7 @@ _mouse_up_main(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo
567 /* Check if dragged object is visible. 575 /* Check if dragged object is visible.
568 * If not, means that _drag_start_cb was called, so need to reload main wdg. */ 576 * If not, means that _drag_start_cb was called, so need to reload main wdg. */
569 const Gui_Widget *drag_widget = dnd_drag_wdg_get(); 577 const Gui_Widget *drag_widget = dnd_drag_wdg_get();
578 if (!drag_widget) return;
570 const Gui_Session *session = gui_context_editor_session_get(wdg_context_get(drag_widget)); 579 const Gui_Session *session = gui_context_editor_session_get(wdg_context_get(drag_widget));
571 const Eo *wdg_eo = session_eo_get(session, drag_widget); 580 const Eo *wdg_eo = session_eo_get(session, drag_widget);
572 Eina_Bool vis = eo_do(wdg_eo, evas_obj_visibility_get()); 581 Eina_Bool vis = eo_do(wdg_eo, evas_obj_visibility_get());