:right-sidebar: True AppLaunchContext =================================================================== .. currentmodule:: gi.repository.Gio .. class:: AppLaunchContext(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Integrating the launch with the launching application. This is used to handle for instance startup notification and launching the new application on the same screen as the launching window. Constructors ------------ .. rst-class:: interim-class .. class:: AppLaunchContext :no-index: .. classmethod:: new() -> ~gi.repository.Gio.AppLaunchContext Creates a new application launch context. This is not normally used, instead you instantiate a subclass of this, such as ```GdkAppLaunchContext`` `__\. Methods ------- .. rst-class:: interim-class .. class:: AppLaunchContext :no-index: .. method:: do_get_display(self, info: ~gi.repository.Gio.AppInfo, files: list[~gi.repository.Gio.File]) -> str | None :param info: :param files: .. method:: do_get_startup_notify_id(self, info: ~gi.repository.Gio.AppInfo | None = None, files: list[~gi.repository.Gio.File] | None = None) -> str | None :param info: :param files: .. method:: do_launch_failed(self, startup_notify_id: str) -> None :param startup_notify_id: .. method:: do_launch_started(self, info: ~gi.repository.Gio.AppInfo, platform_data: ~gi.repository.GLib.Variant) -> None :param info: :param platform_data: .. method:: do_launched(self, info: ~gi.repository.Gio.AppInfo, platform_data: ~gi.repository.GLib.Variant) -> None :param info: :param platform_data: .. method:: get_display(info: ~gi.repository.Gio.AppInfo, files: list[~gi.repository.Gio.File]) -> str | None Gets the display string for the ``context``\. This is used to ensure new applications are started on the same display as the launching application, by setting the ``DISPLAY`` environment variable. :param info: the app info :param files: a list of :obj:`~gi.repository.Gio.File` objects .. method:: get_environment() -> list[str] Gets the complete environment variable list to be passed to the child process when ``context`` is used to launch an application. This is a ``NULL``\-terminated array of strings, where each string has the form ``KEY=VALUE``\. .. versionadded:: 2.32 .. method:: get_startup_notify_id(info: ~gi.repository.Gio.AppInfo | None = None, files: list[~gi.repository.Gio.File] | None = None) -> str | None Initiates startup notification for the application and returns the ``XDG_ACTIVATION_TOKEN`` or ``DESKTOP_STARTUP_ID`` for the launched operation, if supported. The returned token may be referred to equivalently as an ‘activation token’ (using Wayland terminology) or a ‘startup sequence ID’ (using X11 terminology). The two `are interoperable `__\. Activation tokens are defined in the `XDG Activation Protocol `__\, and startup notification IDs are defined in the `freedesktop.org Startup Notification Protocol `__\. Support for the XDG Activation Protocol was added in GLib 2.76. Since GLib 2.82 ``info`` and ``files`` can be ``NULL``\. If that’s not supported by the backend, the returned token will be ``NULL``\. :param info: the app info :param files: a list of :obj:`~gi.repository.Gio.File` objects .. method:: launch_failed(startup_notify_id: str) -> None Called when an application has failed to launch, so that it can cancel the application startup notification started in :obj:`~gi.repository.Gio.AppLaunchContext.get_startup_notify_id`\. :param startup_notify_id: the startup notification id that was returned by :obj:`~gi.repository.Gio.AppLaunchContext.get_startup_notify_id`\. .. method:: setenv(variable: str, value: str) -> None Arranges for ``variable`` to be set to ``value`` in the child’s environment when ``context`` is used to launch an application. .. versionadded:: 2.32 :param variable: the environment variable to set :param value: the value for to set the variable to. .. method:: unsetenv(variable: str) -> None Arranges for ``variable`` to be unset in the child’s environment when ``context`` is used to launch an application. .. versionadded:: 2.32 :param variable: the environment variable to remove Signals ------- .. rst-class:: interim-class .. class:: AppLaunchContext.signals :no-index: .. method:: launch_failed(startup_notify_id: str) -> None The type of the None singleton. .. versionadded:: 2.36 :param startup_notify_id: the startup notification id for the failed launch .. method:: launch_started(info: ~gi.repository.Gio.AppInfo, platform_data: ~gi.repository.GLib.Variant | None = None) -> None The type of the None singleton. .. versionadded:: 2.72 :param info: the :obj:`~gi.repository.Gio.AppInfo` that is about to be launched :param platform_data: additional platform-specific data for this launch .. method:: launched(info: ~gi.repository.Gio.AppInfo, platform_data: ~gi.repository.GLib.Variant) -> None The type of the None singleton. .. versionadded:: 2.36 :param info: the :obj:`~gi.repository.Gio.AppInfo` that was just launched :param platform_data: additional platform-specific data for this launch Virtual Methods --------------- .. rst-class:: interim-class .. class:: AppLaunchContext :no-index: .. method:: do_get_display(info: ~gi.repository.Gio.AppInfo, files: list[~gi.repository.Gio.File]) -> str | None Gets the display string for the ``context``\. This is used to ensure new applications are started on the same display as the launching application, by setting the ``DISPLAY`` environment variable. :param info: the app info :param files: a list of :obj:`~gi.repository.Gio.File` objects .. method:: do_get_startup_notify_id(info: ~gi.repository.Gio.AppInfo | None = None, files: list[~gi.repository.Gio.File] | None = None) -> str | None Initiates startup notification for the application and returns the ``XDG_ACTIVATION_TOKEN`` or ``DESKTOP_STARTUP_ID`` for the launched operation, if supported. The returned token may be referred to equivalently as an ‘activation token’ (using Wayland terminology) or a ‘startup sequence ID’ (using X11 terminology). The two `are interoperable `__\. Activation tokens are defined in the `XDG Activation Protocol `__\, and startup notification IDs are defined in the `freedesktop.org Startup Notification Protocol `__\. Support for the XDG Activation Protocol was added in GLib 2.76. Since GLib 2.82 ``info`` and ``files`` can be ``NULL``\. If that’s not supported by the backend, the returned token will be ``NULL``\. :param info: the app info :param files: a list of :obj:`~gi.repository.Gio.File` objects .. method:: do_launch_failed(startup_notify_id: str) -> None Called when an application has failed to launch, so that it can cancel the application startup notification started in :obj:`~gi.repository.Gio.AppLaunchContext.get_startup_notify_id`\. :param startup_notify_id: the startup notification id that was returned by :obj:`~gi.repository.Gio.AppLaunchContext.get_startup_notify_id`\. .. method:: do_launch_started(info: ~gi.repository.Gio.AppInfo, platform_data: ~gi.repository.GLib.Variant) -> None The type of the None singleton. :param info: :param platform_data: .. method:: do_launched(info: ~gi.repository.Gio.AppInfo, platform_data: ~gi.repository.GLib.Variant) -> None The type of the None singleton. :param info: :param platform_data: Fields ------ .. rst-class:: interim-class .. class:: AppLaunchContext :no-index: .. attribute:: parent_instance .. attribute:: priv