## XfceScreensaver

XfceScreensaver — screensaver related shared functions

## Functions

XfceScreensaver * | xfce_screensaver_new ()
void | xfce_screensaver_inhibit ()
gboolean | xfce_screensaver_lock ()

## Properties

char * | heartbeat-command | Read / Write / Construct
char * | lock-command | Read / Write / Construct
gboolean | lock-on-sleep | Read / Write / Construct

## Types and Values

| XfceScreensaver

## Object Hierarchy

        GObject
        ╰── XfceScreensaver

## Includes

    #include <libxfce4ui/libxfce4ui.h>

## Description

## Functions

### xfce_screensaver_new ()

    XfceScreensaver *
    xfce_screensaver_new (void);

Creates a new XfceScreensaver object or increases the reference count of the current object.

#### Returns

An XfceScreensaver object, to be released with `g_object_unref()` when no longer used.

[transfer full]

Since: 4.18.2

### xfce_screensaver_inhibit ()

    void
    xfce_screensaver_inhibit (XfceScreensaver *saver,
                              gboolean inhibit);

Calling this function with `inhibit` as `TRUE` will prevent the user's screensaver from activating. This is useful when the user is watching a movie or giving a presentation.

Calling this function with `inhibit` as `FALSE` will remove any current screensaver inhibit the XfceScreensaver object has.

#### Parameters

saver | the XfceScreensaver object |
inhibit | whether to inhibit the screensaver from activating |

Since: 4.18.2

### xfce_screensaver_lock ()

    gboolean
    xfce_screensaver_lock (XfceScreensaver *saver);

Attempts to lock the screen, either with one of the screensaver D-Bus proxies, the Xfconf lock command, or one of the fallback scripts such as xdg-screensaver.

#### Parameters

saver | the XfceScreensaver object |

#### Returns

`TRUE` if the lock attempt returns success, `FALSE` otherwise.

Since: 4.18.2

## Types and Values

### XfceScreensaver

    typedef struct _XfceScreensaver XfceScreensaver;

## Property Details

### The `“heartbeat-command”` property

      “heartbeat-command”        char *

Inhibit the screensaver from activating, e.g. xscreensaver-command --deactivate.

Owner: XfceScreensaver

Flags: Read / Write / Construct

Default value: NULL

### The `“lock-command”` property

      “lock-command”             char *

Lock the desktop, e.g. xscreensaver-command --lock.

Owner: XfceScreensaver

Flags: Read / Write / Construct

Default value: NULL

### The `“lock-on-sleep”` property

      “lock-on-sleep”            gboolean

Whether to lock before suspend/hibernate.

Owner: XfceScreensaver

Flags: Read / Write / Construct

Default value: FALSE