Branch: refs/heads/master Author: Frank Lanitz frank@frank.uvena.de Committer: Frank Lanitz frank@frank.uvena.de Date: Sat, 25 Jul 2015 10:05:35 UTC Commit: 4b01b16c4ab750648262252868ab678b3f354885 https://github.com/geany/geany-plugins/commit/4b01b16c4ab750648262252868ab67...
Log Message: ----------- Merge pull request #271 from eht16/addons_gtk3_fix
Replace deprecated GTK2 API to fix compilation against GTK3
Modified Paths: -------------- addons/src/ao_doclist.c build/addons.m4
Modified: addons/src/ao_doclist.c 17 lines changed, 12 insertions(+), 5 deletions(-) =================================================================== @@ -123,18 +123,25 @@ static void ao_popup_position_menu(GtkMenu *menu, gint *x, gint *y, gboolean *pu gint wx, wy; GtkRequisition widget_req; GtkWidget *widget = data; + GdkWindow *window = gtk_widget_get_window(widget); gint widget_height;
/* Retrieve size and position of both widget and menu */ - if (GTK_WIDGET_NO_WINDOW(widget)) + if (! gtk_widget_get_has_window(widget)) { - gdk_window_get_position(widget->window, &wx, &wy); - wx += widget->allocation.x; - wy += widget->allocation.y; + GtkAllocation allocation; + gdk_window_get_position(window, &wx, &wy); + gtk_widget_get_allocation(widget, &allocation); + wx += allocation.x; + wy += allocation.y; } else - gdk_window_get_origin(widget->window, &wx, &wy); + gdk_window_get_origin(window, &wx, &wy); +#if GTK_CHECK_VERSION(3, 0, 0) + gtk_widget_get_preferred_size(widget, &widget_req, NULL); +#else gtk_widget_size_request(widget, &widget_req); +#endif widget_height = widget_req.height; /* Better than allocation.height */
/* Calculate menu position */
Modified: build/addons.m4 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_ADDONS], [ GP_ARG_DISABLE([Addons], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([Addons]) GP_COMMIT_PLUGIN_STATUS([Addons]) AC_CONFIG_FILES([ addons/Makefile
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org