From 20ad23ab6c43e7074bc7dcc874df2a4aacf16104 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 18 May 2005 10:18:02 +0000 Subject: [PATCH] fix remote type start module actualyl has a semblance of working well... :) SVN revision: 14835 --- data/themes/default_ibar.edc | 3 + data/themes/default_start.edc | 549 ++++++++++++++++++++++++++++++++- src/bin/e_int_menus.c | 3 + src/bin/e_menu.c | 215 ++++++++++++- src/bin/e_remote_main.c | 4 +- src/modules/start/e_mod_main.c | 33 +- 6 files changed, 786 insertions(+), 21 deletions(-) diff --git a/data/themes/default_ibar.edc b/data/themes/default_ibar.edc index 3857b6b0d..a49a6c846 100644 --- a/data/themes/default_ibar.edc +++ b/data/themes/default_ibar.edc @@ -313,6 +313,7 @@ group { mouse_events: 0; description { state: "default" 0.0; + visible: 0; rel1 { relative: 0.0 0.0; offset: 0 0; @@ -327,6 +328,7 @@ group { } description { state: "visible" 0.0; + visible: 1; rel1 { relative: 0.0 0.0; offset: 0 0; @@ -341,6 +343,7 @@ group { } description { state: "hidden" 0.0; + visible: 1; rel1 { relative: -0.5 -0.5; offset: 0 0; diff --git a/data/themes/default_start.edc b/data/themes/default_start.edc index f04fd3826..96d243dc7 100644 --- a/data/themes/default_start.edc +++ b/data/themes/default_start.edc @@ -1,22 +1,565 @@ group { name: "modules/start/main"; max: 128 128; + script { + public is_active; + public is_hilited; + } parts { part { - name: "base"; + name: "title_shadow2"; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 0; + image { + normal: "e17_titlebar_shadow2.png"; + border: 8 8 8 8; + } + fill { + smooth: 0; + } + color: 255 255 255 0; + } + description { + state: "active" 0.0; + visible: 1; + image { + normal: "e17_titlebar_shadow2.png"; + border: 8 8 8 8; + } + fill { + smooth: 0; + } + color: 255 255 255 255; + } + } + part { + name: "title_shadow1"; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 0; + image { + normal: "e17_titlebar_shadow1.png"; + border: 8 8 8 8; + } + fill { + smooth: 0; + } + color: 255 255 255 0; + } + description { + state: "active" 0.0; + visible: 1; + image { + normal: "e17_titlebar_shadow1.png"; + border: 8 8 8 8; + } + fill { + smooth: 0; + } + color: 255 255 255 255; + } + } + part { + name: "title_bar"; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 0; + image { + normal: "e17_titlebar.png"; + border: 8 8 8 8; + } + color: 255 255 255 0; + } + description { + state: "active" 0.0; + visible: 1; + image { + normal: "e17_titlebar.png"; + border: 8 8 8 8; + } + color: 255 255 255 255; + } + } + + part { + name: "logo"; description { state: "default" 0.0; aspect: 1.0 1.0; rel1 { - relative: 0.1 0.1; + to: "title_bar"; + offset: 7 7; } rel2 { - relative: 0.9 0.9; + to: "title_bar"; + offset: -8 -8; } image { normal: "e17_logo.png"; } } + description { + state: "active" 0.0; + inherit: "default" 0.0; + rel1 { + to: "title_bar"; + offset: 9 9; + } + rel2 { + to: "title_bar"; + offset: -10 -10; + } + } + } + + part { + name: "title_glint_clip"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + offset: 3 3; + to: "title_bar"; + } + rel2 { + offset: -4 -4; + to: "title_bar"; + } + color: 255 255 255 255; + } + } + part { + name: "title_glint_1"; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + align: 0.0 0.0; + max: 34 13; + rel1 { + relative: 0.0 0.0; + offset: 2 2; + to: "title_bar"; + } + rel2 { + relative: 1.0 1.0; + offset: -3 -3; + to: "title_bar"; + } + image { + normal: "e17_titlebar_glint1.png"; + border: 5 0 5 0; + } + fill { + smooth: 0; + } + } + description { + state: "active" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "title_glint_2"; + mouse_events: 0; + clip_to: "title_glint_clip"; + description { + state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + max: 0 0; + align: 1.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 3 3; + to: "title_bar"; + } + rel2 { + relative: 0.0 1.0; + offset: 0 -4; + to: "title_bar"; + } + image { + normal: "e17_titlebar_glint2.png"; + border: 0 0 5 5; + } + fill { + smooth: 0; + } + } + description { + state: "active" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + max: 169 9999; + min: 169 8; + align: 0.5 0.5; + rel1 { + relative: 0.0 0.0; + offset: 3 3; + } + rel2 { + relative: 0.0 1.0; + offset: 3 -4; + } + } + description { + state: "active2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 128; + max: 169 9999; + min: 169 8; + align: 0.5 0.5; + rel1 { + relative: 1.0 0.0; + offset: -4 3; + } + rel2 { + relative: 1.0 1.0; + offset: -4 -4; + } + } + description { + state: "active3" 0.0; + inherit: "default" 0.0; + visible: 0; + color: 255 255 255 0; + max: 169 9999; + min: 169 8; + align: 0.0 0.5; + rel1 { + relative: 1.0 0.0; + offset: -4 3; + } + rel2 { + relative: 1.0 1.0; + offset: -4 -4; + } + } + } + part { + name: "title_glint_3"; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + align: 1.0 1.0; + max: 34 13; + rel1 { + relative: 0.0 0.0; + offset: 2 2; + to: "title_bar"; + } + rel2 { + relative: 1.0 1.0; + offset: -3 -3; + to: "title_bar"; + } + image { + normal: "e17_titlebar_glint3.png"; + border: 0 5 0 5; + } + fill { + smooth: 0; + } + } + description { + state: "active" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + + part { + name: "logo2"; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 0; + rel1 { + to: "logo"; + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + to: "logo"; + relative: 1.0 1.0; + offset: -1 -1; + } + image { + normal: "e17_logo.png"; + } + color: 255 255 255 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 1; + rel1 { + relative: -0.5 -0.5; + offset: 0 0; + } + rel2 { + relative: 1.5 1.5; + offset: -1 -1; + } + color: 255 255 255 0; + } + } + + part { + name: "inout"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + color: 255 255 255 0; + } + } + } + programs { + program { + name: "init"; + signal: "load"; + source: ""; + script { + set_int(is_active, 0); + set_int(is_hilited, 0); + } + } + program { + name: "mouse_in"; + signal: "mouse,in"; + source: "inout"; + script { + new val; + + val = get_int(is_active); + if (val == 0) + { + run_program(PROGRAM:"go_active_pre"); + set_int(is_hilited, 1); + } + } + } + program { + name: "mouse_out"; + signal: "mouse,out"; + source: "inout"; + script { + new val; + + val = get_int(is_active); + if (val == 0) + { + run_program(PROGRAM:"go_passive_pre"); + set_int(is_hilited, 0); + } + } + } + program { + name: "handle_active"; + signal: "active"; + source: ""; + script { + new val; + + set_int(is_active, 1); + val = get_int(is_hilited); + if (val == 0) + run_program(PROGRAM:"go_active_pre"); + } + } + program { + name: "handle_passive"; + signal: "passive"; + source: ""; + script { + new val; + + set_int(is_active, 0); + val = get_int(is_hilited); + if (val == 1) + { + run_program(PROGRAM:"go_passive_pre"); + set_int(is_hilited, 0); + } + } + } + + program { + name: "go_active_pre"; + signal: ""; + source: ""; + action: STATE_SET "default" 0.0; + target: "title_bar"; + target: "title_shadow1"; + target: "title_shadow2"; + after: "go_active"; + } + program { + name: "go_active"; + action: STATE_SET "active" 0.0; + target: "title_bar"; + transition: LINEAR 0.05; + after: "go_active2"; + } + program { + name: "go_active2"; + action: STATE_SET "active" 0.0; + target: "title_shadow1"; + transition: LINEAR 0.05; + after: "go_active3"; + after: "go_active3b"; + } + program { + name: "go_active3"; + action: STATE_SET "active" 0.0; + target: "title_shadow2"; + transition: LINEAR 0.05; + } + program { + name: "go_active3b"; + action: STATE_SET "active" 0.0; + target: "title_glint_1"; + target: "title_glint_2"; + transition: LINEAR 0.05; + after: "go_active4"; + after: "go_active4b"; + } + program { + name: "go_active4"; + action: STATE_SET "active2" 0.0; + target: "title_glint_2"; + transition: LINEAR 0.2; + after: "go_active5"; + after: "go_active5b"; + } + program { + name: "go_active4b"; + action: STATE_SET "active" 0.0; + target: "title_glint_3"; + transition: LINEAR 0.2; + } + program { + name: "go_active5"; + action: STATE_SET "active3" 0.0; + target: "title_glint_2"; + transition: LINEAR 0.05; + } + program { + name: "go_active5b"; + action: STATE_SET "default" 0.0; + target: "title_glint_3"; + transition: LINEAR 0.1; + after: "go_active6"; + } + program { + name: "go_active6"; + action: STATE_SET "default" 0.0; + target: "title_glint_1"; + target: "title_glint_2"; + target: "title_glint_3"; + } + + program { + name: "logo_go_active"; + signal: ""; + source: ""; + action: STATE_SET "active" 0.0; + transition: LINEAR 0.2; + target: "logo"; + } + + program { + name: "go_passive_pre"; + signal: ""; + source: ""; + action: STATE_SET "active" 0.0; + target: "title_bar"; + target: "title_shadow1"; + target: "title_shadow2"; + after: "go_passive"; + } + program { + name: "go_passive"; + action: STATE_SET "default" 0.0; + target: "title_shadow2"; + transition: LINEAR 0.1; + after: "go_passive2"; + } + program { + name: "go_passive2"; + action: STATE_SET "default" 0.0; + target: "title_shadow1"; + transition: LINEAR 0.1; + after: "go_passive3"; + } + program { + name: "go_passive3"; + action: STATE_SET "default" 0.0; + target: "title_bar"; + transition: LINEAR 0.1; + } + + program { + name: "logo_go_passive"; + signal: ""; + source: ""; + action: STATE_SET "default" 0.0; + target: "logo"; + } + + program { + name: "hover_go_active"; + signal: "active"; + source: ""; + action: STATE_SET "visible" 0.0; + target: "logo2"; + after: "hover_go_active2"; + } + program { + name: "hover_go_active2"; + signal: ""; + source: ""; + action: STATE_SET "hidden" 0.0; + transition: LINEAR 0.5; + target: "logo2"; + after: "hover_go_active"; + } + program { + name: "hover_go_passive"; + signal: "passive"; + source: ""; + action: ACTION_STOP; + target: "hover_go_active"; + target: "hover_go_active2"; + after: "hover_go_passive2"; + } + program { + name: "hover_go_passive2"; + signal: ""; + source: ""; + action: STATE_SET "default" 0.0; + target: "logo2"; } } } diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c index 110d5643b..84401707f 100644 --- a/src/bin/e_int_menus.c +++ b/src/bin/e_int_menus.c @@ -492,6 +492,9 @@ _e_int_menus_clients_pre_cb(void *data, E_Menu *m) bd->client.icccm.class); if (a) e_menu_item_icon_edje_set(mi, a->path, "icon"); } + mi = e_menu_item_new(m); + e_menu_item_separator_set(mi, 1); + mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Cleanup Windows")); e_menu_item_icon_edje_set(mi, diff --git a/src/bin/e_menu.c b/src/bin/e_menu.c index 44b62e6f5..5f2d49228 100644 --- a/src/bin/e_menu.c +++ b/src/bin/e_menu.c @@ -43,6 +43,7 @@ static void _e_menu_item_activate_previous (void); static void _e_menu_activate_next (void); static void _e_menu_activate_previous (void); static void _e_menu_activate_first (void); +static void _e_menu_activate_last (void); static void _e_menu_activate_nth (int n); static E_Menu *_e_menu_active_get (void); static E_Menu_Item *_e_menu_item_active_get (void); @@ -50,6 +51,7 @@ static int _e_menu_outside_bounds_get (int xdir, int ydir); static void _e_menu_scroll_by (int dx, int dy); static void _e_menu_mouse_autoscroll_check (void); static void _e_menu_item_ensure_onscreen (E_Menu_Item *mi); +static int _e_menu_auto_place (E_Menu *m, int x, int y, int w, int h); static void _e_menu_cb_intercept_item_move (void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y); 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); @@ -149,9 +151,47 @@ e_menu_activate_key(E_Menu *m, E_Zone *zone, int x, int y, int w, int h, int dir E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); _e_menu_activate_time = 0.0; _e_menu_activate_internal(m, zone); - m->cur.x = x + w; - m->cur.y = y + h; - _e_menu_activate_first(); + switch (dir) + { + case E_MENU_POP_DIRECTION_LEFT: + _e_menu_realize(m); + m->cur.x = x - m->cur.w; + m->cur.y = y ; + _e_menu_activate_first(); + break; + case E_MENU_POP_DIRECTION_RIGHT: + m->cur.x = x + w; + m->cur.y = y ; + _e_menu_activate_first(); + break; + case E_MENU_POP_DIRECTION_UP: + _e_menu_realize(m); + m->cur.x = x + w; + m->cur.y = y - m->cur.h; + _e_menu_activate_last(); + break; + case E_MENU_POP_DIRECTION_DOWN: + m->cur.x = x + w; + m->cur.y = y + h; + _e_menu_activate_first(); + break; + case E_MENU_POP_DIRECTION_AUTO: + { + int pos; + + pos = _e_menu_auto_place(m, x, y, w, h); + if (pos == 4) + _e_menu_activate_last(); + else + _e_menu_activate_first(); + } + break; + default: + m->cur.x = x + w; + m->cur.y = y + h; + _e_menu_activate_first(); + break; + } } void @@ -165,9 +205,34 @@ e_menu_activate_mouse(E_Menu *m, E_Zone *zone, int x, int y, int w, int h, int d E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); _e_menu_activate_time = ecore_time_get(); _e_menu_activate_internal(m, zone); - m->cur.x = x + w; - m->cur.y = y + h; - + switch (dir) + { + case E_MENU_POP_DIRECTION_LEFT: + _e_menu_realize(m); + m->cur.x = x - m->cur.w; + m->cur.y = y ; + break; + case E_MENU_POP_DIRECTION_RIGHT: + m->cur.x = x + w; + m->cur.y = y ; + break; + case E_MENU_POP_DIRECTION_UP: + _e_menu_realize(m); + m->cur.x = x + w; + m->cur.y = y - m->cur.h; + break; + case E_MENU_POP_DIRECTION_DOWN: + m->cur.x = x + w; + m->cur.y = y + h; + break; + case E_MENU_POP_DIRECTION_AUTO: + _e_menu_auto_place(m, x, y, w, h); + break; + default: + m->cur.x = x + w; + m->cur.y = y + h; + break; + } pmi = _e_menu_item_active_get(); if (pmi) e_menu_item_active_set(pmi, 0); } @@ -183,8 +248,34 @@ e_menu_activate(E_Menu *m, E_Zone *zone, int x, int y, int w, int h, int dir) E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); _e_menu_activate_time = 0.0; _e_menu_activate_internal(m, zone); - m->cur.x = x; - m->cur.y = y; + switch (dir) + { + case E_MENU_POP_DIRECTION_LEFT: + _e_menu_realize(m); + m->cur.x = x - m->cur.w; + m->cur.y = y ; + break; + case E_MENU_POP_DIRECTION_RIGHT: + m->cur.x = x + w; + m->cur.y = y ; + break; + case E_MENU_POP_DIRECTION_UP: + _e_menu_realize(m); + m->cur.x = x + w; + m->cur.y = y - m->cur.h; + break; + case E_MENU_POP_DIRECTION_DOWN: + m->cur.x = x + w; + m->cur.y = y + h; + break; + case E_MENU_POP_DIRECTION_AUTO: + _e_menu_auto_place(m, x, y, w, h); + break; + default: + m->cur.x = x + w; + m->cur.y = y + h; + break; + } pmi = _e_menu_item_active_get(); if (pmi) e_menu_item_active_set(pmi, 0); } @@ -1695,7 +1786,7 @@ _e_menu_activate_previous(void) } return; } - _e_menu_activate_first(); + _e_menu_activate_last(); } static void @@ -1720,6 +1811,28 @@ _e_menu_activate_first(void) _e_menu_item_ensure_onscreen(mi); } +static void +_e_menu_activate_last(void) +{ + E_Menu *m; + E_Menu_Item *mi; + Evas_List *ll; + + if (!_e_active_menus) return; + m = _e_active_menus->data; + if (!m->items) return; + ll = evas_list_last(m->items); + mi = ll->data; + while ((mi->separator) && (ll->prev)) + { + ll = ll->prev; + mi = ll->data; + } + if (mi->separator) return; + e_menu_item_active_set(mi, 1); + _e_menu_item_ensure_onscreen(mi); +} + static void _e_menu_activate_nth(int n) { @@ -1927,6 +2040,89 @@ _e_menu_item_ensure_onscreen(E_Menu_Item *mi) _e_menu_scroll_by(dx, dy); } +static int +_e_menu_auto_place(E_Menu *m, int x, int y, int w, int h) +{ + double xr, yr; + + _e_menu_realize(m); + /* +-----+ + * |\ T /| + * | \ / | + * |L X R| + * | / \ | + * |/ B \| + * +-----+ + * + * quadrants... which one + */ + if (w != m->zone->container->w) + xr = (double)(x - m->zone->container->x) / + (double)(m->zone->container->w - w); + else + xr = 0.0; + if (h != m->zone->container->h) + yr = (double)(y - m->zone->container->y) / + (double)(m->zone->container->h - h); + else + yr = 0.0; + if ((xr + yr) < 0.99) /* top or left */ + { + if (((1.0 - yr) + xr) <= 1.0) + /* L */ + { + m->cur.x = x + w; + if (y < (m->zone->container->y + ((m->zone->container->h * 1) / 3))) + m->cur.y = y; + else if (y < (m->zone->container->y + ((m->zone->container->h * 2) / 3))) + m->cur.y = y + ((h - m->cur.h) / 2); + else + m->cur.y = y + h - m->cur.h; + return 1; + } + else + /* T */ + { + m->cur.y = y + h; + if (x < (m->zone->container->x + ((m->zone->container->w * 1) / 3))) + m->cur.x = x; + else if (x < (m->zone->container->x + ((m->zone->container->w * 2) / 3))) + m->cur.x = x + ((w - m->cur.w) / 2); + else + m->cur.x = x + w - m->cur.w; + return 3; + } + } + else /* bottom or right */ + { + if (((1.0 - yr) + xr) <= 1.01) + /* B */ + { + m->cur.y = y - m->cur.h; + if (x < (m->zone->container->x + ((m->zone->container->w * 1) / 3))) + m->cur.x = x; + else if (x < (m->zone->container->x + ((m->zone->container->w * 2) / 3))) + m->cur.x = x + ((w - m->cur.w) / 2); + else + m->cur.x = x + w - m->cur.w; + return 4; + } + else + /* R */ + { + m->cur.x = x - m->cur.w; + if (y < (m->zone->container->y + ((m->zone->container->h * 1) / 3))) + m->cur.y = y; + else if (y < (m->zone->container->y + ((m->zone->container->h * 2) / 3))) + m->cur.y = y + ((h - m->cur.h) / 2); + else + m->cur.y = y + h - m->cur.h; + return 2; + } + } + return 0; +} + static void _e_menu_cb_ecore_evas_resize(Ecore_Evas *ee) { @@ -2006,7 +2202,6 @@ _e_menu_cb_key_down(void *data, int type, void *event) _e_menu_activate_nth(8); else if (!strcmp(ev->keysymbol, "0")) _e_menu_activate_nth(9); - printf("kdn \"%s\" \"%s\"\n", ev->keyname, ev->keysymbol); return 1; } diff --git a/src/bin/e_remote_main.c b/src/bin/e_remote_main.c index b9bb79af8..2a3fd4f8f 100644 --- a/src/bin/e_remote_main.c +++ b/src/bin/e_remote_main.c @@ -310,8 +310,8 @@ E_IPC_Opt_Handler handlers[] = OREQ("-edge-flip-get", "Get the edge flip flag", E_IPC_OP_USE_EDGE_FLIP_GET, 1), ODBL("-edge-flip_timeout-set", "Set the edge flip timeout (sec)", E_IPC_OP_EDGE_FLIP_TIMEOUT_SET, 0), OREQ("-edge-flip_timeout-get", "Get the edge flip timeout", E_IPC_OP_EDGE_FLIP_TIMEOUT_GET, 1), - O2INT("-desks-set", "Get the number of virtual desktops (X x Y. OPT1 = X, OPT2 = Y)", E_IPC_OP_DESKS_SET, 0), - OREQ("-desks-get", "Set the number of virtual desktops", E_IPC_OP_DESKS_GET, 1) + O2INT("-desks-set", "Set the number of virtual desktops (X x Y. OPT1 = X, OPT2 = Y)", E_IPC_OP_DESKS_SET, 0), + OREQ("-desks-get", "Get the number of virtual desktops", E_IPC_OP_DESKS_GET, 1) }; /* externally accessible functions */ diff --git a/src/modules/start/e_mod_main.c b/src/modules/start/e_mod_main.c index 53e1cbf6e..b36e0fd53 100644 --- a/src/modules/start/e_mod_main.c +++ b/src/modules/start/e_mod_main.c @@ -13,6 +13,7 @@ static void _start_face_menu_new(Start_Face *face); static void _start_face_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi); static void _start_face_cb_gmc_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change); static void _start_face_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _start_menu_cb_post_deactivate(void *data, E_Menu *m); static int button_count; static E_Config_DD *conf_edd; @@ -37,7 +38,6 @@ e_modapi_init(E_Module *m) /* Create the button */ e = _start_new(); m->config_menu = e->config_menu; - //m->main_menu = e_int_menus_main_new(); return e; } @@ -179,6 +179,7 @@ _start_face_new(E_Container *con) face->button_object = o; e_theme_edje_object_set(o, "base/theme/modules/start", "modules/start/main"); + edje_object_signal_emit(o, "passive", ""); evas_object_show(o); o = evas_object_rectangle_add(con->bg_evas); @@ -234,7 +235,6 @@ _start_face_menu_new(Start_Face *face) e_menu_item_label_set(mi, _("Edit Mode")); e_menu_item_callback_set(mi, _start_face_cb_menu_edit, face); - face->main_menu = e_int_menus_main_new(); } static void @@ -264,7 +264,7 @@ _start_face_free(Start_Face *face) evas_object_del(face->button_object); evas_object_del(face->event_object); e_object_del(E_OBJECT(face->menu)); - e_object_del(E_OBJECT(face->main_menu)); + if (face->main_menu) e_object_del(E_OBJECT(face->main_menu)); free(face->conf); free(face); @@ -341,13 +341,34 @@ _start_face_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf ev = event_info; if (ev->button == 3) { - e_menu_activate_mouse(face->menu, e_zone_current_get(face->con), ev->output.x, ev->output.y, 1, 1, E_MENU_POP_DIRECTION_DOWN); + e_menu_activate_mouse(face->menu, e_zone_current_get(face->con), + ev->output.x, ev->output.y, 1, 1, + E_MENU_POP_DIRECTION_AUTO); e_util_container_fake_mouse_up_all_later(face->con); } else if (ev->button == 1) { - /* Pop up main menu */ - e_menu_activate_mouse(face->main_menu, e_zone_current_get(face->con), ev->output.x, ev->output.y, 1, 1, E_MENU_POP_DIRECTION_DOWN); + Evas_Coord x, y, w, h; + + e_gadman_client_geometry_get(face->gmc, &x, &y, &w, &h); + if (!face->main_menu) + face->main_menu = e_int_menus_main_new(); + e_menu_post_deactivate_callback_set(face->main_menu, _start_menu_cb_post_deactivate, face); + e_menu_activate_mouse(face->main_menu, e_zone_current_get(face->con), + x, y, w, h, + E_MENU_POP_DIRECTION_AUTO); e_util_container_fake_mouse_up_all_later(face->con); + edje_object_signal_emit(face->button_object, "active", ""); } } + +static void +_start_menu_cb_post_deactivate(void *data, E_Menu *m) +{ + Start_Face *face; + + face = data; + if (!face->main_menu) return; + edje_object_signal_emit(face->button_object, "passive", ""); + face->main_menu = NULL; +}