[Gnucash-changes] r13039 - gnucash/trunk - Andreas Köhler's patch to fix a problem where switching windows

David Hampton hampton at cvs.gnucash.org
Sun Jan 29 18:19:34 EST 2006


Author: hampton
Date: 2006-01-29 18:19:34 -0500 (Sun, 29 Jan 2006)
New Revision: 13039
Trac: http://svn.gnucash.org/trac/changeset/13039

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/gnc-main-window.c
Log:
Andreas Köhler's patch to fix a problem where switching windows
repeatedly confusing the Windows menu.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-01-29 23:01:30 UTC (rev 13038)
+++ gnucash/trunk/ChangeLog	2006-01-29 23:19:34 UTC (rev 13039)
@@ -1,7 +1,11 @@
 2006-01-29  David Hampton  <hampton at employees.org>
 
+	* src/gnome-utils/gnc-main-window.c: Andreas Köhler's patch to fix
+	a problem where switching windows repeatedly confusing the
+	Windows menu. Fixes #327943.
+
 	* gnc-tree-model-commodity.c: Andreas Köhler's patch to fix
-	commodity editor warnings/crash.
+	commodity editor warnings/crash. Fixes #328788.
 
 2006-01-29  Joshua Sled  <jsled at asynchronous.org>
 

Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c	2006-01-29 23:01:30 UTC (rev 13038)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c	2006-01-29 23:19:34 UTC (rev 13039)
@@ -1123,12 +1123,12 @@
    * bottom) on the screen */
   action_list = gtk_radio_action_get_group(GTK_RADIO_ACTION(action));
   first_action = g_slist_last(action_list)->data;
-  g_signal_handlers_block_by_func(first_action,
-				  gnc_main_window_cmd_window_raise, window);
+  g_signal_handlers_block_by_func(G_OBJECT(first_action),
+				  G_CALLBACK(gnc_main_window_cmd_window_raise), window);
   DEBUG("blocked signal on %p, set %p active, window %p", first_action, action, window);
   gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
-  g_signal_handlers_unblock_by_func(first_action,
-				    gnc_main_window_cmd_window_raise, window);
+  g_signal_handlers_unblock_by_func(G_OBJECT(first_action),
+				    G_CALLBACK(gnc_main_window_cmd_window_raise), window);
   g_free(action_name);
   LEAVE(" ");
 }
@@ -2775,19 +2775,23 @@
 static void
 gnc_main_window_cmd_window_raise (GtkAction *action,
 				  GtkRadioAction *current,
-				  GncMainWindow *unused)
+				  GncMainWindow *old_window)
 {
-	GncMainWindow *window;
+	GncMainWindow *new_window;
 	gint value;
 
 	g_return_if_fail(GTK_IS_ACTION(action));
 	g_return_if_fail(GTK_IS_RADIO_ACTION(current));
-	g_return_if_fail(GNC_IS_MAIN_WINDOW(unused));
+	g_return_if_fail(GNC_IS_MAIN_WINDOW(old_window));
 	
-	ENTER("action %p, current %p, window %p", action, current, unused);
+	ENTER("action %p, current %p, window %p", action, current, old_window);
 	value = gtk_radio_action_get_current_value(current);
-	window = g_list_nth_data(active_windows, value);
-	gtk_window_present(GTK_WINDOW(window));
+	new_window = g_list_nth_data(active_windows, value);
+	gtk_window_present(GTK_WINDOW(new_window));
+
+	/* revert the change in the radio group
+     * impossible while handling "changed" (G_SIGNAL_NO_RECURSE) */
+	g_idle_add((GSourceFunc)gnc_main_window_update_radio_button, old_window);
 	LEAVE(" ");
 }
 



More information about the gnucash-changes mailing list