summaryrefslogtreecommitdiff
path: root/pluma/pluma-documents-panel.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-10-30 00:56:56 +0100
committerStefano Karapetsas <[email protected]>2013-10-30 00:56:56 +0100
commit7f0ccea48196a0da9523db3d566ee8020cd742a1 (patch)
tree4a66f87edcc70ca3949c750148df218c9a41ba28 /pluma/pluma-documents-panel.c
parent5f87f646777bf5b09610bbc6eed8fafd007f34c6 (diff)
downloadpluma-7f0ccea48196a0da9523db3d566ee8020cd742a1.tar.bz2
pluma-7f0ccea48196a0da9523db3d566ee8020cd742a1.tar.xz
pluma: Add GTK3 support
Diffstat (limited to 'pluma/pluma-documents-panel.c')
-rw-r--r--pluma/pluma-documents-panel.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/pluma/pluma-documents-panel.c b/pluma/pluma-documents-panel.c
index 924f7060..ea2739e1 100644
--- a/pluma/pluma-documents-panel.c
+++ b/pluma/pluma-documents-panel.c
@@ -516,11 +516,18 @@ menu_position (GtkMenu *menu,
GtkTreePath *path;
GdkRectangle rect;
gint wx, wy;
+ GtkAllocation allocation;
GtkRequisition requisition;
GtkWidget *w;
w = panel->priv->treeview;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_allocation(w, &allocation);
+#else
+ allocation = w->allocation;
+#endif
+
path = get_current_path (panel);
gtk_tree_view_get_cell_area (GTK_TREE_VIEW (w),
@@ -531,21 +538,25 @@ menu_position (GtkMenu *menu,
wx = rect.x;
wy = rect.y;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_window_get_origin (gtk_widget_get_window (w), x, y);
+#else
gdk_window_get_origin (w->window, x, y);
+#endif
gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL)
{
- *x += w->allocation.x + w->allocation.width - requisition.width - 10;
+ *x += allocation.x + allocation.width - requisition.width - 10;
}
else
{
- *x += w->allocation.x + 10;
+ *x += allocation.x + 10;
}
wy = MAX (*y + 5, *y + wy + 5);
- wy = MIN (wy, *y + w->allocation.height - requisition.height - 5);
+ wy = MIN (wy, *y + allocation.height - requisition.height - 5);
*y = wy;