[nautilus] window: steal all accelerators/mnemonics keybindings when renaming



commit 92e40dd094a812db6bcc3e60c0830d20b3f07b15
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Sep 8 12:07:37 2011 -0400

    window: steal all accelerators/mnemonics keybindings when renaming
    
    If we're renaming, we really want to ignore all the accelerators
    and mnemonics coming from NautilusWindow and NautilusView, as they might
    conflict with the regular bindings expected in an editable widget, such
    as an editable GtkCellRendererText or EelEditableLabel.
    This should fix all the recent keybinding-related regressions, such as
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658105
    https://bugzilla.gnome.org/show_bug.cgi?id=651574

 src/nautilus-window.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 810f69f..1d86e26 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1092,10 +1092,26 @@ nautilus_window_key_press_event (GtkWidget *widget,
 				 GdkEventKey *event)
 {
 	NautilusWindow *window;
+	NautilusWindowSlot *active_slot;
+	NautilusView *view;
 	int i;
 
 	window = NAUTILUS_WINDOW (widget);
 
+	active_slot = nautilus_window_get_active_slot (window);
+	view = active_slot->content_view;
+
+	if (view != NULL && nautilus_view_get_is_renaming (view)) {
+		/* if we're renaming, just forward the event to the
+		 * focused widget and return. We don't want to process the window
+		 * accelerator bindings, as they might conflict with the 
+		 * editable widget bindings.
+		 */
+		if (gtk_window_propagate_key_event (GTK_WINDOW (window), event)) {
+			return TRUE;
+		}
+	}
+
 	for (i = 0; i < G_N_ELEMENTS (extra_window_keybindings); i++) {
 		if (extra_window_keybindings[i].keyval == event->keyval) {
 			const GList *action_groups;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]