From 286c6ab03e07041d45921c5fa9cf24a2c369155b Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Tue, 23 Jul 2024 11:52:09 +0200 Subject: [PATCH] gtkopenuriportal: Call g_app_launch_context_get_startup_notify_id() directly Since GLib 2.82 `g_app_launch_context_get_startup_notify_id ()` allows `NULL for `info` and `files`. --- gtk/gtkopenuriportal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gtk/gtkopenuriportal.c b/gtk/gtkopenuriportal.c index 1618ba3a87..2b01dcaf03 100644 --- a/gtk/gtkopenuriportal.c +++ b/gtk/gtkopenuriportal.c @@ -443,14 +443,14 @@ window_handle_exported (GtkWindow *window, else display = gdk_display_get_default (); - /* FIXME - * Call the vfunc directly since g_app_launch_context_get_startup_notify_id - * has NULL checks. - * - * We should have a more direct way to do this. - */ context = G_APP_LAUNCH_CONTEXT (gdk_display_get_app_launch_context (display)); + +#if GLIB_CHECK_VERSION (2, 82, 0) + activation_token = g_app_launch_get_startup_notify_id (context, NULL, NULL); +#else activation_token = G_APP_LAUNCH_CONTEXT_GET_CLASS (context)->get_startup_notify_id (context, NULL, NULL); +#endif + g_object_unref (context); open_uri (data, handle, activation_token, open_uri_done);