aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/e_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/e_menu.c')
-rw-r--r--src/bin/e_menu.c303
1 files changed, 69 insertions, 234 deletions
diff --git a/src/bin/e_menu.c b/src/bin/e_menu.c
index 167521afe..df932d672 100644
--- a/src/bin/e_menu.c
+++ b/src/bin/e_menu.c
@@ -70,7 +70,6 @@ static void _e_menu_cb_intercept_item_move(void *data, Evas_Object *o, E
static void _e_menu_cb_intercept_item_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
static void _e_menu_cb_intercept_container_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y);
static void _e_menu_cb_intercept_container_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
-static void _e_menu_cb_ecore_evas_resize(Ecore_Evas *ee);
static void _e_menu_cb_item_in(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static void _e_menu_cb_item_out(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static Eina_Bool _e_menu_cb_key_down(void *data, int type, void *event);
@@ -80,14 +79,12 @@ static Eina_Bool _e_menu_cb_mouse_up(void *data, int type, void *event);
static Eina_Bool _e_menu_cb_mouse_move(void *data, int type, void *event);
static Eina_Bool _e_menu_cb_mouse_wheel(void *data, int type, void *event);
static Eina_Bool _e_menu_cb_scroll_animator(void *data);
-static Eina_Bool _e_menu_cb_window_shape(void *data, int ev_type, void *ev);
static void _e_menu_cb_item_submenu_post_default(void *data, E_Menu *m, E_Menu_Item *mi);
static Eina_Bool _e_menu_categories_free_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata);
/* local subsystem globals */
static Ecore_X_Window _e_menu_win = 0;
static Eina_List *_e_active_menus = NULL;
-static Eina_Hash *_e_menu_hash = NULL;
static E_Menu_Item *_e_active_menu_item = NULL;
static E_Menu_Item *_e_prev_active_menu_item = NULL;
/*static Eina_Hash *_e_menu_category_items = NULL;*/
@@ -109,7 +106,6 @@ static Ecore_Event_Handler *_e_menu_mouse_down_handler = NULL;
static Ecore_Event_Handler *_e_menu_mouse_up_handler = NULL;
static Ecore_Event_Handler *_e_menu_mouse_move_handler = NULL;
static Ecore_Event_Handler *_e_menu_mouse_wheel_handler = NULL;
-static Ecore_Event_Handler *_e_menu_window_shape_handler = NULL;
static Eina_Bool _e_menu_lock = EINA_FALSE;
static Eina_List *
@@ -178,12 +174,8 @@ e_menu_init(void)
_e_menu_mouse_wheel_handler =
ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
_e_menu_cb_mouse_wheel, NULL);
- _e_menu_window_shape_handler =
- ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHAPE,
- _e_menu_cb_window_shape, NULL);
_e_menu_categories = eina_hash_string_superfast_new(NULL);
- if (!_e_menu_hash) _e_menu_hash = eina_hash_string_superfast_new(NULL);
e_int_menus_init();
return 1;
}
@@ -199,7 +191,6 @@ e_menu_shutdown(void)
E_FN_DEL(ecore_event_handler_del, _e_menu_mouse_up_handler);
E_FN_DEL(ecore_event_handler_del, _e_menu_mouse_move_handler);
E_FN_DEL(ecore_event_handler_del, _e_menu_mouse_wheel_handler);
- E_FN_DEL(ecore_event_handler_del, _e_menu_window_shape_handler);
if (!x_fatal)
{
@@ -219,11 +210,6 @@ e_menu_shutdown(void)
_e_menu_categories = NULL;
}
- if (_e_menu_hash)
- {
- eina_hash_free(_e_menu_hash);
- _e_menu_hash = NULL;
- }
_e_menu_lock = EINA_FALSE;
e_int_menus_shutdown();
@@ -1135,8 +1121,7 @@ e_menu_idler_before(void)
if ((!m->cur.visible) && (m->prev.visible))
{
m->prev.visible = m->cur.visible;
- ecore_evas_hide(m->ecore_evas);
- e_container_shape_hide(m->shape);
+ if (m->cw) e_comp_win_hide(m->cw);
}
}
/* phase 2. move & reisze all the menus that want to moves/resized */
@@ -1155,8 +1140,8 @@ e_menu_idler_before(void)
m->prev.h = m->cur.h;
w = m->cur.w;
h = m->cur.h;
- ecore_evas_resize(m->ecore_evas, w, h);
- e_container_shape_resize(m->shape, w, h);
+ if (m->cw)
+ e_comp_win_resize(m->cw, w, h);
}
if (((m->cur.x) != (m->prev.x)) ||
((m->cur.y) != (m->prev.y)))
@@ -1179,8 +1164,9 @@ e_menu_idler_before(void)
}
m->prev.x = m->cur.x;
m->prev.y = m->cur.y;
- ecore_evas_move(m->ecore_evas, m->cur.x, m->cur.y);
- e_container_shape_move(m->shape, m->cur.x, m->cur.y);
+ if (m->cw)
+ e_comp_win_move(m->cw, m->cur.x, m->cur.y);
+
}
}
}
@@ -1192,9 +1178,13 @@ e_menu_idler_before(void)
if ((m->cur.visible) && (!m->prev.visible))
{
m->prev.visible = m->cur.visible;
- ecore_evas_raise(m->ecore_evas);
- ecore_evas_show(m->ecore_evas);
- if (!m->shaped) e_container_shape_show(m->shape);
+ if (!m->cw)
+ {
+ evas_object_move(m->bg_object, m->cur.x, m->cur.y);
+ evas_object_resize(m->bg_object, m->cur.w, m->cur.h);
+ E_LAYER_SET(m->bg_object, E_COMP_CANVAS_LAYER_MENU);
+ }
+ e_comp_win_show(m->cw);
}
}
/* phase 4. de-activate... */
@@ -1215,59 +1205,6 @@ e_menu_idler_before(void)
e_object_unref(E_OBJECT(m));
}
}
- /* phase 5. shapes... */
- EINA_LIST_FOREACH(_e_active_menus, l, m)
- {
- if (m->need_shape_export)
- {
- Ecore_X_Rectangle *rects, *orects;
- int num = 0;
-
- rects = ecore_x_window_shape_rectangles_get(m->evas_win, &num);
- if (rects)
- {
- int changed = 1;
-
- if ((num == m->shape_rects_num) && (m->shape_rects))
- {
- int i = 0;
-
- orects = m->shape_rects;
- for (i = 0; i < num; i++)
- {
- if ((orects[i].x != rects[i].x) ||
- (orects[i].y != rects[i].y) ||
- (orects[i].width != rects[i].width) ||
- (orects[i].height != rects[i].height))
- {
- changed = 1;
- break;
- }
- }
- // TODO: This is meaningless
- changed = 0;
- }
- if (changed)
- {
- E_FREE(m->shape_rects);
- m->shape_rects = rects;
- m->shape_rects_num = num;
- e_container_shape_rects_set(m->shape, rects, num);
- }
- else
- free(rects);
- }
- else
- {
- E_FREE(m->shape_rects);
- m->shape_rects = NULL;
- m->shape_rects_num = 0;
- e_container_shape_rects_set(m->shape, NULL, 0);
- }
- m->need_shape_export = 0;
- if (m->cur.visible) e_container_shape_show(m->shape);
- }
- }
/* del refcount to all menus we worked with */
_e_menu_list_free_unref(tmp);
@@ -1275,8 +1212,7 @@ e_menu_idler_before(void)
{
if (_e_menu_win)
{
- ecore_x_window_free(_e_menu_win);
- e_grabinput_release(_e_menu_win, _e_menu_win);
+ e_grabinput_release(0, _e_menu_win);
_e_menu_win = 0;
}
}
@@ -1288,17 +1224,6 @@ e_menu_grab_window_get(void)
return _e_menu_win;
}
-EAPI E_Menu *
-e_menu_find_by_window(Ecore_X_Window win)
-{
- E_Menu *m;
-
- m = eina_hash_find(_e_menu_hash, e_util_winid_str_get(win));
- if ((m) && (m->evas_win != win))
- return NULL;
- return m;
-}
-
/* local subsystem functions */
static void
_e_menu_free(E_Menu *m)
@@ -1321,8 +1246,6 @@ _e_menu_free(E_Menu *m)
if (m->parent_item && (m->parent_item->submenu == m))
m->parent_item->submenu = NULL;
_e_menu_unrealize(m);
- E_FREE(m->shape_rects);
- m->shape_rects_num = 0;
EINA_LIST_FOREACH_SAFE(m->items, l, l_next, mi)
e_object_del(E_OBJECT(mi));
if (m->in_active_list)
@@ -1376,7 +1299,6 @@ _e_menu_cb_intercept_item_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Co
mi = data;
mi->x = x;
mi->y = y;
- evas_object_move(mi->event_object, x, y);
evas_object_move(o, x, y);
if ((mi->submenu) && (mi->submenu->parent_item))
{
@@ -1393,7 +1315,6 @@ _e_menu_cb_intercept_item_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_
mi = data;
mi->w = w;
mi->h = h;
- evas_object_resize(mi->event_object, w, h);
evas_object_resize(o, w, h);
if ((mi->submenu) && (mi->submenu->parent_item))
_e_menu_reposition(mi->submenu);
@@ -1446,9 +1367,12 @@ _e_menu_item_realize(E_Menu_Item *mi)
{
o = edje_object_add(mi->menu->evas);
mi->bg_object = o;
+ evas_object_name_set(o, "mi->bg_object");
+ evas_object_data_set(o, "e_menu_item", mi);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _e_menu_cb_item_in, mi);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _e_menu_cb_item_out, mi);
evas_object_intercept_move_callback_add(o, _e_menu_cb_intercept_item_move, mi);
evas_object_intercept_resize_callback_add(o, _e_menu_cb_intercept_item_resize, mi);
-
if ((mi->submenu) || (mi->submenu_pre_cb.func))
{
if (!e_theme_edje_object_set(mi->bg_object, "base/theme/menus",
@@ -1464,6 +1388,7 @@ no_submenu_item:
evas_object_show(o);
o = e_box_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->container_object");
e_box_homogenous_set(o, 0);
mi->container_object = o;
e_box_orientation_set(o, 1);
@@ -1474,10 +1399,10 @@ no_submenu_item:
if (mi->check)
{
o = edje_object_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->toggle_object");
mi->toggle_object = o;
e_theme_edje_object_set(o, "base/theme/menus",
"e/widgets/menu/default/check");
- evas_object_pass_events_set(o, 1);
evas_object_show(o);
e_box_pack_end(mi->container_object, o);
edje_object_size_min_calc(mi->toggle_object, &ww, &hh);
@@ -1494,10 +1419,10 @@ no_submenu_item:
else if (mi->radio)
{
o = edje_object_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->toggle_object");
mi->toggle_object = o;
e_theme_edje_object_set(o, "base/theme/menus",
"e/widgets/menu/default/radio");
- evas_object_pass_events_set(o, 1);
evas_object_show(o);
e_box_pack_end(mi->container_object, o);
edje_object_size_min_calc(mi->toggle_object, &ww, &hh);
@@ -1514,9 +1439,9 @@ no_submenu_item:
else
{
o = evas_object_rectangle_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->toggle_object");
mi->toggle_object = o;
evas_object_color_set(o, 0, 0, 0, 0);
- evas_object_pass_events_set(o, 1);
e_box_pack_end(mi->container_object, o);
}
if ((!e_config->menu_icons_hide) && ((mi->icon) || (mi->realize_cb.func)))
@@ -1527,6 +1452,7 @@ no_submenu_item:
if (e_theme_edje_object_set(o, "base/theme/menus",
"e/widgets/menu/default/icon"))
{
+ evas_object_name_set(o, "mi->icon_bg_object");
mi->icon_bg_object = o;
evas_object_show(o);
}
@@ -1535,6 +1461,7 @@ no_submenu_item:
evas_object_del(o);
o = NULL;
}
+ //if (o) evas_object_pass_events_set(o, 1);
/* FIXME: Not sure why there are two different tries to get the icon size, surely only the last one si needed. */
/* FIXME: Do it this way later, when e_app_icon_add() just registers a request for an icon to be filled in when it's ready.
@@ -1557,6 +1484,7 @@ no_submenu_item:
if (edje_object_file_set(o, mi->icon, mi->icon_key))
{
mi->icon_object = o;
+ evas_object_name_set(o, "mi->icon_object");
edje_object_size_max_get(o, &iww, &ihh);
icon_w = iww;
icon_h = ihh;
@@ -1570,6 +1498,7 @@ no_submenu_item:
if (!mi->icon_object)
{
o = e_icon_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->icon_object");
mi->icon_object = o;
e_icon_scale_size_set(o, e_util_icon_size_normalize(24 * e_scale));
e_icon_preload_set(mi->icon_object, 1);
@@ -1585,7 +1514,6 @@ no_submenu_item:
e_icon_size_get(o, &icon_w, &icon_h);
}
- evas_object_pass_events_set(o, 1);
evas_object_show(o);
if (mi->icon_bg_object)
@@ -1609,6 +1537,7 @@ no_submenu_item:
else
{
o = edje_object_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->icon_bg_object");
e_icon_size_get(mi->icon_object, &icon_w, &icon_h);
mi->icon_w = icon_w;
mi->icon_h = icon_h;
@@ -1625,21 +1554,21 @@ no_submenu_item:
else
{
o = evas_object_rectangle_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->icon_object");
mi->icon_object = o;
evas_object_color_set(o, 0, 0, 0, 0);
- evas_object_pass_events_set(o, 1);
e_box_pack_end(mi->container_object, o);
}
if (mi->label)
{
o = edje_object_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->label_object");
mi->label_object = o;
e_theme_edje_object_set(o, "base/theme/menus",
"e/widgets/menu/default/label");
/* default label */
edje_object_part_text_set(o, "e.text.label", mi->label);
- evas_object_pass_events_set(o, 1);
evas_object_show(o);
e_box_pack_end(mi->container_object, o);
edje_object_size_min_calc(mi->label_object, &ww, &hh);
@@ -1656,18 +1585,18 @@ no_submenu_item:
else
{
o = evas_object_rectangle_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->label_object");
mi->label_object = o;
evas_object_color_set(o, 0, 0, 0, 0);
- evas_object_pass_events_set(o, 1);
e_box_pack_end(mi->container_object, o);
}
if ((mi->submenu) || (mi->submenu_pre_cb.func))
{
o = edje_object_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->submenu_object");
mi->submenu_object = o;
e_theme_edje_object_set(o, "base/theme/menus",
"e/widgets/menu/default/submenu");
- evas_object_pass_events_set(o, 1);
evas_object_show(o);
e_box_pack_end(mi->container_object, o);
edje_object_size_min_calc(mi->submenu_object, &ww, &hh);
@@ -1684,26 +1613,15 @@ no_submenu_item:
else
{
o = evas_object_rectangle_add(mi->menu->evas);
+ evas_object_name_set(o, "mi->submenu_object");
mi->submenu_object = o;
evas_object_color_set(o, 0, 0, 0, 0);
- evas_object_pass_events_set(o, 1);
e_box_pack_end(mi->container_object, o);
}
edje_object_part_swallow(mi->bg_object, "e.swallow.content",
mi->container_object);
- o = evas_object_rectangle_add(mi->menu->evas);
- evas_object_color_set(o, 0, 0, 0, 0);
- //evas_object_layer_set(o, 1); FIXME: COMP
- evas_object_repeat_events_set(o, 1);
- evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN,
- _e_menu_cb_item_in, mi);
- evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT,
- _e_menu_cb_item_out, mi);
- evas_object_show(o);
- mi->event_object = o;
-
e_box_pack_end(mi->menu->container_object, mi->bg_object);
e_box_thaw(mi->container_object);
}
@@ -1718,72 +1636,29 @@ _e_menu_realize(E_Menu *m)
Evas_Object *o;
Eina_List *l;
E_Menu_Item *mi;
- int ok = 0;
- int w, h;
if (m->realized || (!m->items)) return;
m->realized = 1;
- m->ecore_evas = e_canvas_new(m->zone->container->win,
- m->cur.x, m->cur.y, m->cur.w, m->cur.h, 1, 1,
- &(m->evas_win));
- e_canvas_add(m->ecore_evas);
- eina_hash_add(_e_menu_hash, e_util_winid_str_get(m->evas_win), m);
- m->shape = e_container_shape_add(m->zone->container);
- e_container_shape_move(m->shape, m->cur.x, m->cur.y);
- ecore_evas_callback_resize_set(m->ecore_evas, _e_menu_cb_ecore_evas_resize);
- m->evas = ecore_evas_get(m->ecore_evas);
+ m->evas = e_comp_get(m)->evas;
+ m->shape = e_container_shape_add(m->zone->container);
evas_event_freeze(m->evas);
- /* move cursor out to avoid event cycles during setup */
- evas_event_feed_mouse_in(m->evas, ecore_x_current_time_get(), NULL);
- evas_event_feed_mouse_move(m->evas, -1000000, -1000000,
- ecore_x_current_time_get(), NULL);
- ecore_x_window_shape_events_select(m->evas_win, 1);
- ecore_evas_name_class_set(m->ecore_evas, "E", "_e_menu_window");
- ecore_evas_title_set(m->ecore_evas, "E Menu");
o = edje_object_add(m->evas);
m->bg_object = o;
- evas_object_name_set(o, "menu/background");
+ evas_object_name_set(o, "menu->bg_object");
evas_object_data_set(o, "e_menu", m);
- evas_object_move(o, 0, 0);
- ok = e_theme_edje_object_set(o, "base/theme/menus",
- "e/widgets/menu/default/background");
- if (ok)
- {
- const char *shape_option;
-
- shape_option = edje_object_data_get(o, "shaped");
- if (shape_option)
- {
- if (!strcmp(shape_option, "1")) m->shaped = 1;
- }
- }
+ evas_object_data_set(o, "eobj", m);
+ e_theme_edje_object_set(o, "base/theme/menus", "e/widgets/menu/default/background");
if (m->header.title)
{
edje_object_part_text_set(o, "e.text.title", m->header.title);
edje_object_signal_emit(o, "e,action,show,title", "e");
edje_object_message_signal_process(o);
}
- evas_object_show(o);
-
- if (m->shaped)
- {
- if (!e_config->use_shaped_win)
- {
- ecore_evas_alpha_set(m->ecore_evas, m->shaped);
-
- eina_hash_del(_e_menu_hash, e_util_winid_str_get(m->evas_win), m);
- m->evas_win = ecore_evas_software_x11_window_get(m->ecore_evas);
- eina_hash_add(_e_menu_hash, e_util_winid_str_get(m->evas_win), m);
- }
- else
- ecore_evas_shaped_set(m->ecore_evas, m->shaped);
- }
-
- ecore_x_netwm_window_type_set(m->evas_win, ECORE_X_WINDOW_TYPE_MENU);
o = e_box_add(m->evas);
+ evas_object_name_set(o, "menu->container_object");
m->container_object = o;
evas_object_intercept_move_callback_add(o, _e_menu_cb_intercept_container_move, m);
evas_object_intercept_resize_callback_add(o, _e_menu_cb_intercept_container_resize, m);
@@ -1797,10 +1672,7 @@ _e_menu_realize(E_Menu *m)
_e_menu_items_layout_update(m);
e_box_thaw(m->container_object);
- w = m->cur.w;
- h = m->cur.h;
- e_container_shape_resize(m->shape, w, h);
- evas_object_resize(m->bg_object, w, h);
+
evas_event_thaw(m->evas);
}
@@ -2035,8 +1907,6 @@ _e_menu_item_unrealize(E_Menu_Item *mi)
mi->label_object = NULL;
if (mi->submenu_object) evas_object_del(mi->submenu_object);
mi->submenu_object = NULL;
- if (mi->event_object) evas_object_del(mi->event_object);
- mi->event_object = NULL;
}
static void
@@ -2047,9 +1917,7 @@ _e_menu_unrealize(E_Menu *m)
if (!m->realized) return;
evas_event_freeze(m->evas);
- e_container_shape_hide(m->shape);
- e_object_del(E_OBJECT(m->shape));
- m->shape = NULL;
+ E_FN_DEL(e_object_del, m->shape);
e_box_freeze(m->container_object);
EINA_LIST_FOREACH(m->items, l, mi)
_e_menu_item_unrealize(mi);
@@ -2063,12 +1931,9 @@ _e_menu_unrealize(E_Menu *m)
m->prev.visible = 0;
m->realized = 0;
m->zone = NULL;
- e_canvas_del(m->ecore_evas);
- ecore_evas_free(m->ecore_evas);
- m->ecore_evas = NULL;
+ m->cw = NULL;
+ evas_event_thaw(m->evas);
m->evas = NULL;
- eina_hash_del(_e_menu_hash, e_util_winid_str_get(m->evas_win), m);
- m->evas_win = 0;
}
static void
@@ -2083,13 +1948,9 @@ _e_menu_activate_internal(E_Menu *m, E_Zone *zone)
m->pending_new_submenu = 0;
if (!_e_menu_win)
{
- _e_menu_win = ecore_x_window_input_new(zone->container->win,
- zone->x, zone->y,
- zone->w, zone->h);
- ecore_x_window_show(_e_menu_win);
- if (!e_grabinput_get(_e_menu_win, 1, _e_menu_win))
+ _e_menu_win = e_comp_get(zone)->ee_win;
+ if (!e_grabinput_get(0, 0, _e_menu_win))
{
- ecore_x_window_free(_e_menu_win);
_e_menu_win = 0;
return;
}
@@ -2213,7 +2074,7 @@ _e_menu_reposition(E_Menu *m)
if (!m->parent_item) return;
m->cur.x = m->parent_item->menu->cur.x + m->parent_item->menu->cur.w;
- parent_item_bottom = m->parent_item->menu->cur.y + m->parent_item->y;
+ parent_item_bottom = m->parent_item->y;
if (m->cur.h > m->zone->h)
{
/* menu is larger than screen */
@@ -2227,12 +2088,12 @@ _e_menu_reposition(E_Menu *m)
else
{
/* menu is smaller than screen */
- if (((parent_item_bottom + m->cur.h - m->container_y) > m->zone->h) &&
+ if (((parent_item_bottom + m->cur.h) > m->zone->h) &&
(parent_item_bottom > (m->zone->h / 2)))
/* menu is partially out of screen and more is shown if menu goes up */
- m->cur.y = (parent_item_bottom - (m->container_h + 1)) + m->parent_item->h;
+ m->cur.y = parent_item_bottom - m->cur.h + m->parent_item->h;
else
- m->cur.y = parent_item_bottom - m->container_y;
+ m->cur.y = parent_item_bottom;
}
/* FIXME: this will suck for big menus */
@@ -2833,19 +2694,6 @@ _e_menu_auto_place(E_Menu *m, int x, int y, int w, int h)
}
static void
-_e_menu_cb_ecore_evas_resize(Ecore_Evas *ee)
-{
- Evas *evas;
- Evas_Object *o;
- Evas_Coord w, h;
-
- evas = ecore_evas_get(ee);
- evas_output_viewport_get(evas, NULL, NULL, &w, &h);
- o = evas_object_name_find(evas, "menu/background");
- evas_object_resize(o, w, h);
-}
-
-static void
_e_menu_cb_item_in(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
E_Menu_Item *mi;
@@ -2953,7 +2801,11 @@ _e_menu_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event)
Ecore_Event_Mouse_Button *ev;
ev = event;
- if (ev->window != _e_menu_win) return ECORE_CALLBACK_PASS_ON;
+ if (ev->window != _e_menu_win)
+ {
+ _e_menu_deactivate_all();
+ return ECORE_CALLBACK_PASS_ON;
+ }
/* Only allow dragging from floating menus for now.
* The reason for this is that for non floating menus,
@@ -2974,7 +2826,11 @@ _e_menu_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event)
int ret = 0;
ev = event;
- if (ev->window != _e_menu_win) return ECORE_CALLBACK_PASS_ON;
+ if (ev->window != _e_menu_win)
+ {
+ _e_menu_deactivate_all();
+ return ECORE_CALLBACK_PASS_ON;
+ }
t = ev->timestamp - _e_menu_activate_time;
if ((_e_menu_activate_time != 0) &&
@@ -3033,27 +2889,22 @@ _e_menu_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
EINA_LIST_FOREACH(_e_active_menus, l, m)
{
- if ((m->realized) && (m->cur.visible))
+ if ((!m->realized) || (!m->cur.visible)) continue;
+ if (is_fast)
+ m->fast_mouse = 1;
+ else if (dt > 0.0)
{
- if (is_fast)
- m->fast_mouse = 1;
- else if (dt > 0.0)
+ m->fast_mouse = 0;
+ if (m->pending_new_submenu)
{
- m->fast_mouse = 0;
- if (m->pending_new_submenu)
- {
- E_Menu_Item *mi;
+ E_Menu_Item *mi;
- mi = _e_menu_item_active_get();
- if (mi)
- _e_menu_submenu_activate(mi);
- }
+ mi = _e_menu_item_active_get();
+ if (mi)
+ _e_menu_submenu_activate(mi);
}
- evas_event_feed_mouse_move(m->evas,
- ev->x - m->cur.x + m->zone->x,
- ev->y - m->cur.y + m->zone->y,
- ev->timestamp, NULL);
}
+ evas_event_feed_mouse_move(m->evas, ev->x, ev->y, ev->timestamp, NULL);
}
_e_menu_list_free_unref(tmp);
@@ -3139,22 +2990,6 @@ _e_menu_cb_scroll_animator(void *data __UNUSED__)
return 1;
}
-static Eina_Bool
-_e_menu_cb_window_shape(void *data __UNUSED__, int ev_type __UNUSED__, void *ev)
-{
- Eina_List *l;
- Ecore_X_Event_Window_Shape *e;
- E_Menu *m;
-
- e = ev;
- EINA_LIST_FOREACH(_e_active_menus, l, m)
- {
- if (m->evas_win == e->win)
- m->need_shape_export = 1;
- }
- return ECORE_CALLBACK_PASS_ON;
-}
-
static void
_e_menu_cb_item_submenu_post_default(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item *mi)
{