Index: libwnck/window-action-menu.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window-action-menu.c,v
retrieving revision 1.12
diff -u -r1.12 window-action-menu.c
--- libwnck/window-action-menu.c	20 Apr 2004 10:28:55 -0000	1.12
+++ libwnck/window-action-menu.c	16 Jun 2004 03:31:31 -0000
@@ -203,6 +203,39 @@
   actions = wnck_window_get_actions (amd->window);
   screen  = wnck_window_get_screen  (amd->window);
   
+  /* First, remove items that don't make sense. */
+  if (wnck_window_is_minimized (amd->window))
+    {
+      actions &= ~WNCK_WINDOW_ACTION_MOVE;
+      actions &= ~WNCK_WINDOW_ACTION_RESIZE;
+      actions &= ~(WNCK_WINDOW_ACTION_SHADE |
+                   WNCK_WINDOW_ACTION_UNSHADE);
+      actions &= ~(WNCK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY |
+                   WNCK_WINDOW_ACTION_UNMAXIMIZE_HORIZONTALLY);
+      actions &= ~(WNCK_WINDOW_ACTION_MAXIMIZE_VERTICALLY |
+                   WNCK_WINDOW_ACTION_UNMAXIMIZE_VERTICALLY);
+      actions &= ~(WNCK_WINDOW_ACTION_MAXIMIZE   |
+                   WNCK_WINDOW_ACTION_UNMAXIMIZE);
+    }
+  if (wnck_window_is_maximized (amd->window))
+    {
+      actions &= ~WNCK_WINDOW_ACTION_MOVE;
+      actions &= ~WNCK_WINDOW_ACTION_RESIZE;
+    }
+  if (wnck_window_is_shaded (amd->window))
+    {
+      actions &= ~WNCK_WINDOW_ACTION_MOVE;
+      actions &= ~WNCK_WINDOW_ACTION_RESIZE;
+      actions &= ~(WNCK_WINDOW_ACTION_MINIMIZE |
+                   WNCK_WINDOW_ACTION_UNMINIMIZE);
+      actions &= ~(WNCK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY |
+                   WNCK_WINDOW_ACTION_UNMAXIMIZE_HORIZONTALLY);
+      actions &= ~(WNCK_WINDOW_ACTION_MAXIMIZE_VERTICALLY |
+                   WNCK_WINDOW_ACTION_UNMAXIMIZE_VERTICALLY);
+      actions &= ~(WNCK_WINDOW_ACTION_MAXIMIZE   |
+                   WNCK_WINDOW_ACTION_UNMAXIMIZE);
+    }
+
   if (wnck_window_is_minimized (amd->window))
     {
       set_item_text (amd->minimize_item, _("Unmi_nimize"));
