commit 659ee7a403f63f60660e6fd2bcc3fbc68d87f3cd
Author: Cody Russell <bratsche@gnome.org>
Date:   Sat Feb 27 13:08:38 2010 -0600

    Support dragging the window from menubars.

diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index c9b8949..575168c 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -377,6 +377,14 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
 							 TRUE,
 							 GTK_PARAM_READWRITE));
 
+
+  gtk_widget_class_install_style_property (widget_class,
+                                           g_param_spec_boolean ("window-dragging",
+                                                                 P_("Window dragging"),
+                                                                 P_("Window dragging"),
+                                                                 FALSE,
+                                                                 GTK_PARAM_READWRITE));
+
   g_type_class_add_private (object_class, sizeof (GtkMenuShellPrivate));
 }
 
@@ -585,6 +593,8 @@ gtk_menu_shell_button_press (GtkWidget      *widget,
 
   if (!menu_shell->active || !menu_shell->button)
     {
+      gboolean initially_active = menu_shell->active;
+
       _gtk_menu_shell_activate (menu_shell);
 
       menu_shell->button = event->button;
@@ -593,12 +603,36 @@ gtk_menu_shell_button_press (GtkWidget      *widget,
 	  menu_item->parent == widget &&
           menu_item != menu_shell->active_menu_item)
         {
+          _gtk_menu_shell_activate (menu_shell);
+          menu_shell->button = event->button;
+
           if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
             {
               menu_shell->activate_time = event->time;
               gtk_menu_shell_select_item (menu_shell, menu_item);
             }
         }
+      else
+        {
+          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);
+                }
+            }
+        }
     }
   else
     {
