forked from enlightenment/efl
win: Fix main menu when not in framespace
On OSX the framespace and CSD (Client-Side Decorations) are not supported at all... I am not able to test this case. This patch restores the main menu functionality based on pre 1.19 themes, where it was located inside win.edc (app content) and not in border.edc (framespace). Note that the initial size of a window may be wrong, eg as in elementary_test -to "Main Menu" Fixes T5734 (hopefully!)
This commit is contained in:
parent
2330d4fec1
commit
521f41f536
|
@ -1,13 +1,31 @@
|
||||||
group { name: "elm/win/base/default";
|
group { name: "elm/win/base/default";
|
||||||
data.item: "version" "119";
|
data.item: "version" "119";
|
||||||
parts {
|
parts {
|
||||||
rect { "client_clip"; nomouse;
|
rect { "client_clip"; nomouse; }
|
||||||
|
swallow { "elm.swallow.menu";
|
||||||
|
clip_to: "client_clip";
|
||||||
desc { "default";
|
desc { "default";
|
||||||
rel.to: "elm.swallow.contents";
|
rel2.relative: 1 0;
|
||||||
|
link.base: "elm,action,hide" "elm";
|
||||||
|
align: 0.5 0.0;
|
||||||
|
hid;
|
||||||
|
}
|
||||||
|
desc { "visible";
|
||||||
|
inherit: "default";
|
||||||
|
link.base: "elm,action,show_menu" "elm";
|
||||||
|
fixed: 0 1;
|
||||||
|
vis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
swallow { "elm.swallow.contents";
|
swallow { "elm.swallow.contents";
|
||||||
clip_to: "client_clip";
|
clip_to: "client_clip";
|
||||||
|
desc { "default";
|
||||||
|
}
|
||||||
|
desc { "with_menu";
|
||||||
|
rel1.to: "elm.swallow.menu";
|
||||||
|
rel1.relative: 0 1;
|
||||||
|
link.base: "elm,action,show_menu" "elm";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5659,7 +5659,19 @@ _efl_ui_win_fullscreen_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
||||||
static inline Eo *
|
static inline Eo *
|
||||||
_main_menu_swallow_get(Efl_Ui_Win_Data *sd)
|
_main_menu_swallow_get(Efl_Ui_Win_Data *sd)
|
||||||
{
|
{
|
||||||
if (edje_object_part_exists(sd->legacy.edje, "elm.swallow.menu"))
|
Eina_Bool legacy_menu_swallow = EINA_TRUE;
|
||||||
|
const char *data;
|
||||||
|
int version;
|
||||||
|
|
||||||
|
data = edje_object_data_get(sd->legacy.edje, "version");
|
||||||
|
version = data ? atoi(data) : 0;
|
||||||
|
if (version >= 119) legacy_menu_swallow = EINA_FALSE;
|
||||||
|
|
||||||
|
#ifdef HAVE_ELEMENTARY_COCOA
|
||||||
|
if (sd->cocoa.win) legacy_menu_swallow = EINA_TRUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (legacy_menu_swallow)
|
||||||
{
|
{
|
||||||
DBG("Detected legacy theme, using legacy swallows.");
|
DBG("Detected legacy theme, using legacy swallows.");
|
||||||
return sd->legacy.edje;
|
return sd->legacy.edje;
|
||||||
|
@ -5688,6 +5700,13 @@ _dbus_menu_set(Eina_Bool dbus_connect, void *data)
|
||||||
sd->csd.need_menu = EINA_FALSE;
|
sd->csd.need_menu = EINA_FALSE;
|
||||||
_elm_menu_menu_bar_hide(sd->main_menu);
|
_elm_menu_menu_bar_hide(sd->main_menu);
|
||||||
_elm_win_resize_objects_eval(sd->obj, EINA_FALSE);
|
_elm_win_resize_objects_eval(sd->obj, EINA_FALSE);
|
||||||
|
if (swallow != sd->frame_obj)
|
||||||
|
{
|
||||||
|
// Note: Based on EFL 1.18 the signal was "elm,action,hide"
|
||||||
|
// and not "elm,action,hide_menu" as expected.
|
||||||
|
edje_object_signal_emit(swallow, "elm,action,hide", "elm");
|
||||||
|
edje_object_message_signal_recursive_process(swallow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -5700,6 +5719,11 @@ _dbus_menu_set(Eina_Bool dbus_connect, void *data)
|
||||||
efl_canvas_object_is_frame_object_set(sd->main_menu, EINA_TRUE);
|
efl_canvas_object_is_frame_object_set(sd->main_menu, EINA_TRUE);
|
||||||
sd->csd.need_menu = EINA_TRUE;
|
sd->csd.need_menu = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
edje_object_signal_emit(swallow, "elm,action,show_menu", "elm");
|
||||||
|
edje_object_message_signal_recursive_process(swallow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_elm_win_frame_style_update(sd, 0, 1);
|
_elm_win_frame_style_update(sd, 0, 1);
|
||||||
//sd->deferred_resize_job = EINA_TRUE;
|
//sd->deferred_resize_job = EINA_TRUE;
|
||||||
|
|
Loading…
Reference in New Issue