sessionlock

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package sessionlock was automatically generated by github.com/bnema/puregotk DO NOT EDIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether the shared library was loaded successfully.

func InstanceGLibType

func InstanceGLibType() types.GType

func IsSupported

func IsSupported() bool

May block for a Wayland roundtrip the first time it's called.

Types

type Instance

type Instance struct {
	gobject.Object
}

An instance of the object used to control locking the screen. Multiple instances can exist at once, but only one can be locked at a time.

func InstanceNewFromInternalPtr

func InstanceNewFromInternalPtr(ptr uintptr) *Instance

func NewInstance

func NewInstance() *Instance

func (*Instance) AssignWindowToMonitor

func (x *Instance) AssignWindowToMonitor(WindowVar *gtk.Window, MonitorVar *gdk.Monitor)

This must be called with a different unrealized 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 is not allowed (may result in a Wayland protocol error). The window will be unmapped and gtk_window_destroy() called on it when the current lock ends.

func (*Instance) ConnectFailed

func (x *Instance) ConnectFailed(cb *func(Instance)) uint

The ::failed signal is fired when the lock could not be acquired.

func (*Instance) ConnectLocked

func (x *Instance) ConnectLocked(cb *func(Instance)) uint

The ::locked signal is fired when the screen is successfully locked.

func (*Instance) ConnectMonitor

func (x *Instance) ConnectMonitor(cb *func(Instance, uintptr)) uint

The ::monitor signal is fired once for each monitor that exists when a lock is started, and then whenever a new monitor is detected during the lock. You generally want to call gtk_session_lock_instance_assign_window_to_monitor() once in the handler for this signal with a newly created window and the given monitor.

This API does not directly tell you when a monitor is removed (GTK APIs can be used for that), however the window you send to gtk_session_lock_instance_assign_window_to_monitor() will be automatically unmapped and dereferenced when its monitor is removed or the screen is unlocked.

func (*Instance) ConnectUnlocked

func (x *Instance) ConnectUnlocked(cb *func(Instance)) uint

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.

func (*Instance) GoPointer

func (c *Instance) GoPointer() uintptr

func (*Instance) IsLocked

func (x *Instance) IsLocked() bool

Returns if this instance currently holds a lock.

func (*Instance) Lock

func (x *Instance) Lock() bool

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.

func (*Instance) SetGoPointer

func (c *Instance) SetGoPointer(ptr uintptr)

func (*Instance) Unlock

func (x *Instance) Unlock()

If the screen is locked by this instance unlocks it and fires ::unlocked. Otherwise has no effect

type InstanceClass

type InstanceClass struct {
	ParentClass gobject.ObjectClass
	// contains filtered or unexported fields
}

func (*InstanceClass) GoPointer

func (x *InstanceClass) GoPointer() uintptr

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL