goffice r2062 - in trunk: . goffice/gtk



Author: mortenw
Date: Mon Apr 21 13:45:15 2008
New Revision: 2062
URL: http://svn.gnome.org/viewvc/goffice?rev=2062&view=rev

Log:
2008-04-21  Morten Welinder  <terra gnome org>

	* goffice/gtk/goffice-gtk.c (go_gtk_editable_enters): Avoid
	infinite recursion if default widget is not sensitive.




Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/goffice/gtk/goffice-gtk.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Mon Apr 21 13:45:15 2008
@@ -10,6 +10,7 @@
 Morten:
 	* Add go_format_is_invalid.
 	* Improve date convention framework.
+	* Fix problem with [Enter] causing infinite recursion.
 
 --------------------------------------------------------------------------
 goffice 0.6.2:

Modified: trunk/goffice/gtk/goffice-gtk.c
==============================================================================
--- trunk/goffice/gtk/goffice-gtk.c	(original)
+++ trunk/goffice/gtk/goffice-gtk.c	Mon Apr 21 13:45:15 2008
@@ -185,6 +185,18 @@
 	return g_signal_connect_swapped (w, detailed_signal, c_handler, data);
 }
 
+
+/*
+ * A variant of gtk_window_activate_default that does not end up reactivating
+ * the widget that [Enter] was pressed in.
+ */
+static void
+cb_activate_default (GtkWindow *window)
+{
+	if (window->default_widget && GTK_WIDGET_IS_SENSITIVE (window->default_widget))
+		gtk_widget_activate (window->default_widget);
+}
+
 /**
  * go_gtk_editable_enters:
  * @window:
@@ -202,7 +214,7 @@
 	g_return_if_fail (GTK_IS_WINDOW (window));
 	g_signal_connect_swapped (G_OBJECT (w),
 		"activate",
-		G_CALLBACK (gtk_window_activate_default), window);
+		G_CALLBACK (cb_activate_default), window);
 }
 
 void



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