org.gnome.SessionManager
Prev | Part II. Internal D-Bus API | Next

## Name

org.gnome.SessionManager — The Manager

## Methods

    Setenv                      (IN  s  variable,
                                 IN  s  value);
    GetLocale                   (IN  i  category,
                                 OUT s  value);
    InitializationError         (IN  s  message,
                                 IN  b  fatal);
    Initialized                 ();
    RegisterClient              (IN  s  app_id,
                                 IN  s  client_startup_id,
                                 OUT o  client_id);
    UnregisterClient            (IN  o  client_id);
    Inhibit                     (IN  s  app_id,
                                 IN  u  toplevel_xid,
                                 IN  s  reason,
                                 IN  u  flags,
                                 OUT u  inhibit_cookie);
    Uninhibit                   (IN  u  inhibit_cookie);
    IsInhibited                 (IN  u  flags,
                                 OUT b  is_inhibited);
    GetClients                  (OUT ao clients);
    GetInhibitors               (OUT ao inhibitors);
    IsAutostartConditionHandled (IN  s  condition,
                                 OUT b  handled);
    Shutdown                    ();
    Reboot                      ();
    CanShutdown                 (OUT b  is_available);
    SetRebootToFirmwareSetup    (IN  b  enable);
    CanRebootToFirmwareSetup    (OUT b  is_available);
    Logout                      (IN  u  mode);
    IsSessionRunning            (OUT b  running);

## Signals

    ClientAdded      (o id);
    ClientRemoved    (o id);
    InhibitorAdded   (o id);
    InhibitorRemoved (o id);
    SessionRunning   ();
    SessionOver      ();

## Properties

    SessionName       readable   s
    Renderer          readable   s
    SessionIsActive   readable   b
    InhibitedActions  readable   u

## Description

## Method Details

### The Setenv() method

    Setenv (IN  s variable,
            IN  s value);

Adds the variable name to the application launch environment with the specified value. May only be used during the Session Manager initialization phase.

`IN s `variable``:

  The variable name

`IN s `value``:

  The variable value

### The GetLocale() method

    GetLocale (IN  i category,
               OUT s value);

Reads the current state of the specific locale category.

`IN i `category``:

  The locale category

`OUT s `value``:

  The value

### The InitializationError() method

    InitializationError (IN  s message,
                         IN  b fatal);

May be used by applications launched during the Session Manager initialization phase to indicate there was a problem.

`IN s `message``:

  The error message

`IN b `fatal``:

  Whether the error should be treated as fatal

### The Initialized() method

    Initialized ();

Run from systemd to signal that gnome-session-initialized.target has been reached.

### The RegisterClient() method

    RegisterClient (IN  s app_id,
                    IN  s client_startup_id,
                    OUT o client_id);

Register the caller as a Session Management client.

`IN s `app_id``:

  The application identifier

`IN s `client_startup_id``:

  Client startup identifier

`OUT o `client_id``:

  The object path of the newly registered client

### The UnregisterClient() method

    UnregisterClient (IN  o client_id);

Unregister the specified client from Session Management.

`IN o `client_id``:

  The object path of the client

### The Inhibit() method

    Inhibit (IN  s app_id,
             IN  u toplevel_xid,
             IN  s reason,
             IN  u flags,
             OUT u inhibit_cookie);

Applications should invoke this method when they begin an operation that should not be interrupted, such as creating a CD or DVD. The types of actions that may be blocked are specified by the flags parameter. When the application completes the operation it should call #Uninhibit() or disconnect from the session bus.

Applications should not expect that they will always be able to block the action. In most cases, users will be given the option to force the action to take place. If `app_id` is not specified, the user might not be informed of this inhibitor when prompted to force the action.

On Wayland, or other display servers, pass 0 for `toplevel_xid`.

The `flags` parameter must include at least one of the following flags, bitwise or'ed together:

- 1: Inhibit logging out

- 2: Inhibit user switching

- 4: Inhibit suspending the session or computer

- 8: Inhibit the session being marked as idle

- 16: Inhibit auto-mounting removable media for the session

The returned cookie is used to uniquely identify this request. It should be used as an argument to #Uninhibit() in order to remove the request.

`IN s `app_id``:

  The application identifier, optional

`IN u `toplevel_xid``:

  The toplevel X window identifier

`IN s `reason``:

  The reason for the inhibit

`IN u `flags``:

  Flags that specify what should be inhibited

