Xdp.GlobalShortcutsSession

g GObject.Object GObject.Object Xdp.GlobalShortcutsSession Xdp.GlobalShortcutsSession GObject.Object->Xdp.GlobalShortcutsSession

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

bind_shortcuts (shortcuts, parent_window, cancellable, callback, *data)

bind_shortcuts_finish (result)

close ()

configure_shortcuts (parent_window, activation_token, cancellable, callback, *data)

configure_shortcuts_finish (result)

get_session ()

list_shortcuts (cancellable, callback, *data)

list_shortcuts_finish (result)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

activated

Emitted when a GlobalShortcuts shortcut of this session was activated.

deactivated

Emitted when a GlobalShortcuts shortcut of this session was deactivated.

shortcuts-changed

Emitted when a GlobalShortcuts session’s shortcuts have changed.

Fields

Inherited:

GObject.Object (1)

Class Details

class Xdp.GlobalShortcutsSession(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Xdp.GlobalShortcutsSessionClass

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:

Bind shortcuts and list triggers.

bind_shortcuts_finish(result)
Parameters:

result (Gio.AsyncResult) – a [iface`Gio`.AsyncResult]

Raises:

GLib.Error

Returns:

array of assigned shortcuts.

Return type:

[Xdp.GlobalShortcutAssigned]

Finishes the GlobalShortcuts BindShortcuts request.

close()
configure_shortcuts(parent_window, activation_token, cancellable, callback, *data)
Parameters:
  • parent_window (str or None) – parent window identifier

  • activation_token (str or None) – token used to activate the configuration window

  • cancellable (Gio.Cancellable or None) – optional [class`Gio`.Cancellable]

  • callback (Gio.AsyncReadyCallback or None) – callback called when the method call is done

  • data (object or None) – data to pass to callback

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:

GLib.Error

Returns:

True if the call succeeded, False otherwise.

Return type:

bool

Finishes the ConfigureShortcuts method call.

get_session()
Returns:

a [class`Session`] object

Return type:

Xdp.Session

Return the [class`XdpSession`] for this GlobalShortcuts session.

list_shortcuts(cancellable, callback, *data)
Parameters:

List currently registered shortcuts and triggers.

list_shortcuts_finish(result)
Parameters:

result (Gio.AsyncResult) – a [iface`Gio`.AsyncResult]

Raises:

GLib.Error

Returns:

array of assigned shortcuts.

Return type:

[Xdp.GlobalShortcutAssigned]

Finishes the list-shortcuts request, and returns a GLib.PtrArray with the shortcuts.

Signal Details

Xdp.GlobalShortcutsSession.signals.activated(global_shortcuts_session, shortcut_id, timestamp, options)
Signal Name:

activated

Flags:

RUN_CLEANUP, NO_RECURSE, NO_HOOKS

Parameters:
  • global_shortcuts_session (Xdp.GlobalShortcutsSession) – The object which received the signal

  • shortcut_id (str) – shortcut ID

  • timestamp (int) – time of activation with millisecond granularity

  • options (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:

RUN_CLEANUP, NO_RECURSE, NO_HOOKS

Parameters:
  • global_shortcuts_session (Xdp.GlobalShortcutsSession) – The object which received the signal

  • shortcut_id (str) – shortcut ID

  • timestamp (int) – time of deactivation with millisecond granularity

  • options (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:

RUN_CLEANUP, NO_RECURSE, NO_HOOKS

Parameters:

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.