aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-03-17 13:17:02 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-04-28 15:41:54 -0400
commit0b5f65d4a8b61e1497e52aca86d52e58ffce8edf (patch)
treed6c197246b8301e931c7bff172942d78b1a34f91
parentonly set toolbar icon min size if icon exists (diff)
downloadenlightenment-0b5f65d4a8b61e1497e52aca86d52e58ffce8edf.tar.gz
always use jobs to create bryce menus
ensure that menus can never be created during a post event callback in order to avoid crashes ref https://phab.enlightenment.org/T3144 fix https://phab.enlightenment.org/T5262
-rw-r--r--src/bin/e_bryce.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/bin/e_bryce.c b/src/bin/e_bryce.c
index a721ab2ad..2042e7ad6 100644
--- a/src/bin/e_bryce.c
+++ b/src/bin/e_bryce.c
@@ -34,6 +34,7 @@ typedef struct Bryce
unsigned int autohide_blocked;
Eina_List *popups;
void *event_info;
+ Ecore_Job *menu_job;
uint64_t last_timestamp;
/* config: do not bitfield! */
@@ -579,7 +580,8 @@ _bryce_mouse_down_post(void *data, Evas *e EINA_UNUSED)
return EINA_FALSE;
if (ev->button != 3) return EINA_TRUE;
b->last_timestamp = ev->timestamp;
- _bryce_act_menu_job(b);
+ if (!b->menu_job)
+ b->menu_job = ecore_job_add(_bryce_act_menu_job, b);
return EINA_FALSE;
}
@@ -671,6 +673,7 @@ _bryce_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
}
evas_object_del(b->autohide_event);
E_FREE_FUNC(b->calc_job, ecore_job_del);
+ E_FREE_FUNC(b->menu_job, ecore_job_del);
E_FREE_FUNC(b->autohide_timer, ecore_timer_del);
ecore_timer_del(b->save_timer);
EINA_LIST_FREE(b->popups, p)
@@ -980,6 +983,7 @@ _bryce_act_menu_job(void *data)
m = e_menu_new();
_bryce_menu_populate(b, m);
+ b->menu_job = NULL;
evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
e_menu_activate_mouse(m, e_zone_current_get(), x, y, 1, 1, E_MENU_POP_DIRECTION_AUTO, b->last_timestamp);
_bryce_popup(b, m->comp_object);
@@ -992,8 +996,8 @@ _bryce_act_menu(E_Object *obj, const char *params EINA_UNUSED, E_Binding_Event_M
if (obj->type != E_BRYCE_TYPE) return EINA_FALSE;
b = e_object_data_get(obj);
b->last_timestamp = ev->timestamp;
- /* FIXME: T3144 */
- ecore_job_add(_bryce_act_menu_job, b);
+ if (!b->menu_job)
+ b->menu_job = ecore_job_add(_bryce_act_menu_job, b);
return EINA_TRUE;
}