Gtk.Application.inhibit

### Method

# Gtk Applicationinhibit

#### Declaration [src]

    guint
    gtk_application_inhibit (
      GtkApplication* application,
      GtkWindow* window,
      GtkApplicationInhibitFlags flags,
      const char* reason
    )

#### Description [src]

Inform the session manager that certain types of actions should be inhibited.

This is not guaranteed to work on all platforms and for all types of actions.

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 `gtk_application_uninhibit()` to remove the inhibitor. Note that an application can have multiple inhibitors, and all of them must be individually removed. Inhibitors are also cleared when the application exits.

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.

The `reason` message should be short and to the point.

If `window` is given, the session manager may point the user to this window to find out more about why the action is inhibited.

#### Parameters

`window` | `GtkWindow`
| A `GtkWindow`
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`flags` | `GtkApplicationInhibitFlags`
| What types of actions should be inhibited.
`reason` | `const char*`
| A short, human-readable string that explains why these operations are inhibited.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.

#### Return value

Returns: | `guint`
| A non-zero cookie that is used to uniquely identify this request. It should be used as an argument to `gtk_application_uninhibit()` in order to remove the request. If the platform does not support inhibiting or the request failed for some reason, 0 is returned.