mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-05 08:53:39 +02:00
gdesktopappinfo: Set XDG_ACTIVATION_TOKEN/activation-token startup ID key
See: * https://gitlab.freedesktop.org/xdg/xdg-specs/-/blob/master/desktop-entry/desktop-entry-spec.xml#L1061-1068 * https://wayland.app/protocols/xdg-activation-v1 * https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/xdg-activation/x11-interoperation.rst Fixes: #2709
This commit is contained in:
committed by
Philip Withnall
parent
24e1bfba16
commit
627f2738e0
@@ -2895,7 +2895,10 @@ g_desktop_app_info_launch_uris_with_spawn (GDesktopAppInfo *info,
|
||||
G_APP_INFO (info),
|
||||
launched_files);
|
||||
if (sn_id)
|
||||
envp = g_environ_setenv (envp, "DESKTOP_STARTUP_ID", sn_id, TRUE);
|
||||
{
|
||||
envp = g_environ_setenv (envp, "DESKTOP_STARTUP_ID", sn_id, TRUE);
|
||||
envp = g_environ_setenv (envp, "XDG_ACTIVATION_TOKEN", sn_id, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free_full (launched_files, g_object_unref);
|
||||
@@ -3032,7 +3035,10 @@ g_desktop_app_info_make_platform_data (GDesktopAppInfo *info,
|
||||
|
||||
sn_id = g_app_launch_context_get_startup_notify_id (launch_context, G_APP_INFO (info), launched_files);
|
||||
if (sn_id)
|
||||
g_variant_builder_add (&builder, "{sv}", "desktop-startup-id", g_variant_new_take_string (sn_id));
|
||||
{
|
||||
g_variant_builder_add (&builder, "{sv}", "desktop-startup-id", g_variant_new_string (sn_id));
|
||||
g_variant_builder_add (&builder, "{sv}", "activation-token", g_variant_new_take_string (g_steal_pointer (&sn_id)));
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free_full (launched_files, g_object_unref);
|
||||
|
Reference in New Issue
Block a user