Index: src/prefs.c
===================================================================
--- src/prefs.c	(revision 3476)
+++ src/prefs.c	(working copy)
@@ -1678,6 +1678,10 @@
     return META_ACTION_TITLEBAR_TOGGLE_SHADE;
   else if (strcmp (str, "toggle_maximize") == 0)
     return META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE;
+  else if (strcmp (str, "toggle_maximize_horiz") == 0)
+    return META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE_HORIZ;
+  else if (strcmp (str, "toggle_maximize_vert") == 0)
+    return META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE_VERT;
   else if (strcmp (str, "minimize") == 0)
     return META_ACTION_TITLEBAR_MINIMIZE;
   else if (strcmp (str, "none") == 0)
Index: src/frames.c
===================================================================
--- src/frames.c	(revision 3476)
+++ src/frames.c	(working copy)
@@ -1250,6 +1250,32 @@
       }
       break;
 
+    case META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE_HORIZ:
+      {
+        meta_core_get (gdk_display, frame->xwindow,
+                       META_CORE_GET_FRAME_FLAGS, &flags,
+                       META_CORE_GET_END);
+
+        if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE)
+          {
+            meta_core_toggle_maximize_horiz (gdk_display, frame->xwindow);
+          }
+      }
+      break;
+
+    case META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE_VERT:
+      {
+        meta_core_get (gdk_display, frame->xwindow,
+                       META_CORE_GET_FRAME_FLAGS, &flags,
+                       META_CORE_GET_END);
+
+        if (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE)
+          {
+            meta_core_toggle_maximize_vert (gdk_display, frame->xwindow);
+          }
+      }
+      break;
+
     case META_ACTION_TITLEBAR_MINIMIZE:
       {
         meta_core_get (gdk_display, frame->xwindow,
Index: src/core.c
===================================================================
--- src/core.c	(revision 3476)
+++ src/core.c	(working copy)
@@ -346,6 +346,40 @@
 }
 
 void
+meta_core_toggle_maximize_horiz (Display *xdisplay,
+                           Window   frame_xwindow)
+{
+  MetaWindow *window = get_window (xdisplay, frame_xwindow);
+
+  if (meta_prefs_get_raise_on_click ())
+    meta_window_raise (window);
+
+  if (window->maximized_horizontally)
+    meta_window_unmaximize (window, 
+                            META_MAXIMIZE_HORIZONTAL);
+  else
+    meta_window_maximize (window,
+                          META_MAXIMIZE_HORIZONTAL);
+}
+
+void
+meta_core_toggle_maximize_vert (Display *xdisplay,
+                           Window   frame_xwindow)
+{
+  MetaWindow *window = get_window (xdisplay, frame_xwindow);
+
+  if (meta_prefs_get_raise_on_click ())
+    meta_window_raise (window);
+
+  if (window->maximized_vertically)
+    meta_window_unmaximize (window, 
+                            META_MAXIMIZE_VERTICAL);
+  else
+    meta_window_maximize (window,
+                          META_MAXIMIZE_VERTICAL);
+}
+
+void
 meta_core_unmaximize (Display *xdisplay,
                       Window   frame_xwindow)
 {
Index: src/core.h
===================================================================
--- src/core.h	(revision 3476)
+++ src/core.h	(working copy)
@@ -120,6 +120,10 @@
                                  Window   frame_xwindow);
 void meta_core_toggle_maximize  (Display *xdisplay,
                                  Window   frame_xwindow);
+void meta_core_toggle_maximize_horiz  (Display *xdisplay,
+                                 Window   frame_xwindow);
+void meta_core_toggle_maximize_vert  (Display *xdisplay,
+                                 Window   frame_xwindow);
 void meta_core_unmaximize       (Display *xdisplay,
                                  Window   frame_xwindow);
 void meta_core_maximize         (Display *xdisplay,
Index: src/metacity.schemas.in
===================================================================
--- src/metacity.schemas.in	(revision 3476)
+++ src/metacity.schemas.in	(working copy)
@@ -112,10 +112,13 @@
          <short>Action on title bar double-click</short>
          <long>
            This option determines the effects of double-clicking on the
-           title bar.  Current valid options are 'toggle_shade', which will
+           title bar.  Current valid options are 'toggle_shade' which will
            shade/unshade the window, 'toggle_maximize' which will
-           maximize/unmaximize the window, 'minimize' which will minimize
-           the window, and 'none' which will not do anything.
+           maximize/unmaximize the window, 'toggle_maximize_horiz' which
+           will maximize/unmaximize the window horizontally,
+           'toggle_maximize_vert' which will maximize/unmaximize the
+           window vertically, 'minimize' which will minimize the window,
+           and 'none' which will not do anything.
          </long>
       </locale>
     </schema>
Index: src/common.h
===================================================================
--- src/common.h	(revision 3476)
+++ src/common.h	(working copy)
@@ -174,6 +174,8 @@
 {
   META_ACTION_TITLEBAR_TOGGLE_SHADE,
   META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE,
+  META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE_HORIZ,
+  META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE_VERT,
   META_ACTION_TITLEBAR_MINIMIZE,
   META_ACTION_TITLEBAR_NONE,
   META_ACTION_TITLEBAR_LOWER,
