[PATCH] Fix notebook keynav in property window



The keybindings for switching tabs in notebooks doesn't always work for
the file properties window's notebook, filed as bug 318354 [1].

The attached patch fixes that.

Note that a new diff is required as soon as the "Custom Image" button
changes are in for HEAD.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=318354

-- 
Christian Neumair <chris gnome-de org>
Index: src/file-manager/fm-properties-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-properties-window.c,v
retrieving revision 1.219
diff -u -p -r1.219 fm-properties-window.c
--- src/file-manager/fm-properties-window.c	20 Sep 2005 16:05:44 -0000	1.219
+++ src/file-manager/fm-properties-window.c	9 Oct 2005 20:44:22 -0000
@@ -3830,11 +3830,28 @@ remove_image_button_callback (GtkWidget 
 	reset_icon (properties_window);
 }
 
+static gboolean
+real_key_press_event (GtkWidget *widget,
+		      GdkEventKey *event)
+{
+	GtkWidget *notebook;
+
+	notebook = (GtkWidget *) FM_PROPERTIES_WINDOW (widget)->details->notebook;
+	/* ensure that the notebook keybindings work, no matter what widget is focused */
+	if (notebook != NULL &&
+	    GTK_WIDGET_CLASS (g_type_class_peek (GTK_TYPE_NOTEBOOK))->key_press_event (notebook, event)) {
+		return TRUE;
+	}
+ 
+	return GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
+}
+ 
 static void
 fm_properties_window_class_init (FMPropertiesWindowClass *class)
 {
 	G_OBJECT_CLASS (class)->finalize = real_finalize;
 	GTK_OBJECT_CLASS (class)->destroy = real_destroy;
+	GTK_WIDGET_CLASS (class)->key_press_event = real_key_press_event;
 }
 
 static void

Attachment: signature.asc
Description: This is a digitally signed message part



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