Top | ![]() |
![]() |
![]() |
![]() |
gboolean | gtk_session_lock_is_supported () |
GtkSessionLockInstance * | gtk_session_lock_instance_new () |
gboolean | gtk_session_lock_instance_lock () |
void | gtk_session_lock_instance_unlock () |
gboolean | gtk_session_lock_instance_is_locked () |
void | gtk_session_lock_instance_assign_window_to_monitor () |
Session Lock is a Wayland protocol for lock screens. Use it to lock the compositor and display the lock screen. This library and the underlying Wayland protocol do not handle authentication.
Popups (such as menus and tooltips) do not currently display while the screen is locked. Please use alternatives, such as GtkPopover (which is backed by a subsurface instead of a popup).
If you link against libwayland you must link this library before libwayland. See linking.md for details.
gboolean
gtk_session_lock_is_supported ();
May block for a Wayland roundtrip the first time it's called.
gboolean
gtk_session_lock_instance_lock (GtkSessionLockInstance *self
);
Lock the screen. This should be called before assigning any windows to monitors. If this function fails the ::failed signal is emitted, if it succeeds the ::locked signal is emitted. The ::failed signal may be emitted before the function returns (for example, if another GtkSessionLockInstance holds a lock) or later (if another process holds a lock). The only case where neither signal is triggered is if the instance is already locked.
void
gtk_session_lock_instance_unlock (GtkSessionLockInstance *self
);
If the screen is locked by this instance unlocks it and fires ::unlocked. Otherwise has no effect
gboolean
gtk_session_lock_instance_is_locked (GtkSessionLockInstance *self
);
Returns if this instance currently holds a lock.
void gtk_session_lock_instance_assign_window_to_monitor (GtkSessionLockInstance *self
,GtkWindow *window
,GdkMonitor *monitor
);
This should be called with a different window once for each monitor immediately after calling
gtk_session_lock_lock()
. Hiding a window that is active on a monitor or not letting a window be resized by the
library may result in a Wayland protocol error.
“failed”
signalvoid user_function (GtkSessionLockInstance *sessionlockinstance, gpointer user_data)
The ::failed signal is fired when the lock could not be acquired.
Flags: Run First
“locked”
signalvoid user_function (GtkSessionLockInstance *sessionlockinstance, gpointer user_data)
The ::locked signal is fired when the screen is successfully locked.
Flags: Run First
“unlocked”
signalvoid user_function (GtkSessionLockInstance *sessionlockinstance, gpointer user_data)
The ::unlocked signal is fired when the session is unlocked, which may have been caused by a call to
gtk_session_lock_instance_unlock()
or by the compositor.
Flags: Run First