Index: src/nautilus-window.c
===================================================================
--- src/nautilus-window.c	(revisione 13853)
+++ src/nautilus-window.c	(copia locale)
@@ -749,9 +749,14 @@ nautilus_window_key_press_event (GtkWidg
 				 GdkEventKey *event)
 {
 	NautilusWindow *window;
+	gboolean handled, force_chain;
+	guint modifier;
+	GtkWidget *focus_widget;
 	int i;
 
 	window = NAUTILUS_WINDOW (widget);
+	modifier = event->state & gtk_accelerator_get_default_mod_mask ();
+	handled = force_chain = FALSE;
 
 	for (i = 0; i < G_N_ELEMENTS (extra_window_keybindings); i++) {
 		if (extra_window_keybindings[i].keyval == event->keyval) {
@@ -775,6 +780,27 @@ nautilus_window_key_press_event (GtkWidg
 			break;
 		}
 	}
+	
+	/* This snippet is adapted from Epiphany, and allows us to properly handle
+	 * widgets keybindings before GtkAction ones. See ephy-window.c key-press-event
+	 * handler and http://bugzilla.gnome.org/show_bug.cgi?id=314431.
+	 */
+	
+	if (event->keyval == GDK_Escape && modifier == 0) {
+		/* Always pass Escape to both the widget, and the parent */
+		force_chain = TRUE;
+	} 
+	
+	focus_widget = gtk_window_get_focus (GTK_WINDOW (window));
+
+	if (GTK_IS_WIDGET (focus_widget)) {
+		handled = gtk_widget_event (focus_widget,
+					    (GdkEvent*) event);
+	}
+	
+	if (handled && !force_chain) {
+		return handled;
+	}
 
 	return GTK_WIDGET_CLASS (nautilus_window_parent_class)->key_press_event (widget, event);
 }
