summaryrefslogtreecommitdiff
path: root/gtk/gtktextview.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-03-25 09:20:47 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-03-25 10:14:35 -0400
commitb23ac5c8da31f0312a10ffb88117a46780979c1b (patch)
treef7ebf7f4a8a69da332df218a2a1ffea733e5196d /gtk/gtktextview.c
parent81e61b9abfe39444b1a2ea7ea95cdc607974d711 (diff)
downloadgtk+-b23ac5c8da31f0312a10ffb88117a46780979c1b.tar.gz
Deprecate gtk_widget_translate_coordinates
Update all (non-deprecated) callers to use gtk_widget_compute_point instead. Fixes: #5697
Diffstat (limited to 'gtk/gtktextview.c')
-rw-r--r--gtk/gtktextview.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 4ff018bd61..22e3104276 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -9088,18 +9088,20 @@ gtk_text_view_do_popup (GtkTextView *text_view,
GdkSurface *surface;
double px, py;
double nx, ny;
+ graphene_point_t p;
native = gtk_widget_get_native (GTK_WIDGET (text_view));
surface = gtk_native_get_surface (native);
gdk_surface_get_device_position (surface, device, &px, &py, NULL);
gtk_native_get_surface_transform (native, &nx, &ny);
- gtk_widget_translate_coordinates (GTK_WIDGET (gtk_widget_get_native (GTK_WIDGET (text_view))),
- GTK_WIDGET (text_view),
- px - nx, py - ny,
- &px, &py);
- rect.x = px;
- rect.y = py;
+ if (!gtk_widget_compute_point (GTK_WIDGET (gtk_widget_get_native (GTK_WIDGET (text_view))),
+ GTK_WIDGET (text_view),
+ &GRAPHENE_POINT_INIT (px - nx, py - ny),
+ &p))
+ graphene_point_init (&p, px - nx, px - nx);
+ rect.x = p.x;
+ rect.y = p.y;
}
gtk_popover_set_pointing_to (GTK_POPOVER (priv->popup_menu), &rect);