summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pluma/pluma-documents-panel.c6
-rw-r--r--pluma/pluma-status-combo-box.c12
-rw-r--r--pluma/pluma-utils.c8
3 files changed, 23 insertions, 3 deletions
diff --git a/pluma/pluma-documents-panel.c b/pluma/pluma-documents-panel.c
index 1ba7a5c0..97308efe 100644
--- a/pluma/pluma-documents-panel.c
+++ b/pluma/pluma-documents-panel.c
@@ -539,8 +539,12 @@ menu_position (GtkMenu *menu,
wy = rect.y;
gdk_window_get_origin (gtk_widget_get_window (w), x, y);
-
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition);
+#else
gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
+#endif
if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL)
{
diff --git a/pluma/pluma-status-combo-box.c b/pluma/pluma-status-combo-box.c
index f138ab2c..aaae9824 100644
--- a/pluma/pluma-status-combo-box.c
+++ b/pluma/pluma-status-combo-box.c
@@ -180,8 +180,12 @@ menu_position_func (GtkMenu *menu,
GtkAllocation allocation;
*push_in = FALSE;
-
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (gtk_widget_get_toplevel (GTK_WIDGET (menu)), NULL, &request);
+#else
gtk_widget_size_request (gtk_widget_get_toplevel (GTK_WIDGET (menu)), &request);
+#endif
/* get the origin... */
gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (combo)), x, y);
@@ -205,8 +209,12 @@ button_press_event (GtkWidget *widget,
GtkRequisition request;
GtkAllocation allocation;
gint max_height;
-
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (combo->priv->menu, NULL, &request);
+#else
gtk_widget_size_request (combo->priv->menu, &request);
+#endif
gtk_widget_get_allocation (GTK_WIDGET (combo), &allocation);
/* do something relative to our own height here, maybe we can do better */
diff --git a/pluma/pluma-utils.c b/pluma/pluma-utils.c
index 657003d6..19405ebf 100644
--- a/pluma/pluma-utils.c
+++ b/pluma/pluma-utils.c
@@ -134,7 +134,11 @@ pluma_utils_menu_position_under_widget (GtkMenu *menu,
widget = GTK_WIDGET (user_data);
widget_get_origin (widget, x, y);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition);
+#else
gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
+#endif
gtk_widget_get_allocation (widget, &allocation);
@@ -189,7 +193,11 @@ pluma_utils_menu_position_under_tree_view (GtkMenu *menu,
if (gtk_widget_get_direction (GTK_WIDGET (tree)) == GTK_TEXT_DIR_RTL)
{
GtkRequisition requisition;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition);
+#else
gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
+#endif
*x += rect.width - requisition.width;
}
}