Index: ephy-window.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-window.c,v
retrieving revision 1.199
diff -u -p -r1.199 ephy-window.c
--- ephy-window.c	1 Jul 2004 18:07:29 -0000	1.199
+++ ephy-window.c	3 Jul 2004 21:28:59 -0000
@@ -685,6 +685,53 @@ confirm_close_with_modified_forms (EphyW
 	return response == GTK_RESPONSE_OK;
 }
 
+static void
+menubar_deactivate_cb (GtkWidget *menubar,
+		       EphyWindow *window)
+{
+	g_signal_handlers_disconnect_by_func
+		(menubar, G_CALLBACK (menubar_deactivate_cb), window);
+
+	gtk_menu_shell_deselect (GTK_MENU_SHELL (menubar));
+
+	sync_chromes_visibility (window);
+}
+
+static gboolean
+ephy_window_key_press_event (GtkWidget *widget,
+			     GdkEventKey *event)
+{
+	EphyWindow *window = EPHY_WINDOW (widget);
+	GtkWidget *menubar;
+	guint modifiers = gtk_accelerator_get_default_mod_mask ();
+
+        if (event->keyval == GDK_F10 && (event->state & modifiers) == 0)
+	{
+		menubar = gtk_ui_manager_get_widget
+			(GTK_UI_MANAGER (window->ui_merge), "/menubar");
+		g_return_val_if_fail (menubar != NULL && menubar->parent != NULL , FALSE);
+	
+		/* When F10 is pressed gtk+ automatically opens the menu if the
+		 * menubar is visible, but when the menubar is not visible
+		 * (think fullscreen or popup windows) we show it manually and
+		 * hide again when the user activates or otherwise dismisses
+		 * the menu.
+		 */
+		if (!GTK_WIDGET_VISIBLE (menubar))
+		{
+			g_signal_connect (menubar, "deactivate",
+					  G_CALLBACK (menubar_deactivate_cb), window);
+
+			gtk_widget_show (menubar);
+			gtk_menu_shell_select_first (GTK_MENU_SHELL (menubar), FALSE);
+
+			return TRUE;
+		}
+        }
+
+	return GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
+}
+
 static gboolean
 ephy_window_delete_event_cb (GtkWidget *widget, GdkEvent *event, EphyWindow *window)
 {
@@ -1931,6 +1978,7 @@ ephy_window_class_init (EphyWindowClass 
 	gtkobject_class->destroy = ephy_window_destroy;
 
 	widget_class->show = ephy_window_show;
+	widget_class->key_press_event = ephy_window_key_press_event;
 
 	g_object_class_install_property (object_class,
 					 PROP_ACTIVE_TAB,
