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

 Even when we are looking in to some report, cursor is selected as if
map canvas is visible. This problem is easiest to reproduce in editor
mode where cursor is CURSOR_INVALID most of the time.
 Fix attached.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-gtk-2.0/gui_main.c freeciv/client/gui-gtk-2.0/gui_main.c
--- freeciv/client/gui-gtk-2.0/gui_main.c	2007-03-05 21:11:59.000000000 +0200
+++ freeciv/client/gui-gtk-2.0/gui_main.c	2007-03-09 02:23:58.000000000 +0200
@@ -100,6 +100,7 @@
 GtkWidget *toplevel_tabs;
 GtkWidget *top_vbox;
 GtkWidget *top_notebook, *bottom_notebook;
+GtkWidget *map_widget;
 
 int city_names_font_size = 0, city_productions_font_size = 0;
 PangoFontDescription *main_font;
@@ -1107,13 +1108,13 @@
 
   /* Map canvas and scrollbars */
 
-  table = gtk_table_new(2, 2, FALSE);
+  map_widget = gtk_table_new(2, 2, FALSE);
 
   label = gtk_label_new_with_mnemonic(_("_Map"));
-  gtk_notebook_append_page(GTK_NOTEBOOK(top_notebook), table, label);
+  gtk_notebook_append_page(GTK_NOTEBOOK(top_notebook), map_widget, label);
 
   frame = gtk_frame_new(NULL);
-  gtk_table_attach(GTK_TABLE(table), frame, 0, 1, 0, 1,
+  gtk_table_attach(GTK_TABLE(map_widget), frame, 0, 1, 0, 1,
                    GTK_EXPAND|GTK_SHRINK|GTK_FILL,
                    GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0);
 
@@ -1137,11 +1138,11 @@
   gtk_container_add(GTK_CONTAINER(frame), map_canvas);
 
   map_horizontal_scrollbar = gtk_hscrollbar_new(NULL);
-  gtk_table_attach(GTK_TABLE(table), map_horizontal_scrollbar, 0, 1, 1, 2,
+  gtk_table_attach(GTK_TABLE(map_widget), map_horizontal_scrollbar, 0, 1, 1, 2,
                    GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
 
   map_vertical_scrollbar = gtk_vscrollbar_new(NULL);
-  gtk_table_attach(GTK_TABLE(table), map_vertical_scrollbar, 1, 2, 0, 1,
+  gtk_table_attach(GTK_TABLE(map_widget), map_vertical_scrollbar, 1, 2, 0, 1,
                    0, GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0);
 
   g_signal_connect(map_canvas, "expose_event",
diff -Nurd -X.diff_ignore freeciv/client/gui-gtk-2.0/gui_main.h freeciv/client/gui-gtk-2.0/gui_main.h
--- freeciv/client/gui-gtk-2.0/gui_main.h	2007-03-05 21:11:59.000000000 +0200
+++ freeciv/client/gui-gtk-2.0/gui_main.h	2007-03-09 02:22:46.000000000 +0200
@@ -69,6 +69,7 @@
 
 extern GtkWidget *	toplevel_tabs;
 extern GtkWidget *	top_notebook;
+extern GtkWidget *      map_widget;
 extern GtkWidget *	bottom_notebook;
 extern GtkTextBuffer *	message_buffer;
 extern GtkTreeStore *conn_model;
diff -Nurd -X.diff_ignore freeciv/client/gui-gtk-2.0/mapctrl.c freeciv/client/gui-gtk-2.0/mapctrl.c
--- freeciv/client/gui-gtk-2.0/mapctrl.c	2007-03-05 21:11:59.000000000 +0200
+++ freeciv/client/gui-gtk-2.0/mapctrl.c	2007-03-09 02:26:20.000000000 +0200
@@ -395,6 +395,13 @@
   struct unit_list *active_units = get_units_in_focus();
   int canvas_x, canvas_y;
 
+  if (gtk_notebook_get_current_page(top_notebook)
+      != gtk_notebook_page_num(top_notebook, map_widget)) {
+    /* Map is not currently topmost tab. Do not use tile specific cursors. */
+    update_mouse_cursor(CURSOR_DEFAULT);
+    return TRUE;
+  }
+
   /* Bizarrely, this function can be called even when we don't "leave"
    * the map canvas, for instance, it gets called any time the mouse is
    * clicked. */
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to