Xdp.GlobalShortcutsSession¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Emitted when a GlobalShortcuts shortcut of this session was activated. |
|
Emitted when a GlobalShortcuts shortcut of this session was deactivated. |
|
Emitted when a GlobalShortcuts session’s shortcuts have changed. |
Fields¶
- Inherited:
Class Details¶
- class Xdp.GlobalShortcutsSession(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A representation of a long-lived global shortcuts portal interaction.
The [class`GlobalShortcutsSession`] object is used to represent portal interactions with the global shortcuts desktop portal that extend over multiple portal calls. Usually a caller creates a global shortcuts session, binds shortcuts, and then starts listening to activations.
To list current assignments after [method`GlobalShortcutsSession`.bind_shortcuts] returns, call [method`GlobalShortcutsSession`.list_shortcuts].
The [class`GlobalShortcutsSession`] wraps a [class`Session`] object.
- bind_shortcuts(shortcuts, parent_window, cancellable, callback, *data)¶
- Parameters:
shortcuts ([
Xdp.GlobalShortcut]) – array of shortcuts to bindparent_window (
strorNone) – parent window identifier, orNonecancellable (
Gio.CancellableorNone) – optional [class`Gio`.Cancellable]callback (
Gio.AsyncReadyCallbackorNone) – a callback to call when the request is done
Bind shortcuts and list triggers.
- bind_shortcuts_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – a [iface`Gio`.AsyncResult]- Raises:
- Returns:
array of assigned shortcuts.
- Return type:
Finishes the GlobalShortcuts BindShortcuts request.
- close()¶
- configure_shortcuts(parent_window, activation_token, cancellable, callback, *data)¶
- Parameters:
activation_token (
strorNone) – token used to activate the configuration windowcancellable (
Gio.CancellableorNone) – optional [class`Gio`.Cancellable]callback (
Gio.AsyncReadyCallbackorNone) – callback called when the method call is done
Requests that the portal show configuration UI for all shortcuts of this session.
- configure_shortcuts_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – a [iface`Gio`.AsyncResult]- Raises:
- Returns:
- Return type:
Finishes the ConfigureShortcuts method call.
- get_session()¶
- Returns:
a [class`Session`] object
- Return type:
Return the [class`XdpSession`] for this GlobalShortcuts session.
- list_shortcuts(cancellable, callback, *data)¶
- Parameters:
cancellable (
Gio.CancellableorNone)callback (
Gio.AsyncReadyCallbackorNone)
List currently registered shortcuts and triggers.
- list_shortcuts_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – a [iface`Gio`.AsyncResult]- Raises:
- Returns:
array of assigned shortcuts.
- Return type:
Finishes the list-shortcuts request, and returns a
GLib.PtrArraywith the shortcuts.
Signal Details¶
- Xdp.GlobalShortcutsSession.signals.activated(global_shortcuts_session, shortcut_id, timestamp, options)¶
- Signal Name:
activated- Flags:
- Parameters:
global_shortcuts_session (
Xdp.GlobalShortcutsSession) – The object which received the signalshortcut_id (
str) – shortcut IDtimestamp (
int) – time of activation with millisecond granularityoptions (
GLib.Variant) – signal options
Emitted when a GlobalShortcuts shortcut of this session was activated.
- Xdp.GlobalShortcutsSession.signals.deactivated(global_shortcuts_session, shortcut_id, timestamp, options)¶
- Signal Name:
deactivated- Flags:
- Parameters:
global_shortcuts_session (
Xdp.GlobalShortcutsSession) – The object which received the signalshortcut_id (
str) – shortcut IDtimestamp (
int) – time of deactivation with millisecond granularityoptions (
GLib.Variant) – signal options
Emitted when a GlobalShortcuts shortcut of this session was deactivated.
- Xdp.GlobalShortcutsSession.signals.shortcuts_changed(global_shortcuts_session, shortcuts)¶
- Signal Name:
shortcuts-changed- Flags:
- Parameters:
global_shortcuts_session (
Xdp.GlobalShortcutsSession) – The object which received the signalshortcuts ([
Xdp.GlobalShortcutAssigned]) – updated shortcuts
Emitted when a GlobalShortcuts session’s shortcuts have changed. This signal is emitted after new shortcuts have already become effective.
The shortcuts array is only valid for the duration of the signal emission.