Documentation
¶
Index ¶
- func FindWindowByTitleStandalone(substring string) (uint32, error)
- func FocusWindowStandalone(windowID uint32) error
- func GetCurrentDesktopStandalone() (int, error)
- func MoveWindowToDesktopStandalone(windowID uint32, desktop int) error
- type Backend
- type Display
- type LinuxBackend
- func (b *LinuxBackend) ActiveDisplay() (Display, error)
- func (b *LinuxBackend) ActiveWindow() (WindowID, error)
- func (b *LinuxBackend) Close(windowID WindowID) error
- func (b *LinuxBackend) Disconnect()
- func (b *LinuxBackend) Displays() ([]Display, error)
- func (b *LinuxBackend) EventLoop()
- func (b *LinuxBackend) Focus(windowID WindowID) error
- func (b *LinuxBackend) ListWindowsOnDisplay(displayID int) ([]Window, error)
- func (b *LinuxBackend) ListWindowsOnDisplayAllDesktops(displayID int) ([]Window, error)
- func (b *LinuxBackend) Minimize(windowID WindowID) error
- func (b *LinuxBackend) MoveResize(windowID WindowID, bounds Rect) error
- func (b *LinuxBackend) RootWindow() xproto.Window
- func (b *LinuxBackend) XUtil() *xgbutil.XUtil
- type Rect
- type Window
- type WindowID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindWindowByTitleStandalone ¶
FindWindowByTitleStandalone searches for a window by title substring using a new temporary X11 connection.
func FocusWindowStandalone ¶
FocusWindowStandalone activates and raises a window using a new temporary X11 connection.
func GetCurrentDesktopStandalone ¶
GetCurrentDesktopStandalone returns the current virtual desktop number using a new temporary X11 connection.
func MoveWindowToDesktopStandalone ¶
MoveWindowToDesktopStandalone moves a window to the specified virtual desktop using a new temporary X11 connection.
Types ¶
type Backend ¶
type Backend interface {
Displays() ([]Display, error)
ActiveDisplay() (Display, error)
ActiveWindow() (WindowID, error)
ListWindowsOnDisplay(displayID int) ([]Window, error)
MoveResize(windowID WindowID, bounds Rect) error
Minimize(windowID WindowID) error
Focus(windowID WindowID) error
Close(windowID WindowID) error
}
Backend abstracts window-system operations across platforms.
type LinuxBackend ¶
type LinuxBackend struct {
// contains filtered or unexported fields
}
LinuxBackend wraps an existing X11 connection behind the platform Backend interface.
func NewLinuxBackend ¶
func NewLinuxBackend(conn *x11.Connection) *LinuxBackend
NewLinuxBackend creates a Linux platform backend from an existing X11 connection.
func NewLinuxBackendFromDisplay ¶
func NewLinuxBackendFromDisplay() (*LinuxBackend, error)
NewLinuxBackendFromDisplay creates a new Linux backend by opening a fresh X11 connection.
func (*LinuxBackend) ActiveDisplay ¶
func (b *LinuxBackend) ActiveDisplay() (Display, error)
ActiveDisplay returns the currently active display.
func (*LinuxBackend) ActiveWindow ¶
func (b *LinuxBackend) ActiveWindow() (WindowID, error)
ActiveWindow returns the currently active/focused window ID.
func (*LinuxBackend) Close ¶
func (b *LinuxBackend) Close(windowID WindowID) error
Close requests graceful window close via WM_DELETE_WINDOW.
func (*LinuxBackend) Disconnect ¶
func (b *LinuxBackend) Disconnect()
Disconnect closes the underlying X11 connection.
func (*LinuxBackend) Displays ¶
func (b *LinuxBackend) Displays() ([]Display, error)
Displays returns all active displays.
func (*LinuxBackend) EventLoop ¶
func (b *LinuxBackend) EventLoop()
EventLoop starts the X11 event loop (blocking).
func (*LinuxBackend) Focus ¶
func (b *LinuxBackend) Focus(windowID WindowID) error
Focus activates and raises a window via _NET_ACTIVE_WINDOW.
func (*LinuxBackend) ListWindowsOnDisplay ¶
func (b *LinuxBackend) ListWindowsOnDisplay(displayID int) ([]Window, error)
ListWindowsOnDisplay lists normal windows whose centers are inside the display bounds. Only windows on the current virtual desktop are returned.
func (*LinuxBackend) ListWindowsOnDisplayAllDesktops ¶
func (b *LinuxBackend) ListWindowsOnDisplayAllDesktops(displayID int) ([]Window, error)
ListWindowsOnDisplayAllDesktops lists normal windows whose centers are inside the display bounds, across ALL virtual desktops (skips the _NET_WM_DESKTOP filter).
func (*LinuxBackend) Minimize ¶
func (b *LinuxBackend) Minimize(windowID WindowID) error
Minimize minimizes a window via WM_CHANGE_STATE.
func (*LinuxBackend) MoveResize ¶
func (b *LinuxBackend) MoveResize(windowID WindowID, bounds Rect) error
MoveResize moves and resizes a window to the specified bounds.
func (*LinuxBackend) RootWindow ¶
func (b *LinuxBackend) RootWindow() xproto.Window
RootWindow returns the X11 root window ID.
func (*LinuxBackend) XUtil ¶
func (b *LinuxBackend) XUtil() *xgbutil.XUtil
XUtil returns the underlying xgbutil connection for X11-specific operations.