diff -Nuar metacity-2.24.0/src/core/display.c metacity-2.24.0-doubleclick/src/core/display.c
--- metacity-2.24.0/src/core/display.c	2008-08-18 15:29:06.000000000 +0300
+++ metacity-2.24.0-doubleclick/src/core/display.c	2008-12-09 18:43:25.000000000 +0200
@@ -77,6 +77,7 @@
 #include <X11/extensions/Xfixes.h>
 #endif
 #include <string.h>
+#include <gdk/gdk.h>
 
 #define GRAB_OP_IS_WINDOW_SWITCH(g)                     \
         (g == META_GRAB_OP_KEYBOARD_TABBING_NORMAL  ||  \
@@ -1777,9 +1778,38 @@
         }
       break;
     case ButtonRelease:
-      if (display->grab_window == window &&
-          grab_op_is_mouse (display->grab_op))
-        meta_window_handle_mouse_grab_op_event (window, event);
+      if (display->grab_window == window)
+        {
+          if (grab_op_is_mouse (display->grab_op))
+            meta_window_handle_mouse_grab_op_event (window, event);
+          else if (display->grab_op == META_GRAB_OP_CLICKING_MENU &&
+              meta_prefs_get_close_on_double_click_menu ())
+            {
+              /* We can't rely on GTK's idea of what a double-click is
+               * here, since we're on our own during a grab. And X itself
+               * doesn't grok the concept of double-clicks. So we keep a
+               * track of when they last clicked on the menu button...
+               */
+              static unsigned long previous_menu_click = 0;
+
+              guint click_delay = event->xbutton.time - previous_menu_click;
+              previous_menu_click = event->xbutton.time;
+
+              /* But we *can* ask GDK how long it thinks a double-click
+               * should take.
+               */
+              if (click_delay <= gdk_display_get_default ()->double_click_time
+                  && click_delay >= 0 /* being careful of wraps */ )
+                {
+                  /* Okay, so they double-clicked the menu button. */
+                  meta_display_end_grab_op (display,
+                                            event->xbutton.time);
+
+                  if (window && window->has_close_func)
+                    meta_window_delete (window, event->xbutton.time);
+                }
+            }
+        }
       break;
     case MotionNotify:
       if (display->grab_window == window &&
diff -Nuar metacity-2.24.0/src/core/prefs.c metacity-2.24.0-doubleclick/src/core/prefs.c
--- metacity-2.24.0/src/core/prefs.c	2008-08-18 15:29:06.000000000 +0300
+++ metacity-2.24.0-doubleclick/src/core/prefs.c	2008-12-09 18:43:25.000000000 +0200
@@ -49,6 +49,7 @@
  */
 #define KEY_TITLEBAR_FONT "/apps/metacity/general/titlebar_font"
 #define KEY_NUM_WORKSPACES "/apps/metacity/general/num_workspaces"
+#define KEY_CLOSE_ON_DOUBLE_CLICK_MENU "/apps/metacity/general/close_on_double_click_menu"
 #define KEY_GNOME_ACCESSIBILITY "/desktop/gnome/interface/accessibility"
 
 #define KEY_COMMAND_PREFIX "/apps/metacity/keybinding_commands/command_"
@@ -88,6 +89,7 @@
 static gboolean provide_visual_bell = FALSE;
 static gboolean bell_is_audible = TRUE;
 static gboolean reduced_resources = FALSE;
+static gboolean close_on_double_click_menu = FALSE;
 static gboolean gnome_accessibility = FALSE;
 static gboolean gnome_animations = TRUE;
 static char *cursor_theme = NULL;
@@ -391,6 +393,11 @@
       &reduced_resources,
       FALSE,
     },
