--- a/gtk/gtkmenushell.c	2013-10-08 13:38:56.099171803 +0200
+++ b/gtk/gtkmenushell.c	2013-10-08 13:47:49.679999681 +0200
@@ -48,6 +48,7 @@
 #include "gtkmenuprivate.h"
 #include "gtkmnemonichash.h"
 #include "gtkwindow.h"
+#include "gtkwindowprivate.h"
 #include "gtkprivate.h"
 #include "gtkmain.h"
 #include "gtkintl.h"
@@ -683,6 +684,9 @@
   GtkWidget *menu_item;
   GtkWidget *parent;
 
+  if (event->type == GDK_2BUTTON_PRESS)
+    return _gtk_window_handle_button_press_for_widget (widget, event);
+
   if (event->type != GDK_BUTTON_PRESS)
     return FALSE;
 
@@ -738,21 +742,9 @@
         {
           if (!initially_active)
             {
-              gboolean window_drag = FALSE;
-
-              gtk_widget_style_get (widget,
-                                    "window-dragging", &window_drag,
-                                    NULL);
-
-              if (window_drag)
-                {
-                  gtk_menu_shell_deactivate (menu_shell);
-                  gtk_window_begin_move_drag (GTK_WINDOW (gtk_widget_get_toplevel (widget)),
-                                              event->button,
-                                              event->x_root,
-                                              event->y_root,
-                                              event->time);
-                }
+              if (_gtk_window_handle_button_press_for_widget (widget,
+                                                              event))
+              gtk_menu_shell_deactivate (menu_shell);
             }
         }
     }
--- a/gtk/gtktoolbar.c	2013-10-08 13:48:30.676199148 +0200
+++ b/gtk/gtktoolbar.c	2013-10-08 13:52:08.692866995 +0200
@@ -57,6 +57,7 @@
 #include "gtktypebuiltins.h"
 #include "gtkwidgetpath.h"
 #include "gtkwidgetprivate.h"
+#include "gtkwindowprivate.h"
 
 
 /**
@@ -2713,8 +2714,6 @@
 gtk_toolbar_button_press (GtkWidget      *toolbar,
     			  GdkEventButton *event)
 {
-  GtkWidget *window;
-
   if (gdk_event_triggers_context_menu ((GdkEvent *) event))
     {
       gboolean return_value;
@@ -2726,32 +2725,7 @@
       return return_value;
     }
 
-  if (event->type != GDK_BUTTON_PRESS)
-    return FALSE;
-
-  window = gtk_widget_get_toplevel (toolbar);
-
-  if (window)
-    {
-      gboolean window_drag = FALSE;
-
-      gtk_widget_style_get (toolbar,
-                            "window-dragging", &window_drag,
-                            NULL);
-
-      if (window_drag)
-        {
-          gtk_window_begin_move_drag (GTK_WINDOW (window),
-                                      event->button,
-                                      event->x_root,
-                                      event->y_root,
-                                      event->time);
-
-          return TRUE;
-        }
-    }
-
-  return FALSE;
+  return _gtk_window_handle_button_press_for_widget (toolbar, event);
 }
 
 static gboolean
--- a/gtk/gtkwindow.c	2013-10-08 13:52:27.257224060 +0200
+++ b/gtk/gtkwindow.c	2013-10-08 14:58:42.986076187 +0200
@@ -9793,3 +9793,55 @@
 
   gtk_widget_queue_draw (widget);
 }
+
+gboolean
+_gtk_window_handle_button_press_for_widget (GtkWidget *widget,
+                                            GdkEventButton *event)
+{
+  gboolean processed = FALSE;
+  gboolean window_drag = FALSE;
+  GtkWindow *window;
+
+  gtk_widget_style_get (GTK_WIDGET (widget),
+                        "window-dragging", &window_drag,
+                        NULL);
+
+  if (!window_drag)
+    return FALSE;
+
+  if (event->button != GDK_BUTTON_PRIMARY)
+    return FALSE;
+
+  window = GTK_WINDOW (gtk_widget_get_toplevel (widget));
+
+  switch (event->type)
+    {
+    case GDK_BUTTON_PRESS:
+      gtk_window_begin_move_drag (window,
+                                  event->button,
+                                  event->x_root,
+                                  event->y_root,
+                                  event->time);
+
+      processed = TRUE;
+      break;
+
+      case GDK_2BUTTON_PRESS:
+        {
+          GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET(window));
+
+          if (gdk_window_get_state (gdk_window) & GDK_WINDOW_STATE_MAXIMIZED)
+            gdk_window_unmaximize (gdk_window);
+          else
+            gdk_window_maximize (gdk_window);
+
+          processed = TRUE;
+        }
+        break;
+
+      default:
+        break;
+    }
+
+  return processed;
+}
--- a/gtk/gtkwindowprivate.h	2013-10-08 14:59:00.773304422 +0200
+++ b/gtk/gtkwindowprivate.h	2013-10-08 15:00:05.392427026 +0200
@@ -64,6 +64,9 @@
 void            _gtk_window_set_allocation         (GtkWindow     *window,
                                                     GtkAllocation *allocation);
 
+gboolean _gtk_window_handle_button_press_for_widget (GtkWidget *widget,
+                                                     GdkEventButton *event);
+
 typedef void (*GtkWindowKeysForeachFunc) (GtkWindow      *window,
                                           guint           keyval,
                                           GdkModifierType modifiers,
