netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=62fec68dd0f73cbe1f97556ba47dc706662481eb

commit 62fec68dd0f73cbe1f97556ba47dc706662481eb
Author: Alastair Poole <nets...@gmail.com>
Date:   Fri Jan 8 18:38:50 2021 +0000

    0.5.10: Rbt. Y-Lee
    
    Well, that was silly. Should have asked for testing...:)
    
    Convinced myself nothing wrong and/or lazy.
---
 NEWS                         |  6 ++++++
 VERSION                      |  2 +-
 meson.build                  |  2 +-
 src/bin/ui/ui.c              | 36 ++++++++++++++++++++++++++++++++----
 src/bin/ui/ui_memory.c       | 10 +++++++---
 src/bin/ui/ui_process_list.c |  5 ++++-
 6 files changed, 51 insertions(+), 10 deletions(-)

diff --git a/NEWS b/NEWS
index e2a952c..e4a7375 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,12 @@ Evisum 0.6.0
 
   * ...
 
+=============
+Evisum 0.5.10
+=============
+
+  * Fix a bug ?
+
 ============
 Evisum 0.5.9
 ============
diff --git a/VERSION b/VERSION
index a918a2a..50c76ef 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.6.0
+0.5.10
diff --git a/meson.build b/meson.build
index 8155623..0b37499 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
 ##### Project
 project('evisum', 'c',
-        version       : '0.6.0',
+        version       : '0.5.10',
         meson_version : '>= 0.40.0')
 
 efl_version = '>= 1.22.0'
diff --git a/src/bin/ui/ui.c b/src/bin/ui/ui.c
index 879b261..2368cb9 100644
--- a/src/bin/ui/ui.c
+++ b/src/bin/ui/ui.c
@@ -296,12 +296,33 @@ _main_menu_show_user_changed_cb(void *data EINA_UNUSED, 
Evas_Object *obj,
    ui->proc.show_user = elm_check_state_get(obj);
    evisum_ui_config_save(ui);
 }
+typedef struct
+{
+   Ecore_Timer *timer;
+   Evas_Object *it_focus;
+} Menu_Inst;
+
+static void
+_main_menu_deleted_cb(void *data EINA_UNUSED, Evas_Object *obj, Evas *e,
+                        void *event_info EINA_UNUSED)
+{
+   Menu_Inst *inst = data;
+
+   inst->it_focus = NULL;
+   if (inst->timer)
+     ecore_timer_del(inst->timer);
+   inst->timer = NULL;
+   free(inst);
+}
 
 static Eina_Bool
-_menu_focus_cb(void *data)
+_main_menu_focus_timer_cb(void *data)
 {
-   Evas_Object *o = data;
-   elm_object_focus_set(o, 1);
+   Menu_Inst *inst = data;
+   if (inst->it_focus)
+     elm_object_focus_set(inst->it_focus, 1);
+   inst->timer = NULL;
+
    return EINA_FALSE;
 }
 
@@ -382,13 +403,20 @@ evisum_ui_main_menu_create(Ui *ui, Evas_Object *parent, 
Evas_Object *obj)
    elm_box_pack_end(bx, hbox);
 
 
+   Menu_Inst *inst = calloc(1, sizeof(Menu_Inst));
+   if (!inst) return NULL;
+   inst->timer = ecore_timer_add(0.5, _main_menu_focus_timer_cb, inst);
+   inst->it_focus = it_focus;
+   evas_object_event_callback_add(o, EVAS_CALLBACK_DEL,
+                                  _main_menu_deleted_cb, inst);
+
    elm_ctxpopup_direction_priority_set(o, ELM_CTXPOPUP_DIRECTION_UP,
                                        ELM_CTXPOPUP_DIRECTION_DOWN,
                                        ELM_CTXPOPUP_DIRECTION_LEFT,
                                        ELM_CTXPOPUP_DIRECTION_RIGHT);
    evas_object_move(o, ox + (ow / 2), oy + oh);
    evas_object_show(o);
-   ecore_timer_add(0.5, _menu_focus_cb, it_focus);
+
 
    if (parent != ui->proc.win) return o;
 
diff --git a/src/bin/ui/ui_memory.c b/src/bin/ui/ui_memory.c
index 10b2895..30356b6 100644
--- a/src/bin/ui/ui_memory.c
+++ b/src/bin/ui/ui_memory.c
@@ -54,7 +54,12 @@ _mem_usage_main_cb(void *data EINA_UNUSED, Ecore_Thread 
*thread)
           memory.used += memory.zfs_arc_used;
 
         ecore_thread_feedback(thread, &memory);
-        usleep(1000000);
+        for (int i = 0; i < 8; i++)
+           {
+              if (ecore_thread_check(thread))
+                break;
+              usleep(125000);
+           }
      }
 }
 
@@ -186,7 +191,6 @@ _win_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object 
*obj,
    ecore_thread_cancel(pd->thread);
    ecore_thread_wait(pd->thread, 0.5);
 
-   evas_object_del(obj);
    ui->mem.win = NULL;
    free(pd);
 }
@@ -295,7 +299,7 @@ ui_win_memory_add(Ui *ui)
    evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_resize_cb, 
pd);
    evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _win_del_cb, pd);
    evas_object_event_callback_add(win, EVAS_CALLBACK_MOVE, _win_move_cb, pd);
-   evas_object_event_callback_add(tbl, EVAS_CALLBACK_KEY_DOWN, 
_win_key_down_cb, pd);
+   evas_object_event_callback_add(win, EVAS_CALLBACK_KEY_DOWN, 
_win_key_down_cb, pd);
    evas_object_show(win);
 
    pd->thread = ecore_thread_feedback_run(_mem_usage_main_cb,
diff --git a/src/bin/ui/ui_process_list.c b/src/bin/ui/ui_process_list.c
index ac627a7..08b4ba1 100644
--- a/src/bin/ui/ui_process_list.c
+++ b/src/bin/ui/ui_process_list.c
@@ -1550,7 +1550,10 @@ _win_key_down_cb(void *data, Evas *e, Evas_Object *obj, 
void *event_info)
    elm_scroller_region_get(pd->scroller, &x, &y, &w, &h);
 
    if (!strcmp(ev->keyname, "Escape") && !pd->entry_visible)
-     evas_object_del(pd->win);
+     {
+        evas_object_del(pd->win);
+        return;
+     }
    else if (!strcmp(ev->keyname, "Prior"))
      elm_scroller_region_bring_in(pd->scroller, x, y - h, w, h);
    else if (!strcmp(ev->keyname, "Next"))

-- 


Reply via email to