From 95cc40d8a8ee3d946c66531d2e2a39d7bac5b8ec Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 11 Aug 2023 15:03:42 -0300 Subject: [PATCH] window: Use non-deprecated function gtk_widget_compute_point() is the hot new thing. --- src/gui/gcal-window.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/gui/gcal-window.c b/src/gui/gcal-window.c index 03e24b59..5b09fc72 100644 --- a/src/gui/gcal-window.c +++ b/src/gui/gcal-window.c @@ -563,9 +563,8 @@ show_new_event_widget (GcalView *view, gdouble y, GcalWindow *window) { + graphene_point_t p; GdkRectangle rect; - gdouble out_x; - gdouble out_y; GCAL_ENTRY; @@ -596,15 +595,17 @@ show_new_event_widget (GcalView *view, window->event_creation_data->end_date); /* Position and place the quick add popover */ - gtk_widget_translate_coordinates (window->views[window->active_view], - GTK_WIDGET (window), - x, y, - &out_x, - &out_y); + if (!gtk_widget_compute_point (window->views[window->active_view], + GTK_WIDGET (window), + &GRAPHENE_POINT_INIT (x, y), + &p)) + { + g_assert_not_reached (); + } /* Place popover over the given (x,y) position */ - rect.x = out_x; - rect.y = out_y; + rect.x = p.x; + rect.y = p.y; rect.width = 1; rect.height = 1;