package module
Version: v0.0.0-...-7ead72a Latest Latest

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

Go to latest
Published: Jan 25, 2021 License: LGPL-2.1 Imports: 8 Imported by: 0



Gtk3 Layer Shell bindings for Go and Gotk3.




This section is empty.


This section is empty.


func AutoExclusiveZoneEnable

func AutoExclusiveZoneEnable(window *gtk.Window)

AutoExclusiveZoneEnable when auto exclusive zone is enabled, exclusive zone is automatically set to the size of the window + relevant margin. To disable auto exclusive zone, just set the exclusive zone to 0 or any other fixed value.

NOTE: you can control the auto exclusive zone by changing the margin on the non-anchored edge. This behavior is specific to gtk-layer-shell and not part of the underlying protocol

func AutoExclusiveZoneIsEnabled

func AutoExclusiveZoneIsEnabled(window *gtk.Window) bool

func GetAnchor

func GetAnchor(window *gtk.Window, edge Edge) bool

func GetExclusiveZone

func GetExclusiveZone(window *gtk.Window) int

func GetKeyboardInteractivity

func GetKeyboardInteractivity(window *gtk.Window) bool

func GetMajorVersion

func GetMajorVersion() uint

func GetMargin

func GetMargin(window *gtk.Window, edge Edge) int

func GetMicroVersion

func GetMicroVersion() uint

func GetMinorVersion

func GetMinorVersion() uint

func GetMonitor

func GetMonitor(window *gtk.Window) *gdk.Monitor

GetMonitor nOTE: To get which monitor the surface is actually on, use C.gdk_display_get_monitor_at_window().

func GetNamespace

func GetNamespace(window *gtk.Window) string

GetNamespace nOTE: this function does not return ownership of the string. Do not free the returned string. Future calls into the library may invalidate the returned string.

func GetZwlrLayerSurfaceV1

func GetZwlrLayerSurfaceV1(window *gtk.Window) unsafe.Pointer

func InitForWindow

func InitForWindow(window *gtk.Window)

InitForWindow set the window up to be a layer surface once it is mapped. this must be called before the window is realized.

func IsLayerWindow

func IsLayerWindow(window *gtk.Window) bool

func IsSupported

func IsSupported() bool

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

func SetAnchor

func SetAnchor(window *gtk.Window, edge Edge, anchorToEdge bool)

SetAnchor set whether window should be anchored to edge. - If two perpendicular edges are anchored, the surface with be anchored to that corner - If two opposite edges are anchored, the window will be stretched across the screen in that direction

Default is false for each LayerShellEdge

func SetExclusiveZone

func SetExclusiveZone(window *gtk.Window, exclusiveZone int)

SetExclusiveZone has no effect unless the surface is anchored to an edge. Requests that the compositor does not place other surfaces within the given exclusive zone of the anchored edge. For example, a panel can request to not be covered by maximized windows. See wlr-layer-shell-unstable-v1.xml for details.

Default is 0

func SetKeyboardInteractivity

func SetKeyboardInteractivity(window *gtk.Window, interacitvity bool)

SetKeyboardInteractivity whether the window should receive keyboard events from the compositor.

Default is false

func SetLayer

func SetLayer(window *gtk.Window, layer Layer)

SetLayer set the "layer" on which the surface appears (controls if it is over top of or below other surfaces). The layer may be changed on-the-fly in the current version of the layer shell protocol, but on compositors that only support an older version the window is remapped so the change can take effect.


func SetMargin

func SetMargin(window *gtk.Window, edge Edge, marginSize int)

SetMargin set the margin for a specific edge of a window. Effects both surface's distance from the edge and its exclusive zone size (if auto exclusive zone enabled).

Default is 0 for each LayerShellEdge

func SetMonitor

func SetMonitor(window *gtk.Window, monitor *gdk.Monitor)

SetMonitor set the output for the window to be placed on, or nil to let the compositor choose. If the window is currently mapped, it will get remapped so the change can take effect.

Default is nil

func SetNamespace

func SetNamespace(window *gtk.Window, nameSpace string)

SetNamespace set the "namespace" of the surface.

No one is quite sure what this is for, but it probably should be something generic ("panel", "osk", etc). The name_space string is copied, and caller maintians ownership of original. If the window is currently mapped, it will get remapped so the change can take effect.

Default is "gtk-layer-shell" (which will be used if set to nil)


type Caster

type Caster interface {
	Cast() (gtk.IWidget, error)
	// contains filtered or unexported methods

Caster is the interface that allows casting objects to widgets.

type Edge

type Edge int
const (
	// EdgeLeft the left edge of the screen.
	EdgeLeft Edge = 0
	// EdgeRight the right edge of the screen.
	EdgeRight Edge = 1
	// EdgeTop the top edge of the screen.
	EdgeTop Edge = 2
	// EdgeBottom the bottom edge of the screen.
	EdgeBottom Edge = 3
	// EdgeEntryNumber should not be used except to get the number of entries
	EdgeEntryNumber Edge = 4

type Layer

type Layer int
const (
	// LayerBackground the background layer.
	LayerBackground Layer = 0
	// LayerBottom the bottom layer.
	LayerBottom Layer = 1
	// LayerTop the top layer.
	LayerTop Layer = 2
	// LayerOverlay the overlay layer.
	LayerOverlay Layer = 3
	// LayerEntryNumber should not be used except to get the number of entries
	LayerEntryNumber Layer = 4

func GetLayer

func GetLayer(window *gtk.Window) Layer


Path Synopsis
Package gir provides a roughly-written gir generator.
Package gir provides a roughly-written gir generator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL