Documentation
¶
Overview ¶
Package x11 is the X11 backend. It calls Xlib and XInput2 through purego.
Flutter: the Linux embedder (engine/src/flutter/shell/platform/linux).
Index ¶
- type Platform
- func (p *Platform) Clipboard() platform.Clipboard
- func (p *Platform) Close() error
- func (p *Platform) Displays() []platform.Display
- func (p *Platform) NewWindow(cfg platform.WindowConfig) (platform.Window, error)
- func (p *Platform) Post(fn func())
- func (p *Platform) Run(ctx context.Context, h platform.Handler) error
- func (p *Platform) Services() platform.Services
- func (p *Platform) Settings() platform.Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
Platform is the X11 backend of platform.Platform: Xlib and XInput2 through purego, with EGL for drawing (SPEC §8.3). It belongs to the UI thread.
Flutter: no counterpart
func New ¶
New connects to the X server named by name (empty means $DISPLAY) and sets up the keyboard and pointer input. It fails with LibraryLoadFailed when libX11 is missing and X11OpenDisplayFailed when the display cannot be opened. Without libXi or without XInput2 on the server there is no keyboard and pointer input (a warning is logged). Close releases the connection.
Flutter: no counterpart
func (*Platform) Close ¶
Close closes the windows that are still open and the connection. Do not use the platform afterwards, and do not call it while Run is active.
Flutter: no counterpart
func (*Platform) Displays ¶
Displays lists the monitors, the primary one marked. A monitor is placed and sized in logical pixels, by its own scale.
Flutter: no counterpart
func (*Platform) NewWindow ¶
NewWindow creates a toplevel window and maps it. The window is visible once the window manager has handled the map request, which happens inside Run: the first frame is then requested from the handler.
The window uses the X visual that EGL wants for its config, so that the renderer can draw into it (gles.X11Visual); when EGL is not usable the window uses the default visual and the renderer's Open will report the failure.
Flutter: no counterpart
func (*Platform) Post ¶
func (p *Platform) Post(fn func())
Post runs fn on the UI thread inside Run. It is safe from any goroutine and wakes the loop.
Flutter: no counterpart
func (*Platform) Run ¶
Run runs the event loop on the calling goroutine, which must be the UI thread, and delivers events to h. It returns nil when ctx is cancelled or when the last window has been closed. A second call while Run is active fails with PlatformAlreadyRunning.
Flutter: no counterpart
func (*Platform) Services ¶
Services returns the services that the Linux backends share (the accessibility bridge).
Flutter: no counterpart