Author: cazfi Date: Thu Feb 9 06:33:32 2017 New Revision: 34996 URL: http://svn.gna.org/viewcvs/freeciv?rev=34996&view=rev Log: Replaced deprecated gtk_menu_popup() calls with modern constructs in gtk3.22-client
See gna patch #7876 Modified: branches/S3_0/INSTALL branches/S3_0/client/gui-gtk-3.22/citydlg.c branches/S3_0/client/gui-gtk-3.22/optiondlg.c branches/S3_0/client/gui-gtk-3.22/pages.c branches/S3_0/m4/gtk3.22-client.m4 Modified: branches/S3_0/INSTALL URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/INSTALL?rev=34996&r1=34995&r2=34996&view=diff ============================================================================== --- branches/S3_0/INSTALL (original) +++ branches/S3_0/INSTALL Thu Feb 9 06:33:32 2017 @@ -275,7 +275,7 @@ The "Glib" utility library provides non-graphical functions used by the "Gdk" and "Gtk+" libraries, like hash tables, single linked lists, etc. - Freeciv requires a version of "Glib" greater or equal to 2.48 + Freeciv requires a version of "Glib" greater or equal to 2.50 If the Freeciv configure process tells you that you don't have the Glib library installed, then it may be obtained from here: @@ -315,12 +315,12 @@ Provides an abstraction layer over X-Windows/LinuxFB/Win32 to implement basic drawing functions, windows, clipping, etc. - Freeciv requires a version of "Gtk+" greater or equal to 3.20.0. + Freeciv requires a version of "Gtk+" greater or equal to 3.22.0. If the Freeciv configure process tells you that you don't have the Gtk+ library installed, then it may be obtained from here: - http://ftp.gnome.org/pub/gnome/sources/gtk+/3.22/gtk+-3.22.1.tar.xz + http://ftp.gnome.org/pub/gnome/sources/gtk+/3.22/gtk+-3.22.2.tar.xz "Gtk+" depends on the "Glib", "Atk", "Gdk-Pixbuf", and "Pango" libraries. Modified: branches/S3_0/client/gui-gtk-3.22/citydlg.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.22/citydlg.c?rev=34996&r1=34995&r2=34996&view=diff ============================================================================== --- branches/S3_0/client/gui-gtk-3.22/citydlg.c (original) +++ branches/S3_0/client/gui-gtk-3.22/citydlg.c Thu Feb 9 06:33:32 2017 @@ -2353,33 +2353,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) @@ -2390,8 +2363,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; @@ -2443,11 +2416,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; } @@ -2455,7 +2426,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; @@ -2564,9 +2535,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/S3_0/client/gui-gtk-3.22/optiondlg.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.22/optiondlg.c?rev=34996&r1=34995&r2=34996&view=diff ============================================================================== --- branches/S3_0/client/gui-gtk-3.22/optiondlg.c (original) +++ branches/S3_0/client/gui-gtk-3.22/optiondlg.c Thu Feb 9 06:33:32 2017 @@ -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/S3_0/client/gui-gtk-3.22/pages.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.22/pages.c?rev=34996&r1=34995&r2=34996&view=diff ============================================================================== --- branches/S3_0/client/gui-gtk-3.22/pages.c (original) +++ branches/S3_0/client/gui-gtk-3.22/pages.c Thu Feb 9 06:33:32 2017 @@ -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; } Modified: branches/S3_0/m4/gtk3.22-client.m4 URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/m4/gtk3.22-client.m4?rev=34996&r1=34995&r2=34996&view=diff ============================================================================== --- branches/S3_0/m4/gtk3.22-client.m4 (original) +++ branches/S3_0/m4/gtk3.22-client.m4 Thu Feb 9 06:33:32 2017 @@ -7,7 +7,7 @@ [ if test "x$gui_gtk3_22" = "xyes" || test "x$client" = "xall" || test "x$client" = "xauto" ; then - PKG_CHECK_MODULES([GTK3X], [gtk+-3.0 >= 3.20.0], + PKG_CHECK_MODULES([GTK3X], [gtk+-3.0 >= 3.22.0], [ GTK3X_CFLAGS="$GTK3X_CFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_20" GTK3X_CFLAGS="$GTK3X_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_48" _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits