Author: cazfi
Date: Mon Nov 14 05:49:30 2016
New Revision: 34506

URL: http://svn.gna.org/viewcvs/freeciv?rev=34506&view=rev
Log:
Replaced deprecated gtk_menu_popup() calls with modern constructs in 
gtk3.22-client

See patch #7876

Modified:
    branches/S2_6/client/gui-gtk-3.22/citydlg.c
    branches/S2_6/client/gui-gtk-3.22/optiondlg.c
    branches/S2_6/client/gui-gtk-3.22/pages.c

Modified: branches/S2_6/client/gui-gtk-3.22/citydlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/citydlg.c?rev=34506&r1=34505&r2=34506&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.22/citydlg.c (original)
+++ branches/S2_6/client/gui-gtk-3.22/citydlg.c Mon Nov 14 05:49:30 2016
@@ -2358,33 +2358,6 @@
 }
 
 /****************************************************************
-  Set city menu position
-*****************************************************************/
-static void city_menu_position(GtkMenu *menu, gint *x, gint *y,
-                               gboolean *push_in, gpointer data)
-{
-  GtkWidget *widget;
-  GtkAllocation allocation;
-  gint xpos;
-  gint ypos;
-
-  fc_assert_ret(GTK_IS_BUTTON(data));
-
-  widget = GTK_WIDGET(data);
-
-  gtk_widget_get_allocation(widget, &allocation);
-
-  gdk_window_get_origin(gtk_widget_get_window(widget), &xpos, &ypos);
-
-  xpos += allocation.x + allocation.width/2;
-  ypos += allocation.y + allocation.height/2;
-
-  *x = xpos;
-  *y = ypos;
-  *push_in = TRUE;
-}
-
-/****************************************************************
   Destroy widget -callback
 *****************************************************************/
 static void destroy_func(GtkWidget *w, gpointer data)
@@ -2395,8 +2368,8 @@
 /****************************************************************
 Pop-up menu to change attributes of supported units
 *****************************************************************/
-static gboolean supported_unit_callback(GtkWidget * w, GdkEventButton * ev,
-                                       gpointer data)
+static gboolean supported_unit_callback(GtkWidget *w, GdkEventButton *ev,
+                                        gpointer data)
 {
   GtkWidget *menu, *item;
   struct city_dialog *pdialog;
@@ -2448,11 +2421,9 @@
 
     gtk_widget_show_all(menu);
 
-    gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
-      city_menu_position, w, ev->button, ev->time);
-
-
-  }
+    gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL);
+  }
+
   return TRUE;
 }
 
@@ -2460,7 +2431,7 @@
 Pop-up menu to change attributes of units, ex. change homecity.
 *****************************************************************/
 static gboolean present_unit_callback(GtkWidget * w, GdkEventButton * ev,
-                                     gpointer data)
+                                      gpointer data)
 {
   GtkWidget *menu, *item;
   struct city_dialog *pdialog;
@@ -2568,9 +2539,9 @@
 
     gtk_widget_show_all(menu);
 
-    gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
-      city_menu_position, w, ev->button, ev->time);
-  }
+    gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL);
+  }
+
   return TRUE;
 }
 

Modified: branches/S2_6/client/gui-gtk-3.22/optiondlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/optiondlg.c?rev=34506&r1=34505&r2=34506&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.22/optiondlg.c       (original)
+++ branches/S2_6/client/gui-gtk-3.22/optiondlg.c       Mon Nov 14 05:49:30 2016
@@ -209,7 +209,7 @@
                    G_CALLBACK(option_apply_callback), poption);
 
   gtk_widget_show_all(menu);
-  gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, 0);
+  gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL);
 
   return TRUE;
 }

Modified: branches/S2_6/client/gui-gtk-3.22/pages.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/pages.c?rev=34506&r1=34505&r2=34506&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.22/pages.c   (original)
+++ branches/S2_6/client/gui-gtk-3.22/pages.c   Mon Nov 14 05:49:30 2016
@@ -2014,8 +2014,7 @@
     pconn = conn_by_number(conn_id);
 
     menu = create_conn_menu(pplayer, pconn);
-    gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
-                   NULL, NULL, event->button, event->time);
+    gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL);
     ret = TRUE;
   }
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to