diff -rudp metacity-cvs-shakeloose-04-preserveprop-03-maxconstraint-02-titlebar-01/src/frames.c metacity-cvs-shakeloose-04-preserveprop-03-maxconstraint-02-titlebar-01-unimaxmouse-02/src/frames.c
--- metacity-cvs-shakeloose-04-preserveprop-03-maxconstraint-02-titlebar-01/src/frames.c	2006-10-01 21:07:18.000000000 +0200
+++ metacity-cvs-shakeloose-04-preserveprop-03-maxconstraint-02-titlebar-01-unimaxmouse-02/src/frames.c	2006-10-01 22:51:01.000000000 +0200
@@ -30,6 +30,7 @@
 #include "fixedtip.h"
 #include "theme.h"
 #include "prefs.h"
+#include "window.h"
 
 #ifdef HAVE_SHAPE
 #include <X11/extensions/shape.h>
@@ -1454,6 +1455,27 @@ meta_frames_button_press_event (GtkWidge
                                    event->y_root);
         }
     }
+  else if ((event->button == 2 || event->button == 3) &&
+           control == META_FRAME_CONTROL_MAXIMIZE)
+    {
+      MetaDisplay *display = meta_display_for_x_display (gdk_display);
+      MetaWindow *window = meta_display_lookup_x_window (display, frame->xwindow);
+
+      if (window && window->frame)
+        {
+          gboolean maximize =
+              (event->button == 3 && !window->maximized_horizontally) ||
+              (event->button == 2 && !window->maximized_vertically);
+          if (maximize)
+            meta_window_maximize (window,
+                (event->button == 3) ? META_MAXIMIZE_HORIZONTAL :
+                        	        META_MAXIMIZE_VERTICAL);
+          else
+            meta_window_unmaximize (window,
+                (event->button == 3) ? META_MAXIMIZE_HORIZONTAL :
+                        	        META_MAXIMIZE_VERTICAL);
+        }
+    }
   else if (event->button == 2)
     {
       meta_core_user_lower_and_unfocus (gdk_display,
