<URL: http://bugs.freeciv.org/Ticket/Display.html?id=35738 >

Bug happens when typing "/obs" in the chatline after selecting edit mode
in the client menu.

Reported by Mike Kaufman and Jason Dorje Short.
Index: client/gui-gtk-2.0/menu.c
===================================================================
--- client/gui-gtk-2.0/menu.c	(revision 12623)
+++ client/gui-gtk-2.0/menu.c	(working copy)
@@ -589,12 +589,18 @@
   }
 }
 
+static int menu_updating = FALSE;
+
 /****************************************************************************
   Callback function for when an item is chosen from the "editor" menu.
 ****************************************************************************/
 static void editor_menu_callback(gpointer callback_data,
                                  guint callback_action, GtkWidget *widget)
 {   
+  if (menu_updating) {
+    return;
+  }
+
   switch(callback_action) {
   case MENU_EDITOR_TOGGLE:
     key_editor_toggle();
@@ -1337,6 +1343,8 @@
 
     menus_set_active("<main>/_View/_Full Screen", fullscreen_mode);
 
+    menu_updating = TRUE;
+
     menus_set_sensitive("<main>/_Editor",
 			can_conn_enable_editing(&aconnection));
     menus_set_sensitive("<main>/_Editor/_Tools",
@@ -1346,6 +1354,8 @@
     menus_set_active("<main>/_Editor/Editing Mode",
 		     can_conn_edit(&aconnection));
 
+    menu_updating = FALSE;
+
     /* Remaining part of this function: Update Orders menu */
 
     if (!can_client_issue_orders()) {
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to