[geany/geany-plugins] e619d8: Replace deprecated GTK2 API to fix compilation against GTK3
Enrico Tröger
git-noreply at xxxxx
Sun Jul 12 13:08:58 UTC 2015
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger at uvena.de>
Committer: Enrico Tröger <enrico.troeger at uvena.de>
Date: Sun, 12 Jul 2015 13:08:58 UTC
Commit: e619d8ac0231616d445d789ab608e5a1c18b95e7
https://github.com/geany/geany-plugins/commit/e619d8ac0231616d445d789ab608e5a1c18b95e7
Log Message:
-----------
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).
More information about the Plugins-Commits
mailing list