summaryrefslogtreecommitdiff
path: root/shell/ev-utils.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-22 23:26:38 +0100
committerStefano Karapetsas <[email protected]>2014-01-22 23:26:38 +0100
commita45172bcbc96d1b519a620aa07aa080c26617044 (patch)
treeee6217e8a4a49e4544a9bee2c7f4ffff0ce2c59f /shell/ev-utils.c
parent28bc8921c748c954027007ec9dfa1e9970c0ad08 (diff)
downloadatril-a45172bcbc96d1b519a620aa07aa080c26617044.tar.bz2
atril-a45172bcbc96d1b519a620aa07aa080c26617044.tar.xz
Use gtk_widget_get_preferred_size with GTK3
Diffstat (limited to 'shell/ev-utils.c')
-rw-r--r--shell/ev-utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/shell/ev-utils.c b/shell/ev-utils.c
index 83cfcdbc..1363cace 100644
--- a/shell/ev-utils.c
+++ b/shell/ev-utils.c
@@ -225,7 +225,11 @@ ev_gui_sanitise_popup_position (GtkMenu *menu,
g_return_if_fail (widget != NULL);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
+#else
gtk_widget_size_request (GTK_WIDGET (menu), &req);
+#endif
monitor_num = gdk_screen_get_monitor_at_point (screen, *x, *y);
gtk_menu_set_monitor (menu, monitor_num);
@@ -251,7 +255,11 @@ ev_gui_menu_position_tree_selection (GtkMenu *menu,
GtkAllocation allocation;
GdkRectangle visible;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
+#else
gtk_widget_size_request (GTK_WIDGET (menu), &req);
+#endif
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
gtk_widget_get_allocation (widget, &allocation);