=== modified file 'src/common.h'
--- src/common.h	2007-04-16 04:48:14 +0000
+++ src/common.h	2007-05-19 18:21:34 +0000
@@ -174,6 +174,8 @@
 {
   META_ACTION_TITLEBAR_TOGGLE_SHADE,
   META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE,
+  META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE_HORIZ,
+  META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE_VERT,
   META_ACTION_TITLEBAR_MINIMIZE,
   META_ACTION_TITLEBAR_NONE,
   META_ACTION_TITLEBAR_LOWER,

=== modified file 'src/core.c'
--- src/core.c	2007-04-16 04:48:14 +0000
+++ src/core.c	2007-05-19 18:22:24 +0000
@@ -341,6 +341,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)
 {

=== modified file 'src/frames.c'
--- src/frames.c	2007-04-23 22:44:01 +0000
+++ src/frames.c	2007-05-19 18:23:18 +0000
@@ -1232,6 +1232,28 @@
       }
       break;
 
+	case META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE_HORIZ:
+	  {
+		  flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
+
+		  if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE)
+		  {
+			  meta_core_toggle_maximize_horiz (gdk_display, frame->xwindow);
+		  }
+	  }	
+	  break;
+
+	case META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE_VERT:
+	  {
+		  flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
+
+		  if (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE)
+		  {
+			  meta_core_toggle_maximize_vert (gdk_display, frame->xwindow);
+		  }
+	  }	
+	  break;
+
     case META_ACTION_TITLEBAR_MINIMIZE:
       {
         flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);

=== modified file 'src/metacity.schemas.in'
--- src/metacity.schemas.in	2007-03-11 02:39:07 +0000
+++ src/metacity.schemas.in	2007-05-19 19:01:18 +0000
@@ -115,10 +115,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>

=== modified file 'src/prefs.c'
--- src/prefs.c	2007-04-25 03:30:17 +0000
+++ src/prefs.c	2007-05-19 18:24:26 +0000
@@ -1670,6 +1670,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_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE_HORIZ;
+  else if (strcmp (str, "toggle_maximize_vert") == 0)
+    return META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE_VERT;
   else if (strcmp (str, "minimize") == 0)
     return META_ACTION_TITLEBAR_MINIMIZE;
   else if (strcmp (str, "none") == 0)

