forked from enlightenment/enlightenment
clean up gadget right click menus to stop leaking
SVN revision: 75285
This commit is contained in:
parent
d17c66d771
commit
94e2fc5257
|
@ -28,7 +28,6 @@ struct _Instance
|
|||
E_Gadcon_Client *gcc;
|
||||
Evas_Object *o_backlight, *o_table, *o_slider;
|
||||
E_Gadcon_Popup *popup;
|
||||
E_Menu *menu;
|
||||
double val;
|
||||
Ecore_X_Window input_win;
|
||||
Ecore_Event_Handler *hand_mouse_down;
|
||||
|
@ -55,6 +54,7 @@ _backlight_gadget_update(Instance *inst)
|
|||
static void
|
||||
_backlight_input_win_del(Instance *inst)
|
||||
{
|
||||
if (inst->input_win) return;
|
||||
e_grabinput_release(0, inst->input_win);
|
||||
ecore_x_window_free(inst->input_win);
|
||||
inst->input_win = 0;
|
||||
|
@ -262,19 +262,6 @@ _backlight_popup_free(Instance *inst)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_backlight_menu_cb_post(void *data, E_Menu *menu __UNUSED__)
|
||||
{
|
||||
Instance *inst = data;
|
||||
if ((!inst) || (!inst->menu))
|
||||
return;
|
||||
if (inst->menu)
|
||||
{
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_backlight_menu_cb_cfg(void *data, E_Menu *menu __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
||||
{
|
||||
|
@ -296,7 +283,7 @@ _backlight_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __U
|
|||
if (inst->popup) _backlight_popup_free(inst);
|
||||
else _backlight_popup_new(inst);
|
||||
}
|
||||
else if ((ev->button == 3) && (!inst->menu))
|
||||
else if (ev->button == 3)
|
||||
{
|
||||
E_Zone *zone;
|
||||
E_Menu *m;
|
||||
|
@ -313,8 +300,6 @@ _backlight_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __U
|
|||
e_menu_item_callback_set(mi, _backlight_menu_cb_cfg, inst);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _backlight_menu_cb_post, inst);
|
||||
inst->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y, NULL, NULL);
|
||||
e_menu_activate_mouse(m, zone, x + ev->output.x, y + ev->output.y,
|
||||
|
@ -405,13 +390,7 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
Instance *inst;
|
||||
|
||||
inst = gcc->data;
|
||||
if (inst->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(inst->menu, NULL, NULL);
|
||||
_backlight_input_win_del(inst);
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
_backlight_popup_free(inst);
|
||||
backlight_instances = eina_list_remove(backlight_instances, inst);
|
||||
evas_object_del(inst->o_backlight);
|
||||
|
|
|
@ -42,7 +42,6 @@ static void _battery_update(int full, int time_left, int time_full, Eina_Bo
|
|||
static Eina_Bool _battery_cb_exe_data(void *data, int type, void *event);
|
||||
static Eina_Bool _battery_cb_exe_del(void *data, int type, void *event);
|
||||
static void _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _menu_cb_post(void *data, E_Menu *m);
|
||||
static void _battery_face_level_set(Evas_Object *battery, double level);
|
||||
static void _battery_face_time_set(Evas_Object *battery, int time);
|
||||
static void _battery_face_cb_menu_powermanagement(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
|
@ -183,7 +182,7 @@ _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
|
||||
inst = data;
|
||||
ev = event_info;
|
||||
if ((ev->button == 3) && (!battery_config->menu))
|
||||
if (ev->button == 3)
|
||||
{
|
||||
E_Menu *m;
|
||||
E_Menu_Item *mi;
|
||||
|
@ -203,8 +202,6 @@ _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
}
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _menu_cb_post, inst);
|
||||
battery_config->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon,
|
||||
&cx, &cy, NULL, NULL);
|
||||
|
@ -212,19 +209,13 @@ _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
e_util_zone_current_get(e_manager_current_get()),
|
||||
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
if (ev->button == 1)
|
||||
_battery_cb_warning_popup_hide(data, e, obj, event_info);
|
||||
}
|
||||
|
||||
static void
|
||||
_menu_cb_post(void *data __UNUSED__, E_Menu *m __UNUSED__)
|
||||
{
|
||||
if (!battery_config->menu) return;
|
||||
e_object_del(E_OBJECT(battery_config->menu));
|
||||
battery_config->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_battery_face_level_set(Evas_Object *battery, double level)
|
||||
{
|
||||
|
@ -855,12 +846,6 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
|
|||
|
||||
if (battery_config->config_dialog)
|
||||
e_object_del(E_OBJECT(battery_config->config_dialog));
|
||||
if (battery_config->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(battery_config->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(battery_config->menu));
|
||||
battery_config->menu = NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_EEZE
|
||||
_battery_udev_stop();
|
||||
|
|
|
@ -39,7 +39,6 @@ struct _Config
|
|||
E_Module *module;
|
||||
E_Config_Dialog *config_dialog;
|
||||
Eina_List *instances;
|
||||
E_Menu *menu;
|
||||
Ecore_Exe *batget_exe;
|
||||
Ecore_Event_Handler *batget_data_handler;
|
||||
Ecore_Event_Handler *batget_del_handler;
|
||||
|
|
|
@ -749,20 +749,6 @@ _bluez_popup_new(E_Bluez_Instance *inst)
|
|||
if (needs_scan) _bluez_popup_cb_scan(inst, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_bluez_menu_cb_post(void *data,
|
||||
E_Menu *menu __UNUSED__)
|
||||
{
|
||||
E_Bluez_Instance *inst = data;
|
||||
if ((!inst) || (!inst->menu))
|
||||
return;
|
||||
if (inst->menu)
|
||||
{
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_bluez_menu_cb_cfg(void *data,
|
||||
E_Menu *menu __UNUSED__,
|
||||
|
@ -796,8 +782,6 @@ _bluez_menu_new(E_Bluez_Instance *inst,
|
|||
e_menu_item_callback_set(mi, _bluez_menu_cb_cfg, inst);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _bluez_menu_cb_post, inst);
|
||||
inst->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y, NULL, NULL);
|
||||
e_menu_activate_mouse(m, zone, x + ev->output.x, y + ev->output.y,
|
||||
|
@ -858,7 +842,7 @@ _bluez_cb_mouse_down(void *data,
|
|||
}
|
||||
else if (ev->button == 2)
|
||||
_bluez_toggle_powered(inst);
|
||||
else if ((ev->button == 3) && (!inst->menu))
|
||||
else if (ev->button == 3)
|
||||
_bluez_menu_new(inst, ev);
|
||||
}
|
||||
|
||||
|
@ -1044,11 +1028,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
if (!inst)
|
||||
return;
|
||||
|
||||
if (inst->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(inst->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
}
|
||||
evas_object_del(inst->ui.gadget);
|
||||
|
||||
_bluez_devices_clear(inst);
|
||||
|
|
|
@ -25,7 +25,6 @@ struct E_Bluez_Instance
|
|||
E_Bluez_Module_Context *ctxt;
|
||||
E_Gadcon_Client *gcc;
|
||||
E_Gadcon_Popup *popup;
|
||||
E_Menu *menu;
|
||||
|
||||
/* used by popup */
|
||||
int powered;
|
||||
|
|
|
@ -33,7 +33,6 @@ struct _Instance
|
|||
E_Gadcon_Client *gcc;
|
||||
Evas_Object *o_clock, *o_table, *o_popclock, *o_cal;
|
||||
E_Gadcon_Popup *popup;
|
||||
E_Menu *menu;
|
||||
|
||||
int madj;
|
||||
|
||||
|
@ -495,19 +494,6 @@ _clock_popup_free(Instance *inst)
|
|||
inst->o_popclock = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_menu_cb_post(void *data, E_Menu *menu __UNUSED__)
|
||||
{
|
||||
Instance *inst = data;
|
||||
if ((!inst) || (!inst->menu))
|
||||
return;
|
||||
if (inst->menu)
|
||||
{
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_menu_cb_cfg(void *data, E_Menu *menu __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
||||
{
|
||||
|
@ -534,7 +520,7 @@ _clock_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSE
|
|||
if (inst->popup) _clock_popup_free(inst);
|
||||
else _clock_popup_new(inst);
|
||||
}
|
||||
else if ((ev->button == 3) && (!inst->menu))
|
||||
else if (ev->button == 3)
|
||||
{
|
||||
E_Zone *zone;
|
||||
E_Menu *m;
|
||||
|
@ -551,8 +537,6 @@ _clock_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSE
|
|||
e_menu_item_callback_set(mi, _clock_menu_cb_cfg, inst);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _clock_menu_cb_post, inst);
|
||||
inst->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y, NULL, NULL);
|
||||
e_menu_activate_mouse(m, zone, x + ev->output.x, y + ev->output.y,
|
||||
|
@ -631,12 +615,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
Instance *inst;
|
||||
|
||||
inst = gcc->data;
|
||||
if (inst->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(inst->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
clock_instances = eina_list_remove(clock_instances, inst);
|
||||
evas_object_del(inst->o_clock);
|
||||
_clock_popup_free(inst);
|
||||
|
|
|
@ -1276,20 +1276,6 @@ _connman_popup_new(E_Connman_Instance *inst)
|
|||
_connman_popup_input_window_create(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_connman_menu_cb_post(void *data,
|
||||
E_Menu *menu __UNUSED__)
|
||||
{
|
||||
E_Connman_Instance *inst = data;
|
||||
if ((!inst) || (!inst->menu))
|
||||
return;
|
||||
if (inst->menu)
|
||||
{
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_connman_menu_cb_cfg(void *data,
|
||||
E_Menu *menu __UNUSED__,
|
||||
|
@ -1325,8 +1311,6 @@ _connman_menu_new(E_Connman_Instance *inst,
|
|||
e_menu_item_callback_set(mi, _connman_menu_cb_cfg, inst);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _connman_menu_cb_post, inst);
|
||||
inst->menu = m;
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y, NULL, NULL);
|
||||
e_menu_activate_mouse(m, zone, x + ev->output.x, y + ev->output.y,
|
||||
1, 1, E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
|
@ -1386,7 +1370,7 @@ _connman_cb_mouse_down(void *data,
|
|||
}
|
||||
else if (ev->button == 2)
|
||||
_connman_toggle_offline_mode(inst->ctxt);
|
||||
else if ((ev->button == 3) && (!inst->menu))
|
||||
else if (ev->button == 3)
|
||||
_connman_menu_new(inst, ev);
|
||||
}
|
||||
|
||||
|
@ -1651,11 +1635,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
if (!inst)
|
||||
return;
|
||||
|
||||
if (inst->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(inst->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
}
|
||||
evas_object_del(inst->ui.gadget);
|
||||
|
||||
ctxt->instances = eina_list_remove(ctxt->instances, inst);
|
||||
|
|
|
@ -161,8 +161,6 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
|
|||
Instance *inst;
|
||||
Evas_Event_Mouse_Down *ev;
|
||||
|
||||
if (cpufreq_config->menu) return;
|
||||
|
||||
inst = data;
|
||||
ev = event_info;
|
||||
|
||||
|
@ -352,8 +350,6 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
|
|||
|
||||
m = e_menu_new();
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
cpufreq_config->menu = m;
|
||||
e_menu_post_deactivate_callback_set(m, _menu_cb_post, NULL);
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon,
|
||||
&cx, &cy, NULL, NULL);
|
||||
|
@ -362,6 +358,8 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
|
|||
e_util_zone_current_get(e_manager_current_get()),
|
||||
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ struct _Instance
|
|||
Evry_Window *win;
|
||||
Gadget_Config *cfg;
|
||||
E_Config_Dialog *cfd;
|
||||
E_Menu *menu;
|
||||
|
||||
int mouse_down;
|
||||
|
||||
|
@ -225,16 +224,6 @@ _del_func(void *data, void *obj __UNUSED__)
|
|||
edje_object_signal_emit(inst->o_button, "e,state,unfocused", "e");
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_menu_post(void *data, E_Menu *m __UNUSED__)
|
||||
{
|
||||
Instance *inst = data;
|
||||
|
||||
if (!inst->menu) return;
|
||||
/* e_object_del(E_OBJECT(inst->menu)); */
|
||||
inst->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_menu_configure(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
||||
{
|
||||
|
@ -511,7 +500,7 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
|
|||
|
||||
edje_object_signal_emit(inst->o_button, "e,state,focused", "e");
|
||||
}
|
||||
else if ((ev->button == 3) && (!inst->menu))
|
||||
else if (ev->button == 3)
|
||||
{
|
||||
E_Menu *m;
|
||||
E_Menu_Item *mi;
|
||||
|
@ -524,8 +513,6 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
|
|||
e_menu_item_callback_set(mi, _cb_menu_configure, inst);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _cb_menu_post, inst);
|
||||
inst->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy,
|
||||
NULL, NULL);
|
||||
|
@ -533,6 +520,8 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
|
|||
e_util_zone_current_get(e_manager_current_get()),
|
||||
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -327,6 +327,8 @@ _cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
ecore_x_pointer_xy_get(zone->container->win, &x, &y);
|
||||
e_menu_activate_mouse(m, zone, x, y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1151,6 +1151,8 @@ on_frame_click(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
e_util_zone_current_get(e_manager_current_get()),
|
||||
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||
evas_event_feed_mouse_up(gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,6 @@ static void _ibar_cb_menu_icon_add(void *data, E_Menu *m, E_Menu_Item *m
|
|||
static void _ibar_cb_menu_icon_properties(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _ibar_cb_menu_icon_remove(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _ibar_cb_menu_configuration(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _ibar_cb_menu_post(void *data, E_Menu *m);
|
||||
static void _ibar_cb_icon_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _ibar_cb_icon_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _ibar_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
|
@ -369,15 +368,14 @@ _ibar_cb_empty_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
|
|||
{
|
||||
Evas_Event_Mouse_Down *ev;
|
||||
IBar *b;
|
||||
|
||||
ev = event_info;
|
||||
b = data;
|
||||
if (!ibar_config->menu)
|
||||
{
|
||||
E_Menu *m;
|
||||
E_Menu_Item *mi;
|
||||
int cx, cy, cw, ch;
|
||||
|
||||
ev = event_info;
|
||||
b = data;
|
||||
if (ev->button != 3) return;
|
||||
|
||||
m = e_menu_new();
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Settings"));
|
||||
|
@ -385,8 +383,6 @@ _ibar_cb_empty_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
|
|||
e_menu_item_callback_set(mi, _ibar_cb_menu_configuration, b);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(b->inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _ibar_cb_menu_post, NULL);
|
||||
ibar_config->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(b->inst->gcc->gadcon,
|
||||
&cx, &cy, &cw, &ch);
|
||||
|
@ -394,7 +390,8 @@ _ibar_cb_empty_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
|
|||
e_util_zone_current_get(e_manager_current_get()),
|
||||
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||
}
|
||||
evas_event_feed_mouse_up(b->inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -628,12 +625,6 @@ _ibar_icon_free(IBar_Icon *ic)
|
|||
{
|
||||
if (ic->reset_timer) ecore_timer_del(ic->reset_timer);
|
||||
ic->reset_timer = NULL;
|
||||
if (ibar_config->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(ibar_config->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(ibar_config->menu));
|
||||
ibar_config->menu = NULL;
|
||||
}
|
||||
if (ic->ibar->ic_drop_before == ic)
|
||||
ic->ibar->ic_drop_before = NULL;
|
||||
_ibar_icon_empty(ic);
|
||||
|
@ -789,14 +780,6 @@ _ibar_cb_menu_configuration(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __
|
|||
}
|
||||
*/
|
||||
|
||||
static void
|
||||
_ibar_cb_menu_post(void *data __UNUSED__, E_Menu *m __UNUSED__)
|
||||
{
|
||||
if (!ibar_config->menu) return;
|
||||
e_object_del(E_OBJECT(ibar_config->menu));
|
||||
ibar_config->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_ibar_cb_icon_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
|
@ -841,7 +824,7 @@ _ibar_cb_icon_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
|||
ic->drag.dnd = 0;
|
||||
ic->mouse_down = 1;
|
||||
}
|
||||
else if ((ev->button == 3) && (!ibar_config->menu))
|
||||
else if (ev->button == 3)
|
||||
{
|
||||
E_Menu *m, *mo;
|
||||
E_Menu_Item *mi;
|
||||
|
@ -878,8 +861,6 @@ _ibar_cb_icon_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
|||
e_menu_item_callback_set(mi, _ibar_cb_menu_configuration, ic->ibar);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(ic->ibar->inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _ibar_cb_menu_post, NULL);
|
||||
ibar_config->menu = m;
|
||||
|
||||
mi = e_menu_item_new(mo);
|
||||
e_menu_item_label_set(mi, _("Properties"));
|
||||
|
@ -1800,13 +1781,6 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
|
|||
EINA_LIST_FREE(ibar_config->handlers, eh)
|
||||
ecore_event_handler_del(eh);
|
||||
|
||||
if (ibar_config->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(ibar_config->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(ibar_config->menu));
|
||||
ibar_config->menu = NULL;
|
||||
}
|
||||
|
||||
EINA_LIST_FREE(ibar_config->items, ci)
|
||||
{
|
||||
if (ci->id) eina_stringshare_del(ci->id);
|
||||
|
|
|
@ -12,7 +12,6 @@ struct _Config
|
|||
E_Module *module;
|
||||
E_Config_Dialog *config_dialog;
|
||||
Eina_List *instances;
|
||||
E_Menu *menu;
|
||||
Eina_List *handlers;
|
||||
};
|
||||
|
||||
|
|
|
@ -88,7 +88,6 @@ static void _ibox_icon_empty(IBox_Icon *ic);
|
|||
static void _ibox_icon_signal_emit(IBox_Icon *ic, char *sig, char *src);
|
||||
static Eina_List *_ibox_zone_find(E_Zone *zone);
|
||||
static void _ibox_cb_obj_moveresize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _ibox_cb_menu_post(void *data, E_Menu *m);
|
||||
static void _ibox_cb_menu_configuration(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _ibox_cb_icon_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _ibox_cb_icon_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
|
@ -288,15 +287,14 @@ _ibox_cb_empty_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
|
|||
{
|
||||
Evas_Event_Mouse_Down *ev;
|
||||
IBox *b;
|
||||
|
||||
ev = event_info;
|
||||
b = data;
|
||||
if (!ibox_config->menu)
|
||||
{
|
||||
E_Menu *m;
|
||||
E_Menu_Item *mi;
|
||||
int cx, cy;
|
||||
|
||||
ev = event_info;
|
||||
b = data;
|
||||
if (ev->button != 3) return;
|
||||
|
||||
m = e_menu_new();
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Settings"));
|
||||
|
@ -304,8 +302,6 @@ _ibox_cb_empty_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
|
|||
e_menu_item_callback_set(mi, _ibox_cb_menu_configuration, b);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(b->inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _ibox_cb_menu_post, NULL);
|
||||
ibox_config->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(b->inst->gcc->gadcon,
|
||||
&cx, &cy, NULL, NULL);
|
||||
|
@ -313,7 +309,8 @@ _ibox_cb_empty_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
|
|||
e_util_zone_current_get(e_manager_current_get()),
|
||||
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||
}
|
||||
evas_event_feed_mouse_up(b->inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -518,12 +515,6 @@ _ibox_icon_new(IBox *b, E_Border *bd)
|
|||
static void
|
||||
_ibox_icon_free(IBox_Icon *ic)
|
||||
{
|
||||
if (ibox_config->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(ibox_config->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(ibox_config->menu));
|
||||
ibox_config->menu = NULL;
|
||||
}
|
||||
if (ic->ibox->ic_drop_before == ic)
|
||||
ic->ibox->ic_drop_before = NULL;
|
||||
_ibox_icon_empty(ic);
|
||||
|
@ -635,14 +626,6 @@ _ibox_cb_obj_moveresize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE
|
|||
_ibox_instance_drop_zone_recalc(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_ibox_cb_menu_post(void *data __UNUSED__, E_Menu *m __UNUSED__)
|
||||
{
|
||||
if (!ibox_config->menu) return;
|
||||
e_object_del(E_OBJECT(ibox_config->menu));
|
||||
ibox_config->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_ibox_cb_icon_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
|
@ -683,7 +666,7 @@ _ibox_cb_icon_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
|||
ic->drag.start = 1;
|
||||
ic->drag.dnd = 0;
|
||||
}
|
||||
else if ((ev->button == 3) && (!ibox_config->menu))
|
||||
else if (ev->button == 3)
|
||||
{
|
||||
E_Menu *m;
|
||||
E_Menu_Item *mi;
|
||||
|
@ -698,8 +681,6 @@ _ibox_cb_icon_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
|||
e_menu_item_callback_set(mi, _ibox_cb_menu_configuration, ic->ibox);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(ic->ibox->inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _ibox_cb_menu_post, NULL);
|
||||
ibox_config->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(ic->ibox->inst->gcc->gadcon,
|
||||
&cx, &cy, NULL, NULL);
|
||||
|
@ -1397,12 +1378,6 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
|
|||
*/
|
||||
e_object_del(E_OBJECT(ibox_config->config_dialog->data));
|
||||
|
||||
if (ibox_config->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(ibox_config->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(ibox_config->menu));
|
||||
ibox_config->menu = NULL;
|
||||
}
|
||||
while (ibox_config->items)
|
||||
{
|
||||
Config_Item *ci;
|
||||
|
|
|
@ -9,7 +9,6 @@ struct _Config
|
|||
/* just config state */
|
||||
E_Module *module;
|
||||
Eina_List *instances;
|
||||
E_Menu *menu;
|
||||
Eina_List *handlers;
|
||||
Eina_List *items;
|
||||
Eina_List *config_dialog;
|
||||
|
|
|
@ -751,19 +751,6 @@ _mixer_popup_timer_cb(void *data)
|
|||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
static void
|
||||
_mixer_menu_cb_post(void *data, E_Menu *menu __UNUSED__)
|
||||
{
|
||||
E_Mixer_Instance *inst = data;
|
||||
if ((!inst) || (!inst->menu))
|
||||
return;
|
||||
if (inst->menu)
|
||||
{
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_mixer_menu_cb_cfg(void *data, E_Menu *menu __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
||||
{
|
||||
|
@ -794,9 +781,6 @@ _mixer_menu_new(E_Mixer_Instance *inst, Evas_Event_Mouse_Down *ev)
|
|||
e_menu_item_callback_set(mi, _mixer_menu_cb_cfg, inst);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _mixer_menu_cb_post, inst);
|
||||
inst->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y, NULL, NULL);
|
||||
e_menu_activate_mouse(m, zone, x + ev->output.x, y + ev->output.y,
|
||||
1, 1, E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
|
@ -819,7 +803,7 @@ _mixer_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSE
|
|||
}
|
||||
else if (ev->button == 2)
|
||||
_mixer_toggle_mute(inst, EINA_FALSE);
|
||||
else if ((ev->button == 3) && (!inst->menu))
|
||||
else if (ev->button == 3)
|
||||
_mixer_menu_new(inst, ev);
|
||||
}
|
||||
|
||||
|
@ -1098,11 +1082,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
if (!inst)
|
||||
return;
|
||||
|
||||
if (inst->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(inst->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
}
|
||||
evas_object_del(inst->ui.gadget);
|
||||
e_mod_mixer_channel_del(inst->channel);
|
||||
e_mod_mixer_del(inst->sys);
|
||||
|
|
|
@ -35,7 +35,6 @@ typedef struct E_Mixer_Instance
|
|||
E_Gadcon_Client *gcc;
|
||||
E_Gadcon_Popup *popup;
|
||||
Ecore_Timer *popup_timer;
|
||||
E_Menu *menu;
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -32,9 +32,6 @@ static void _notification_box_icon_signal_emit(Notification_Box_Icon *ic,
|
|||
static E_Border *_notification_find_source_border(E_Notification *n);
|
||||
|
||||
/* Notification box callbacks */
|
||||
static void _notification_box_cb_menu_post(void *data,
|
||||
E_Menu *m);
|
||||
|
||||
void
|
||||
notification_box_notify(E_Notification *n,
|
||||
unsigned int replaces_id,
|
||||
|
@ -297,12 +294,6 @@ _notification_box_find(E_Notification_Urgency urgency)
|
|||
static void
|
||||
_notification_box_icon_free(Notification_Box_Icon *ic)
|
||||
{
|
||||
if (notification_cfg->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(notification_cfg->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(notification_cfg->menu));
|
||||
notification_cfg->menu = NULL;
|
||||
}
|
||||
_notification_box_icon_empty(ic);
|
||||
evas_object_del(ic->o_holder);
|
||||
evas_object_del(ic->o_holder2);
|
||||
|
@ -456,15 +447,6 @@ _notification_find_source_border(E_Notification *n)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_notification_box_cb_menu_post(void *data __UNUSED__,
|
||||
E_Menu *m __UNUSED__)
|
||||
{
|
||||
if (!notification_cfg->menu) return;
|
||||
e_object_del(E_OBJECT(notification_cfg->menu));
|
||||
notification_cfg->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_notification_box_cb_menu_configuration(Notification_Box *b,
|
||||
E_Menu *m __UNUSED__,
|
||||
|
@ -490,22 +472,21 @@ _notification_box_cb_empty_mouse_down(Notification_Box *b,
|
|||
E_Menu_Item *mi;
|
||||
int cx, cy, cw, ch;
|
||||
|
||||
if (notification_cfg->menu) return;
|
||||
m = e_menu_new();
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Settings"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-system");
|
||||
e_menu_item_callback_set(mi, (E_Menu_Cb)_notification_box_cb_menu_configuration, b);
|
||||
|
||||
notification_cfg->menu = m = e_gadcon_client_util_menu_items_append(b->inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _notification_box_cb_menu_post, NULL);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(b->inst->gcc, m, 0);
|
||||
e_gadcon_canvas_zone_geometry_get(b->inst->gcc->gadcon,
|
||||
&cx, &cy, &cw, &ch);
|
||||
e_menu_activate_mouse(m,
|
||||
e_util_zone_current_get(e_manager_current_get()),
|
||||
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||
evas_event_feed_mouse_up(b->inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -628,7 +609,7 @@ _notification_box_cb_icon_mouse_down(Notification_Box_Icon *ic,
|
|||
E_Menu_Item *mi;
|
||||
int cx, cy, cw, ch;
|
||||
|
||||
if (notification_cfg->menu || (ev->button != 3)) return;
|
||||
if (ev->button != 3) return;
|
||||
|
||||
m = e_menu_new();
|
||||
mi = e_menu_item_new(m);
|
||||
|
@ -637,9 +618,6 @@ _notification_box_cb_icon_mouse_down(Notification_Box_Icon *ic,
|
|||
e_menu_item_callback_set(mi, (E_Menu_Cb)_notification_box_cb_menu_configuration, ic->n_box);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(ic->n_box->inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _notification_box_cb_menu_post, NULL);
|
||||
notification_cfg->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(ic->n_box->inst->gcc->gadcon,
|
||||
&cx, &cy, &cw, &ch);
|
||||
e_menu_activate_mouse(m,
|
||||
|
|
|
@ -383,13 +383,6 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
|
|||
e_configure_registry_item_del("extensions/notification");
|
||||
e_configure_registry_category_del("extensions");
|
||||
|
||||
if (notification_cfg->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(notification_cfg->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(notification_cfg->menu));
|
||||
notification_cfg->menu = NULL;
|
||||
}
|
||||
|
||||
EINA_LIST_FREE(notification_cfg->items, ci)
|
||||
{
|
||||
eina_stringshare_del(ci->id);
|
||||
|
|
|
@ -54,7 +54,6 @@ struct _Config
|
|||
Eina_List *instances;
|
||||
Eina_List *n_box;
|
||||
Eina_List *config_dialog;
|
||||
E_Menu *menu;
|
||||
Eina_List *handlers;
|
||||
Eina_List *items;
|
||||
Eina_List *popups;
|
||||
|
|
|
@ -216,20 +216,6 @@ _ofono_popup_new(E_Ofono_Instance *inst)
|
|||
_ofono_popup_input_window_create(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_ofono_menu_cb_post(void *data,
|
||||
E_Menu *menu __UNUSED__)
|
||||
{
|
||||
E_Ofono_Instance *inst = data;
|
||||
if ((!inst) || (!inst->menu))
|
||||
return;
|
||||
if (inst->menu)
|
||||
{
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_ofono_menu_new(E_Ofono_Instance *inst,
|
||||
Evas_Event_Mouse_Down *ev)
|
||||
|
@ -242,8 +228,6 @@ _ofono_menu_new(E_Ofono_Instance *inst,
|
|||
|
||||
m = e_menu_new();
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _ofono_menu_cb_post, inst);
|
||||
inst->menu = m;
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y, NULL, NULL);
|
||||
e_menu_activate_mouse(m, zone, x + ev->output.x, y + ev->output.y,
|
||||
1, 1, E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
|
@ -303,7 +287,7 @@ _ofono_cb_mouse_down(void *data,
|
|||
}
|
||||
else if (ev->button == 2)
|
||||
_ofono_popup_cb_powered_changed(inst, inst->ui.powered, NULL);
|
||||
else if ((ev->button == 3) && (!inst->menu))
|
||||
else if (ev->button == 3)
|
||||
_ofono_menu_new(inst, ev);
|
||||
}
|
||||
|
||||
|
@ -473,11 +457,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
if (!inst)
|
||||
return;
|
||||
|
||||
if (inst->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(inst->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
}
|
||||
if (inst->popup)
|
||||
_ofono_popup_del(inst);
|
||||
if (inst->tip)
|
||||
|
|
|
@ -26,7 +26,6 @@ struct E_Ofono_Instance
|
|||
E_Ofono_Module_Context *ctxt;
|
||||
E_Gadcon_Client *gcc;
|
||||
E_Gadcon_Popup *popup;
|
||||
E_Menu *menu;
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -100,7 +100,6 @@ struct _Pager_Popup
|
|||
static void _pager_desk_livethumb_setup(Pager_Desk *pd);
|
||||
static void _pager_cb_obj_moveresize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__);
|
||||
static void _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info);
|
||||
static void _menu_cb_post(void *data __UNUSED__, E_Menu *m __UNUSED__);
|
||||
static void _pager_inst_cb_menu_configure(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__);
|
||||
static void _pager_inst_cb_menu_virtual_desktops_dialog(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__);
|
||||
static void _pager_instance_drop_zone_recalc(Instance *inst);
|
||||
|
@ -859,15 +858,14 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
|
|||
{
|
||||
Instance *inst;
|
||||
Evas_Event_Mouse_Down *ev;
|
||||
|
||||
inst = data;
|
||||
ev = event_info;
|
||||
if ((ev->button == 3) && (!pager_config->menu))
|
||||
{
|
||||
E_Menu *m;
|
||||
E_Menu_Item *mi;
|
||||
int cx, cy;
|
||||
|
||||
inst = data;
|
||||
ev = event_info;
|
||||
if (ev->button != 3) return;
|
||||
|
||||
m = e_menu_new();
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Settings"));
|
||||
|
@ -875,9 +873,6 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
|
|||
e_menu_item_callback_set(mi, _pager_inst_cb_menu_configure, NULL);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _menu_cb_post, inst);
|
||||
pager_config->menu = m;
|
||||
|
||||
if (e_configure_registry_exists("screen/virtual_desktops"))
|
||||
{
|
||||
mi = e_menu_item_new_relative(m, NULL);
|
||||
|
@ -888,19 +883,11 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
|
|||
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy,
|
||||
NULL, NULL);
|
||||
e_menu_activate_mouse(m,
|
||||
e_util_zone_current_get(e_manager_current_get()),
|
||||
e_menu_activate_mouse(m, e_util_zone_current_get(e_manager_current_get()),
|
||||
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_menu_cb_post(void *data __UNUSED__, E_Menu *m __UNUSED__)
|
||||
{
|
||||
if (!pager_config->menu) return;
|
||||
e_object_del(E_OBJECT(pager_config->menu));
|
||||
pager_config->menu = NULL;
|
||||
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3009,13 +2996,6 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
|
|||
eina_list_remove_list(pager_config->handlers, pager_config->handlers);
|
||||
}
|
||||
|
||||
if (pager_config->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(pager_config->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(pager_config->menu));
|
||||
pager_config->menu = NULL;
|
||||
}
|
||||
|
||||
e_configure_registry_item_del("extensions/pager");
|
||||
|
||||
e_action_del("pager_show");
|
||||
|
|
|
@ -37,7 +37,6 @@ struct _Config
|
|||
E_Module *module;
|
||||
E_Config_Dialog *config_dialog;
|
||||
Eina_List *instances, *handlers;
|
||||
E_Menu *menu;
|
||||
};
|
||||
|
||||
EAPI extern E_Module_Api e_modapi;
|
||||
|
|
|
@ -64,7 +64,7 @@ _cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
|
||||
inst = data;
|
||||
ev = event_info;
|
||||
if ((ev->button != 3) || (inst->gcc->menu)) return;
|
||||
if (ev->button != 3) return;
|
||||
zone = e_util_zone_current_get(e_manager_current_get());
|
||||
|
||||
m = e_menu_new();
|
||||
|
@ -77,6 +77,8 @@ _cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
ecore_x_pointer_xy_get(zone->container->win, &x, &y);
|
||||
e_menu_activate_mouse(m, zone, x, y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
|
||||
static E_Gadcon_Client *
|
||||
|
|
|
@ -84,7 +84,6 @@ struct _Instance
|
|||
Ecore_Job *size_apply;
|
||||
} job;
|
||||
Eina_List *icons;
|
||||
E_Menu *menu;
|
||||
};
|
||||
|
||||
static const char _Name[] = "Systray";
|
||||
|
@ -142,15 +141,6 @@ _systray_theme_path(void)
|
|||
#undef TF
|
||||
}
|
||||
|
||||
static void
|
||||
_systray_menu_cb_post(void *data, E_Menu *menu __UNUSED__)
|
||||
{
|
||||
Instance *inst = data;
|
||||
if (!inst->menu) return;
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_systray_menu_new(Instance *inst, Evas_Event_Mouse_Down *ev)
|
||||
{
|
||||
|
@ -162,11 +152,11 @@ _systray_menu_new(Instance *inst, Evas_Event_Mouse_Down *ev)
|
|||
|
||||
m = e_menu_new();
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _systray_menu_cb_post, inst);
|
||||
inst->menu = m;
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y, NULL, NULL);
|
||||
e_menu_activate_mouse(m, zone, x + ev->output.x, y + ev->output.y,
|
||||
1, 1, E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -175,7 +165,7 @@ _systray_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNU
|
|||
Instance *inst = data;
|
||||
Evas_Event_Mouse_Down *ev = event;
|
||||
|
||||
if ((ev->button == 3) && (!inst->menu))
|
||||
if (ev->button == 3)
|
||||
_systray_menu_new(inst, ev);
|
||||
}
|
||||
|
||||
|
@ -1000,12 +990,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
if (!inst)
|
||||
return;
|
||||
|
||||
if (inst->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(inst->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
}
|
||||
|
||||
_systray_deactivate(inst);
|
||||
evas_object_del(inst->ui.gadget);
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ static const E_Gadcon_Client_Class _gadcon_class =
|
|||
/* actual module specifics */
|
||||
|
||||
static void _temperature_face_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _temperature_face_cb_post_menu(void *data, E_Menu *m);
|
||||
|
||||
static void _temperature_face_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
|
||||
|
@ -159,8 +158,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
inst->o_temp = NULL;
|
||||
if (inst->config_dialog) e_object_del(E_OBJECT(inst->config_dialog));
|
||||
inst->config_dialog = NULL;
|
||||
if (inst->menu) e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -222,7 +219,7 @@ _temperature_face_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj
|
|||
|
||||
inst = data;
|
||||
ev = event_info;
|
||||
if ((ev->button == 3) && (!inst->menu))
|
||||
if (ev->button == 3)
|
||||
{
|
||||
E_Menu *m;
|
||||
E_Menu_Item *mi;
|
||||
|
@ -235,29 +232,16 @@ _temperature_face_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj
|
|||
e_menu_item_callback_set(mi, _temperature_face_cb_menu_configure, inst);
|
||||
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
||||
e_menu_post_deactivate_callback_set(m, _temperature_face_cb_post_menu, inst);
|
||||
inst->menu = m;
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon,
|
||||
&cx, &cy, NULL, NULL);
|
||||
e_menu_activate_mouse(m,
|
||||
e_util_zone_current_get(e_manager_current_get()),
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, NULL, NULL);
|
||||
e_menu_activate_mouse(m, e_util_zone_current_get(e_manager_current_get()),
|
||||
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_temperature_face_cb_post_menu(void *data, E_Menu *m __UNUSED__)
|
||||
{
|
||||
Config_Face *inst;
|
||||
|
||||
inst = data;
|
||||
if (!inst->menu) return;
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
_temperature_face_level_set(Config_Face *inst, double level)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,6 @@ static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *ev
|
|||
/* EVENTS */
|
||||
static Eina_Bool _xkb_changed(void *data, int type, void *event_info);
|
||||
static void _e_xkb_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
static void _e_xkb_cb_menu_post(void *data, E_Menu *menu __UNUSED__);
|
||||
static void _e_xkb_cb_menu_configure(void *data, E_Menu *mn, E_Menu_Item *mi __UNUSED__);
|
||||
static void _e_xkb_cb_lmenu_post(void *data, E_Menu *menu __UNUSED__);
|
||||
static void _e_xkb_cb_lmenu_set(void *data, E_Menu *mn __UNUSED__, E_Menu_Item *mi __UNUSED__);
|
||||
|
@ -31,7 +30,6 @@ typedef struct _Instance
|
|||
Evas_Object *o_xkbswitch;
|
||||
Evas_Object *o_xkbflag;
|
||||
|
||||
E_Menu *menu;
|
||||
E_Menu *lmenu;
|
||||
} Instance;
|
||||
|
||||
|
@ -218,12 +216,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
if (!(inst = gcc->data)) return;
|
||||
instances = eina_list_remove(instances, inst);
|
||||
|
||||
if (inst->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(inst->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(inst->menu));
|
||||
inst->menu = NULL;
|
||||
}
|
||||
if (inst->lmenu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(inst->lmenu, NULL, NULL);
|
||||
|
@ -301,36 +293,33 @@ _e_xkb_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSE
|
|||
{
|
||||
Evas_Event_Mouse_Down *ev = event;
|
||||
Instance *inst = data;
|
||||
E_Menu *m;
|
||||
|
||||
if (!inst) return;
|
||||
|
||||
if ((ev->button == 3) && (!inst->menu)) /* Right-click utility menu */
|
||||
if (ev->button == 3) /* Right-click utility menu */
|
||||
{
|
||||
int x, y;
|
||||
E_Menu_Item *mi;
|
||||
|
||||
/* The menu and menu item */
|
||||
inst->menu = e_menu_new();
|
||||
mi = e_menu_item_new(inst->menu);
|
||||
m = e_menu_new();
|
||||
mi = e_menu_item_new(m);
|
||||
/* Menu item specifics */
|
||||
e_menu_item_label_set(mi, _("Settings"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-system");
|
||||
e_menu_item_callback_set(mi, _e_xkb_cb_menu_configure, NULL);
|
||||
/* Append into the util menu */
|
||||
inst->menu = e_gadcon_client_util_menu_items_append(inst->gcc,
|
||||
inst->menu, 0);
|
||||
/* Callback */
|
||||
e_menu_post_deactivate_callback_set(inst->menu, _e_xkb_cb_menu_post,
|
||||
inst);
|
||||
m = e_gadcon_client_util_menu_items_append(inst->gcc,
|
||||
m, 0);
|
||||
/* Coords */
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y,
|
||||
NULL, NULL);
|
||||
/* Activate - we show the menu relative to the gadget */
|
||||
e_menu_activate_mouse(inst->menu,
|
||||
e_menu_activate_mouse(m,
|
||||
e_util_zone_current_get(e_manager_current_get()),
|
||||
(x + ev->output.x), (y + ev->output.y), 1, 1,
|
||||
E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
|
||||
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
|
||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||
}
|
||||
|
@ -459,15 +448,6 @@ _e_xkb_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSE
|
|||
e_xkb_layout_next();
|
||||
}
|
||||
|
||||
static void
|
||||
_e_xkb_cb_menu_post(void *data, E_Menu *menu __UNUSED__)
|
||||
{
|
||||
Instance *inst = data;
|
||||
|
||||
if (!(inst) || !inst->menu) return;
|
||||
inst->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_xkb_cb_lmenu_post(void *data, E_Menu *menu __UNUSED__)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue