## Background Background — request background permissions |

## Functions

void | xdp_portal_request_background ()
gboolean | xdp_portal_request_background_finish ()

## Types and Values

enum | XdpBackgroundFlags

## Description

These functions let the application request background permissions such as enabling autostart.

The underlying portal is org.freedesktop.portal.Background.

## Functions

### xdp_portal_request_background ()

    void
    xdp_portal_request_background (XdpPortal *portal,
                                   XdpParent *parent,
                                   char *reason,
                                   GPtrArray *commandline,
                                   XdpBackgroundFlags flags,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Requests background permissions.

When the request is done, `callback` will be called. You can then call `xdp_portal_request_background_finish()` to get the results.

#### Parameters

portal | a XdpPortal |
parent | parent window information. | [nullable]
commandline | command line to autostart. | [element-type utf8][transfer container]
reason | reason to present to user for request. | [nullable]
flags | options for this call |
cancellable | optional GCancellable. | [nullable]
callback | a callback to call when the request is done. | [scope async]
user_data | data to pass to `callback` . | [closure]

### xdp_portal_request_background_finish ()

    gboolean
    xdp_portal_request_background_finish (XdpPortal *portal,
                                          GAsyncResult *result,
                                          GError **error);

Finishes the request, and returns `TRUE` if successful.

#### Parameters

portal | a XdpPortal |
result | a GAsyncResult |
error | return location for an error |

#### Returns

`TRUE` if successful.

## Types and Values

### enum XdpBackgroundFlags

Options to use when requesting background.

#### Members

XDP_BACKGROUND_FLAG_NONE | No options |
XDP_BACKGROUND_FLAG_AUTOSTART | Request autostart as well |
XDP_BACKGROUND_FLAG_ACTIVATABLE | Whether the application is D-Bus-activatable |