? current.patch
Index: src/window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.331
diff -p -u -r1.331 window.c
--- src/window.c	24 Jun 2004 20:02:46 -0000	1.331
+++ src/window.c	25 Jun 2004 17:06:33 -0000
@@ -79,7 +79,7 @@ static void     invalidate_work_areas   
 static void     set_wm_state              (MetaWindow     *window,
                                            int             state);
 static void     set_net_wm_state          (MetaWindow     *window);
-
+static void     set_allowed_actions_hint  (MetaWindow     *window);
 static void     send_configure_notify     (MetaWindow     *window);
 static gboolean process_property_notify   (MetaWindow     *window,
                                            XPropertyEvent *event);
@@ -1898,7 +1898,9 @@ meta_window_minimize (MetaWindow  *windo
       meta_window_foreach_transient (window,
                                      queue_calc_showing_func,
                                      NULL);
-      
+
+      set_allowed_actions_hint (window);
+
       if (window->has_focus)
         {
           meta_topic (META_DEBUG_FOCUS,
@@ -1926,6 +1928,8 @@ meta_window_unminimize (MetaWindow  *win
       meta_window_foreach_transient (window,
                                      queue_calc_showing_func,
                                      NULL);
+
+      set_allowed_actions_hint (window);
     }
 }
 
@@ -1959,6 +1963,8 @@ meta_window_maximize_internal (MetaWindo
   window->maximized = TRUE;
   
   recalc_window_features (window);
+  set_allowed_actions_hint (window);
+
   set_net_wm_state (window);
 }
 
@@ -2015,6 +2021,7 @@ meta_window_unmaximize (MetaWindow  *win
                                window->saved_rect.height);
 
       recalc_window_features (window);
+      set_allowed_actions_hint (window);
       set_net_wm_state (window);
     }
 }
@@ -2127,6 +2134,8 @@ meta_window_shade (MetaWindow  *window)
       meta_window_queue_move_resize (window);
       meta_window_queue_calc_showing (window);
 
+      set_allowed_actions_hint (window);
+
       /* After queuing the calc showing, since _focus flushes it,
        * and we need to focus the frame
        */
@@ -2151,6 +2160,8 @@ meta_window_unshade (MetaWindow  *window
       meta_window_queue_move_resize (window);
       meta_window_queue_calc_showing (window);
 
+      set_allowed_actions_hint (window);
+
       /* focus the window */
       meta_topic (META_DEBUG_FOCUS,
                   "Focusing window %s after unshading it\n",
@@ -5439,24 +5450,32 @@ set_allowed_actions_hint (MetaWindow *wi
   int i;
 
   i = 0;
-  if (window->has_move_func)
+  if (window->has_move_func && 
+      !window->minimized    && 
+      !window->maximized    && 
+      !window->shaded)
     {
       data[i] = window->display->atom_net_wm_action_move;
       ++i;
     }
-  if (window->has_resize_func)
+  if (window->has_resize_func && 
+      !window->minimized      && 
+      !window->maximized      && 
+      !window->shaded)
     {
       data[i] = window->display->atom_net_wm_action_resize;
       ++i;
       data[i] = window->display->atom_net_wm_action_fullscreen;
       ++i;
     }
-  if (window->has_minimize_func)
+  if (window->has_minimize_func && 
+      !window->shaded)
     {
       data[i] = window->display->atom_net_wm_action_minimize;
       ++i;
     }
-  if (window->has_shade_func)
+  if (window->has_shade_func && 
+      !window->minimized)
     {
       data[i] = window->display->atom_net_wm_action_shade;
       ++i;
@@ -5464,7 +5483,9 @@ set_allowed_actions_hint (MetaWindow *wi
   /* sticky according to EWMH is different from metacity's sticky;
    * metacity doesn't support EWMH sticky
    */
-  if (window->has_maximize_func)
+  if (window->has_maximize_func && 
+      !window->minimized        && 
+      !window->shaded)
     {
       data[i] = window->display->atom_net_wm_action_maximize_horz;
       ++i;
