e = menu_find_entry_id(menu, CLIENT_MAXIMIZE);
e->data.normal.enabled =
(frame->client->functions & OB_CLIENT_FUNC_MAXIMIZE) &&
- !frame->client->max_horz && !frame->client->max_vert;
+ (!frame->client->max_horz || !frame->client->max_vert);
e = menu_find_entry_id(menu, CLIENT_SHADE);
e->data.normal.enabled = frame->client->functions & OB_CLIENT_FUNC_SHADE;
{
ObMenuFrame *frame = data;
if (c == frame->client) {
- /* adding/removing entries while it's shown is not fun, so just hide
- the menu and reshow it */
- if (frame->parent) {
- ObMenuEntryFrame *me = frame->parent_entry;
- ObMenuFrame *parent = frame->parent;
- gint sel =
- g_list_position(frame->entries,
- g_list_find(frame->entries, frame->selected));
- menu_frame_select(parent, NULL, TRUE);
- menu_frame_select(parent, me, TRUE);
-
- frame = parent->child;
- /* reselect the same spot or the last one if it got shorter */
- sel = MIN(sel, (gint)g_list_length(frame->entries));
- if (sel >= 0)
- menu_frame_select(frame,
- g_list_nth(frame->entries, sel)->data,
- TRUE);
- } else
- menu_frame_hide(frame);
+ /* the client won't even be on the screen anymore, so hide the menu */
+ menu_frame_hide_all();
}
}
menu_set_place_func(menu, client_menu_place);
acts = g_slist_prepend(NULL, action_from_string
- ("ToggleMaximizeFull",
+ ("UnmaximizeFull",
OB_USER_ACTION_MENU_SELECTION));
e = menu_add_normal(menu, CLIENT_RESTORE, _("R&estore"), acts, TRUE);
e->data.normal.mask = ob_rr_theme->max_toggled_mask;
ob_rr_theme->menu_disabled_selected_color;
acts = g_slist_prepend(NULL, action_from_string
- ("ToggleMaximizeFull",
+ ("MaximizeFull",
OB_USER_ACTION_MENU_SELECTION));
e = menu_add_normal(menu, CLIENT_MAXIMIZE, _("Ma&ximize"), acts, TRUE);
e->data.normal.mask = ob_rr_theme->max_mask;