`OUT u `inhibit_cookie``:

  The cookie

### The Uninhibit() method

    Uninhibit (IN  u inhibit_cookie);

Cancel a previous call to #Inhibit(), identified by the cookie.

`IN u `inhibit_cookie``:

  The cookie

### The IsInhibited() method

    IsInhibited (IN  u flags,
                 OUT b is_inhibited);

Determine if operation(s) specified by the flags are currently inhibited. Flags are same as those accepted by the #Inhibit() method.

`IN u `flags``:

  Flags that specify what should be inhibited

`OUT b `is_inhibited``:

  TRUE if any of the operations in `flags` are inhibited

### The GetClients() method

    GetClients (OUT ao clients);

This gets a list of all the clients that are currently known to the session manager. Each client ID is a D-Bus object path to the object that implements the Client interface

`OUT ao `clients``:

  an array of client IDs

### The GetInhibitors() method

    GetInhibitors (OUT ao inhibitors);

This gets a list of all the inhibitors that are currently known to the session manager. Each inhibitor ID is a D-Bus object path to the object that implements the Inhibitor interface

`OUT ao `inhibitors``:

  an array of inhibitor IDs

### The IsAutostartConditionHandled() method

    IsAutostartConditionHandled (IN  s condition,
                                 OUT b handled);

Allows the caller to determine whether the session manager is handling changes to the specified autostart condition.

`IN s `condition``:

  The autostart condition string

`OUT b `handled``:

  True if condition is handled, false otherwise

### The Shutdown() method

    Shutdown ();

Request a shutdown dialog.

### The Reboot() method

    Reboot ();

Request a reboot dialog.

### The CanShutdown() method

    CanShutdown (OUT b is_available);

`OUT b `is_available``:

### The SetRebootToFirmwareSetup() method

    SetRebootToFirmwareSetup (IN  b enable);

Allows the caller to indicate to the system's firmware to boot into setup mode

`IN b `enable``:

  Whether we should reboot into setup

### The CanRebootToFirmwareSetup() method

    CanRebootToFirmwareSetup (OUT b is_available);

Allows the caller to determine whether or not it's okay to show a reboot to firmware option in the UI

`OUT b `is_available``:

  True if boot into setup mode is available to the user, false otherwise

### The Logout() method

    Logout (IN  u mode);

Request a log out dialog.

You may pass the following flags into `mode`, and they can be bitwise or'ed together:

- 0: Normal

- 1: No confirmation interface should be shown.

- 2: Forcefully logout. No confirmation will be shown and any inhibitors will be ignored.

`IN u `mode``:

  The type of logout that is being requested

### The IsSessionRunning() method

    IsSessionRunning (OUT b running);

Allows the caller to determine whether the session manager has entered the Running phase, in case the client missed the SessionRunning signal.

`OUT b `running``:

  True if the session has entered the Running phase, false otherwise

## Signal Details

### The "ClientAdded" signal

    ClientAdded (o id);

Emitted when a client has been added to the session manager.

`o `id``:

  The object path for the added client

### The "ClientRemoved" signal

    ClientRemoved (o id);

Emitted when a client has been removed from the session manager.

`o `id``:

  The object path for the removed client

### The "InhibitorAdded" signal

    InhibitorAdded (o id);

Emitted when an inhibitor has been added to the session manager.

`o `id``:

  The object path for the added inhibitor

### The "InhibitorRemoved" signal

    InhibitorRemoved (o id);

Emitted when an inhibitor has been removed from the session manager.

`o `id``:

  The object path for the removed inhibitor

### The "SessionRunning" signal

    SessionRunning ();

Emitted when the session enters the Running phase.

### The "SessionOver" signal

    SessionOver ();

Emitted when the session is about to end.

## Property Details

### The "SessionName" property

    SessionName  readable   s

The name of the session that has been loaded.

### The "Renderer" property

    Renderer  readable   s

Starting in GNOME 49, this property always returns an empty string. You should instead use the `GPUs` property on the net.hadess.SwitcherooControl service instead.

### Warning

The "Renderer" property is deprecated.

### The "SessionIsActive" property

    SessionIsActive  readable   b

If true, the session is currently in the foreground and available for user input.

### The "InhibitedActions" property

    InhibitedActions  readable   u

A bitmask of flags to indicate which actions are inhibited. See #Inhibit() for a list of possible values.

Prev | Up | Next
Part II. Internal D-Bus API | Home | org.gnome.SessionManager.Client