diff options
author | Carlos Soriano <csoriano@gnome.org> | 2015-08-17 00:17:17 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2015-08-17 00:18:49 +0200 |
commit | 271f45a5d304a436f3d369e6b3b984aeb77ab1ba (patch) | |
tree | b50efeb80a3d76f0d5792092b6484f5ca2f71093 | |
parent | 4d8dd8def140ab80c415f533182e439c3f664a1e (diff) | |
download | nautilus-271f45a5d304a436f3d369e6b3b984aeb77ab1ba.tar.gz |
canvas-view: translate coordinates for compute_relative_for
We have to use the relative coordinates wrt the view, not the ones
of the item inside the scrolled widnow itself.
-rw-r--r-- | src/nautilus-canvas-view.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c index d77ca2acc..d1f3ec397 100644 --- a/src/nautilus-canvas-view.c +++ b/src/nautilus-canvas-view.c @@ -1180,11 +1180,19 @@ nautilus_canvas_view_compute_rename_popover_relative_to (NautilusView *view) GArray *bounding_boxes; GdkRectangle *bounding_box; NautilusCanvasContainer *canvas_container; + GtkAdjustment *vadjustment, *hadjustment; + GtkWidget *parent_container; canvas_container = get_canvas_container (NAUTILUS_CANVAS_VIEW (view)); bounding_boxes = nautilus_canvas_container_get_selected_icons_bounding_box (canvas_container); /* We only allow renaming one item at once */ bounding_box = &g_array_index (bounding_boxes, GdkRectangle, 0); + parent_container = nautilus_view_get_content_widget (view); + vadjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (parent_container)); + hadjustment = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (parent_container)); + + bounding_box->x -= gtk_adjustment_get_value (hadjustment); + bounding_box->y -= gtk_adjustment_get_value (vadjustment); g_array_free (bounding_boxes, FALSE); |