]> Dogcows Code - chaz/openbox/blobdiff - openbox/client_menu.c
typo...
[chaz/openbox] / openbox / client_menu.c
index 8375d396819bd189937fd00d884786149ad270a9..f6eb941684f959c6920dc532e29b5e57e8a3a1b2 100644 (file)
@@ -74,7 +74,7 @@ static gboolean client_update(ObMenuFrame *frame, gpointer data)
     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;
@@ -173,26 +173,8 @@ static void desktop_change_callback(ObClient *c, gpointer data)
 {
     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();
     }
 }
 
@@ -306,7 +288,7 @@ void client_menu_startup()
     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; 
@@ -335,7 +317,7 @@ void client_menu_startup()
         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; 
This page took 0.0215 seconds and 4 git commands to generate.