linux

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 49 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package linux is Tango's Linux desktop backend: GTK 3 windows hosting WebKitGTK 4.1 web views, loaded at run time with purego (no cgo).

Files without a build tag hold pure logic (accelerator and label conversion, menu roles, HTTP adaptation, the callback dispatch table, lifecycle aggregation) and are unit tested on any OS. Files ending in _linux.go are tagged `linux && !android` and talk to the native libraries.

Why GTK 3 rather than GTK 4: GtkMenuBar, window placement and broad distribution coverage (WebKitGTK 4.1 targets GTK 3); see MyGo's docs/architecture.md ("Why not GTK 4"), whose Linux backend this one borrows from (MIT, Copyright (c) 2026 MyGo contributors).

Callbacks: purego callbacks are limited in number and never freed, so the package creates a fixed handful of trampolines once (callbacks_linux.go) and routes every signal, idle source and scheme request through a dispatch table keyed by the id passed as C user_data (dispatch.go). Entries are removed by the GDestroyNotify / GClosureNotify that GLib calls when the connection or source goes away.

Index

Constants

This section is empty.

Variables

View Source
var ErrSmokeUnsupported = errors.New("not supported by this GDK backend")

ErrSmokeUnsupported is returned where the GDK backend cannot synthesize input or read the screen (Wayland).

Functions

func New

func New() platform.Backend

New returns the Linux (GTK 3 + WebKitGTK 4.1) backend. Native libraries are loaded by Init, so a program still starts and reports a clear error on machines without them.

Types

type SmokeAttachState

type SmokeAttachState struct {
	Frame          [4]float64 // x, y, w, h relative to the overlay (content area)
	InOverlay      bool       // the widget's parent is the surface's overlay
	AboveWeb       bool       // after the web view in the overlay's stacking order
	PassThrough    bool       // the overlay child is pass-through
	Shape          bool       // an input shape is set
	Focused        bool       // the widget has keyboard focus
	WebTransparent bool       // the web view's background was made transparent
	X11            bool       // clicks, moves and screen reads are available
}

SmokeAttachState describes an attached canvas.

Directories

Path Synopsis
internal
smoke command
Command smoke is a manual check of the Linux backend on a real desktop:
Command smoke is a manual check of the Linux backend on a real desktop:
smokeattach command
Command smokeattach drives canvases attached to a WebView surface of the Linux backend (docs/specs/canvas-surface.md, step D) without the root tango package.
Command smokeattach drives canvases attached to a WebView surface of the Linux backend (docs/specs/canvas-surface.md, step D) without the root tango package.
smokecanvas command
Command smokecanvas drives a canvas surface of the Linux backend (the self-drawn UI window, docs/specs/canvas-surface.md) without the root tango package.
Command smokecanvas drives a canvas surface of the Linux backend (the self-drawn UI window, docs/specs/canvas-surface.md) without the root tango package.

Jump to

Keyboard shortcuts

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