rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=9faa1915cf61defbe1e4a8c806c0a1d8405f4d01

commit 9faa1915cf61defbe1e4a8c806c0a1d8405f4d01
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Mon Oct 5 15:30:04 2015 +0300

    eflete: add a wrapper to ecore main loop iterate
    
    This is crutch, need to delete it in further and remake the popup
    block behavior.
    
    Change-Id: Ib03fafe4c497968f55723377de1ca43e6dc42a9d
---
 src/bin/eflete.c   | 15 +++++++++++++++
 src/bin/eflete.h   | 20 ++++++++++++++++++++
 src/bin/ui/popup.c |  4 ++--
 3 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/src/bin/eflete.c b/src/bin/eflete.c
index 74ca21c..8c82f00 100644
--- a/src/bin/eflete.c
+++ b/src/bin/eflete.c
@@ -26,6 +26,8 @@
 
 App_Data ap;
 
+static Eina_Bool do_block = true;
+
 Evas_Object *
 win_layout_get(void)
 {
@@ -49,6 +51,19 @@ colorselector_get(void)
    return ap.colorsel;
 }
 
+void
+eflete_main_loop_begin(void)
+{
+   while (do_block) ecore_main_loop_iterate_may_block(0);
+   do_block = true;
+}
+
+void
+eflete_main_loop_quit(void)
+{
+   do_block = false;
+}
+
 Eina_Bool
 app_init()
 {
diff --git a/src/bin/eflete.h b/src/bin/eflete.h
index ae19e17..bee91db 100644
--- a/src/bin/eflete.h
+++ b/src/bin/eflete.h
@@ -149,6 +149,26 @@ Eina_Bool
 app_shutdown(void);
 
 /**
+ * Start nested not blocked ecore main loop.
+ *
+ * @note Master Raster add to ecore_main_loop_begin the hard check to nested
+ * main loops. Now have no time to remake our popup behavior, and add this
+ * crutch. In further need to delete it.
+ *
+ * @ingroup Eflete
+ */
+void
+eflete_main_loop_begin(void);
+
+/**
+ * End nested main loop.
+ *
+ * @ingroup Eflete
+ */
+void
+eflete_main_loop_quit(void);
+
+/**
  * This function will return win_layout (if App_Data and win_layout exists).
  * If they are not exist, then this function will return NULL.
  * This function is usable for notification.
diff --git a/src/bin/ui/popup.c b/src/bin/ui/popup.c
index ae0cfbe..3a1d9d8 100644
--- a/src/bin/ui/popup.c
+++ b/src/bin/ui/popup.c
@@ -38,7 +38,7 @@ _btn_cb(void *data,
    btn_pressed = *((Popup_Button *)data);
    if ((BTN_OK == btn_pressed) || (BTN_SAVE == btn_pressed) || (BTN_REPLACE == 
btn_pressed))
      if (validator && (!validator(user_data))) return;
-   ecore_main_loop_quit();
+   eflete_main_loop_quit();
 }
 
 #define BTN_ADD(TEXT, PLACE, DATA) \
@@ -92,7 +92,7 @@ popup_want_action(const char *title,
 
    evas_object_show(popup);
    if (to_focus) elm_object_focus_set(to_focus, true);
-   ecore_main_loop_begin();
+   eflete_main_loop_begin();
 
    /* clear up before return the presed button */
    elm_object_content_unset(popup);

-- 


Reply via email to