Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#9666) gtk2 client dialogs pop under
Home

[Freeciv-Dev] (PR#9666) gtk2 client dialogs pop under

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: dnielsen@xxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#9666) gtk2 client dialogs pop under
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Sat, 13 Nov 2004 15:21:20 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9666 >

I can now reproduce this since I upgraded to Fedora Core 3.

It seems some errors were introduced by the fullscreen patch, here
is a fix.

Index: client/gui-gtk-2.0/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/citydlg.c,v
retrieving revision 1.99
diff -u -u -r1.99 citydlg.c
--- client/gui-gtk-2.0/citydlg.c        10 Nov 2004 02:10:36 -0000      1.99
+++ client/gui-gtk-2.0/citydlg.c        13 Nov 2004 23:20:07 -0000
@@ -2341,12 +2341,12 @@
   value = city_buy_cost(pdialog->pcity);
 
   if (game.player_ptr->economic.gold >= value) {
-    shell = gtk_message_dialog_new(GTK_WINDOW(pdialog->shell),
+    shell = gtk_message_dialog_new(NULL,
         GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
         GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
         _("Buy %s for %d gold?\nTreasury contains %d gold."),
         name, value, game.player_ptr->economic.gold);
-    setup_dialog(shell, toplevel);
+    setup_dialog(shell, pdialog->shell);
     gtk_window_set_title(GTK_WINDOW(shell), _("Buy It!"));
     gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_NO);
 
@@ -2355,12 +2355,12 @@
     }
     gtk_widget_destroy(shell);
   } else {
-    shell = gtk_message_dialog_new(GTK_WINDOW(pdialog->shell),
+    shell = gtk_message_dialog_new(NULL,
         GTK_DIALOG_DESTROY_WITH_PARENT,
         GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
         _("%s costs %d gold.\nTreasury contains %d gold."),
         name, value, game.player_ptr->economic.gold);
-    setup_dialog(shell, toplevel);
+    setup_dialog(shell, pdialog->shell);
     gtk_window_set_title(GTK_WINDOW(shell), _("Buy It!"));
     g_signal_connect(shell, "response", G_CALLBACK(gtk_widget_destroy),
       NULL);
@@ -2391,13 +2391,13 @@
 
   pdialog->sell_id = id;
 
-  shl = gtk_message_dialog_new(GTK_WINDOW(pdialog->shell),
+  shl = gtk_message_dialog_new(NULL,
     GTK_DIALOG_DESTROY_WITH_PARENT,
     GTK_MESSAGE_QUESTION,
     GTK_BUTTONS_YES_NO,
     _("Sell %s for %d gold?"),
     get_impr_name_ex(pdialog->pcity, id), impr_sell_gold(id));
-  setup_dialog(shl, toplevel);
+  setup_dialog(shl, pdialog->shell);
   pdialog->sell_shell = shl;
   
   gtk_window_set_title(GTK_WINDOW(shl), _("Sell It!"));
Index: client/gui-gtk-2.0/cma_fe.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/cma_fe.c,v
retrieving revision 1.19
diff -u -u -r1.19 cma_fe.c
--- client/gui-gtk-2.0/cma_fe.c 20 Jul 2004 16:27:07 -0000      1.19
+++ client/gui-gtk-2.0/cma_fe.c 13 Nov 2004 23:20:08 -0000
@@ -593,7 +593,7 @@
   GtkWidget *parent = gtk_widget_get_toplevel(pdialog->shell), *shl;
 
   pdialog->id = preset_index;
-  shl = gtk_message_dialog_new(GTK_WINDOW(parent),
+  shl = gtk_message_dialog_new(NULL,
                               GTK_DIALOG_DESTROY_WITH_PARENT,
                               GTK_MESSAGE_QUESTION,
                               GTK_BUTTONS_YES_NO,
Index: client/gui-gtk-2.0/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/dialogs.c,v
retrieving revision 1.78
diff -u -u -r1.78 dialogs.c
--- client/gui-gtk-2.0/dialogs.c        7 Nov 2004 14:17:31 -0000       1.78
+++ client/gui-gtk-2.0/dialogs.c        13 Nov 2004 23:20:09 -0000
@@ -735,7 +735,7 @@
   GtkWidget *shell;
   
   if (pcity->incite_revolt_cost == INCITE_IMPOSSIBLE_COST) {
-    shell = gtk_message_dialog_new(GTK_WINDOW(toplevel),
+    shell = gtk_message_dialog_new(NULL,
       0,
       GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
       _("You can't incite a revolt in %s."),
@@ -743,7 +743,7 @@
     gtk_window_set_title(GTK_WINDOW(shell), _("City can't be incited!"));
   setup_dialog(shell, toplevel);
   } else if (game.player_ptr->economic.gold >= pcity->incite_revolt_cost) {
-    shell = gtk_message_dialog_new(GTK_WINDOW(toplevel),
+    shell = gtk_message_dialog_new(NULL,
       0,
       GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
       _("Incite a revolt for %d gold?\nTreasury contains %d gold."),
@@ -751,7 +751,7 @@
     gtk_window_set_title(GTK_WINDOW(shell), _("Incite a Revolt!"));
     setup_dialog(shell, toplevel);
   } else {
-    shell = gtk_message_dialog_new(GTK_WINDOW(toplevel),
+    shell = gtk_message_dialog_new(NULL,
       0,
       GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
       _("Inciting a revolt costs %d gold.\nTreasury contains %d gold."),
Index: client/gui-gtk-2.0/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/menu.c,v
retrieving revision 1.51
diff -u -u -r1.51 menu.c
--- client/gui-gtk-2.0/menu.c   8 Nov 2004 01:25:03 -0000       1.51
+++ client/gui-gtk-2.0/menu.c   13 Nov 2004 23:20:09 -0000
@@ -229,10 +229,11 @@
          GTK_MESSAGE_WARNING,
          GTK_BUTTONS_OK_CANCEL,
          _("Leaving a local game will end it!"));
+      setup_dialog(dialog, toplevel);
       gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
       g_signal_connect(dialog, "response", 
          G_CALLBACK(leave_local_game_response), NULL);
-      gtk_widget_show_all(dialog);
+      gtk_window_present(GTK_WINDOW(dialog));
     } else {
       disconnect_from_server();
     }
Index: client/gui-gtk-2.0/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/repodlgs.c,v
retrieving revision 1.66
diff -u -u -r1.66 repodlgs.c
--- client/gui-gtk-2.0/repodlgs.c       12 Nov 2004 19:46:31 -0000      1.66
+++ client/gui-gtk-2.0/repodlgs.c       13 Nov 2004 23:20:10 -0000
@@ -780,11 +780,12 @@
   if (is_impr == TRUE) {
     if (response == ECONOMY_SELL_ALL) {
       shell = gtk_message_dialog_new(
-         GTK_WINDOW(gui_dialog_get_toplevel(dlg)),
+         NULL,
          GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
          GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
          _("Do you really wish to sell your %s?\n"),
          get_improvement_name(i));
+      setup_dialog(shell, gui_dialog_get_toplevel(dlg));
       gtk_window_set_title(GTK_WINDOW(shell), _("Sell Improvements"));
 
       if (gtk_dialog_run(GTK_DIALOG(shell)) == GTK_RESPONSE_YES) {
@@ -804,10 +805,11 @@
   }
 
   shell = gtk_message_dialog_new(
-      GTK_WINDOW(gui_dialog_get_toplevel(dlg)),
+      NULL,
       GTK_DIALOG_DESTROY_WITH_PARENT,
       GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
       buf);
+  setup_dialog(shell, gui_dialog_get_toplevel(dlg));
 
   g_signal_connect(shell, "response", G_CALLBACK(gtk_widget_destroy), NULL);
   gtk_window_set_title(GTK_WINDOW(shell), _("Sell-Off: Results"));
@@ -1136,7 +1138,7 @@
     ut2 = can_upgrade_unittype(game.player_ptr, activeunits_type[row]);
 
     shell = gtk_message_dialog_new(
-         GTK_WINDOW(gui_dialog_get_toplevel(dlg)),
+         NULL,
          GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
          GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
          _("Upgrade as many %s to %s as possible for %d gold each?\n"
@@ -1144,6 +1146,8 @@
          unit_types[ut1].name, unit_types[ut2].name,
          unit_upgrade_price(game.player_ptr, ut1, ut2),
          game.player_ptr->economic.gold);
+    setup_dialog(shell, gui_dialog_get_toplevel(dlg));
+
     gtk_window_set_title(GTK_WINDOW(shell), _("Upgrade Obsolete Units"));
 
     if (gtk_dialog_run(GTK_DIALOG(shell)) == GTK_RESPONSE_YES) {

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9666) gtk2 client dialogs pop under, Vasco Alexandre da Silva Costa <=