AppLaunchContext#
Superclasses: 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#
- class AppLaunchContext
- classmethod new() AppLaunchContext #
Creates a new application launch context. This is not normally used, instead you instantiate a subclass of this, such as
`GdkAppLaunchContext
<https://docs.gtk.org/gdk4/class.AppLaunchContext.html>`_.
Methods#
- class AppLaunchContext
- get_display(info: AppInfo, files: list[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 theDISPLAY
environment variable.- Parameters:
info – the app info
files – a list of
File
objects
- 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 aNULL
-terminated array of strings, where each string has the formKEY=VALUE
.Added in version 2.32.
- get_startup_notify_id(info: AppInfo | None = None, files: list[File] | None = None) str | None #
Initiates startup notification for the application and returns the
XDG_ACTIVATION_TOKEN
orDESKTOP_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
andfiles
can beNULL
. If that’s not supported by the backend, the returned token will beNULL
.- Parameters:
info – the app info
files – a list of
File
objects
- 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
get_startup_notify_id
.- Parameters:
startup_notify_id – the startup notification id that was returned by
get_startup_notify_id
.
Signals#
- class AppLaunchContext.signals
- launch_failed(startup_notify_id: str) None #
The type of the None singleton.
Added in version 2.36.
- Parameters:
startup_notify_id – the startup notification id for the failed launch
Virtual Methods#
- class AppLaunchContext
- do_get_display(info: AppInfo, files: list[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 theDISPLAY
environment variable.- Parameters:
info – the app info
files – a list of
File
objects
- do_get_startup_notify_id(info: AppInfo | None = None, files: list[File] | None = None) str | None #
Initiates startup notification for the application and returns the
XDG_ACTIVATION_TOKEN
orDESKTOP_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
andfiles
can beNULL
. If that’s not supported by the backend, the returned token will beNULL
.- Parameters:
info – the app info
files – a list of
File
objects
- 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
get_startup_notify_id
.- Parameters:
startup_notify_id – the startup notification id that was returned by
get_startup_notify_id
.