+    { "/apps/metacity/general/close_on_double_click_menu",
+      META_PREF_CLOSE_ON_DOUBLE_CLICK_MENU,
+      &close_on_double_click_menu,
+      FALSE,
+    },
     { "/desktop/gnome/interface/accessibility",
       META_PREF_GNOME_ACCESSIBILITY,
       &gnome_accessibility,
@@ -1764,6 +1771,9 @@
     case META_PREF_REDUCED_RESOURCES:
       return "REDUCED_RESOURCES";
 
+    case META_PREF_CLOSE_ON_DOUBLE_CLICK_MENU:
+      return "CLOSE_ON_DOUBLE_CLICK_MENU";
+
     case META_PREF_GNOME_ACCESSIBILITY:
       return "GNOME_ACCESSIBILTY";
 
@@ -2867,6 +2877,12 @@
 }
 
 gboolean
+meta_prefs_get_close_on_double_click_menu (void)
+{
+  return close_on_double_click_menu;
+}
+
+gboolean
 meta_prefs_get_gnome_accessibility ()
 {
   return gnome_accessibility;
diff -Nuar metacity-2.24.0/src/include/prefs.h metacity-2.24.0-doubleclick/src/include/prefs.h
--- metacity-2.24.0/src/include/prefs.h	2008-08-18 15:29:04.000000000 +0300
+++ metacity-2.24.0-doubleclick/src/include/prefs.h	2008-12-09 18:43:25.000000000 +0200
@@ -55,6 +55,7 @@
   META_PREF_AUDIBLE_BELL,
   META_PREF_VISUAL_BELL_TYPE,
   META_PREF_REDUCED_RESOURCES,
+  META_PREF_CLOSE_ON_DOUBLE_CLICK_MENU,
   META_PREF_GNOME_ACCESSIBILITY,
   META_PREF_GNOME_ANIMATIONS,
   META_PREF_CURSOR_THEME,
@@ -86,6 +87,7 @@
 gboolean                    meta_prefs_get_auto_raise         (void);
 int                         meta_prefs_get_auto_raise_delay   (void);
 gboolean                    meta_prefs_get_reduced_resources  (void);
+gboolean                    meta_prefs_get_close_on_double_click_menu (void);
 gboolean                    meta_prefs_get_gnome_accessibility (void);
 gboolean                    meta_prefs_get_gnome_animations   (void);
 
diff -Nuar metacity-2.24.0/src/metacity.schemas metacity-2.24.0-doubleclick/src/metacity.schemas
--- metacity-2.24.0/src/metacity.schemas	2008-09-22 18:43:47.000000000 +0300
+++ metacity-2.24.0-doubleclick/src/metacity.schemas	2008-12-09 18:44:09.000000000 +0200
@@ -7203,6 +7203,23 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/metacity/general/close_on_double_click_menu</key>
+      <applyto>/apps/metacity/general/close_on_double_click_menu</applyto>
+      <owner>metacity</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+         <short>If true, close windows when their menu icon is double clicked</short>
+         <long>
+           If true, user will be able to close the window by double clicking
+           its menu button.  This can be considered harmful if the application
+           does not ask to save changes prior to exit, as the user may
+           accidentally lose its work.
+         </long>
+      </locale>
+    </schema>
+
     <!-- Window Keybindings -->
 
     <schema>
diff -Nuar metacity-2.24.0/src/metacity.schemas.in metacity-2.24.0-doubleclick/src/metacity.schemas.in
--- metacity-2.24.0/src/metacity.schemas.in	2008-08-18 15:29:07.000000000 +0300
+++ metacity-2.24.0-doubleclick/src/metacity.schemas.in	2008-12-09 18:43:25.000000000 +0200
@@ -388,6 +388,23 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/metacity/general/close_on_double_click_menu</key>
+      <applyto>/apps/metacity/general/close_on_double_click_menu</applyto>
+      <owner>metacity</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+         <short>If true, close windows when their menu icon is double clicked</short>
+         <long>
+           If true, user will be able to close the window by double clicking
+           its menu button.  This can be considered harmful if the application
+           does not ask to save changes prior to exit, as the user may
+           accidentally lose its work.
+         </long>
+      </locale>
+    </schema>
+
     <!-- Window Keybindings -->
 
     <schema>
