gamescope

package
v2.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package gamescope makes externally launched windows visible and focused in gamescope Gaming Mode sessions. It does not register launches with Steam, so it cannot provide Steam/QAM menus, overlay injection, or Steam Input ownership.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBaselayerValue

func BuildBaselayerValue(appID, original string) string

BuildBaselayerValue prepends appID to existing baselayer values.

func ParseBaselayerOutput

func ParseBaselayerOutput(output string) string

ParseBaselayerOutput extracts baselayer values from xprop output.

func ParseWindowPIDOutput

func ParseWindowPIDOutput(output string) (int, bool)

ParseWindowPIDOutput extracts owning PID from xprop output.

Types

type FocusManager

type FocusManager struct {
	// contains filtered or unexported fields
}

FocusManager tracks focus properties for restoration.

func (*FocusManager) Revert

func (fm *FocusManager) Revert()

Revert restores original baselayer once.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager owns one platform session's gamescope detection and focus state.

func NewManager

func NewManager(opts SessionOptions) *Manager

NewManager creates an independent gamescope session manager.

func (*Manager) Enabled

func (m *Manager) Enabled() bool

Enabled reports whether platform opted into gamescope integration.

func (*Manager) GamescopeDisplay

func (m *Manager) GamescopeDisplay() string

GamescopeDisplay returns detected gamescope X display.

func (*Manager) IsGamingMode

func (m *Manager) IsGamingMode() bool

IsGamingMode detects a gamescope Xwayland session. Positive results are briefly cached.

func (*Manager) ManageFocus

func (m *Manager) ManageFocus(proc *os.Process)

ManageFocus makes proc's external window visible and focused by gamescope. This is compositor focus only; it does not make Steam own the launch.

func (*Manager) RevertFocus

func (m *Manager) RevertFocus()

RevertFocus cancels this manager's pending focus and restores its active baselayer state.

func (*Manager) WrapLauncher

func (m *Manager) WrapLauncher(launcher *platforms.Launcher)

WrapLauncher adds automatic gamescope focus handling to a non-Steam launcher. Launchers without a returned process remain fire-and-forget.

func (*Manager) WrapLaunchers

func (m *Manager) WrapLaunchers(launchers []platforms.Launcher)

WrapLaunchers adds automatic focus handling to every non-Steam launcher.

type SessionOptions

type SessionOptions struct {
	Enabled bool
}

SessionOptions controls gamescope integration. Zero value disables it.

Jump to

Keyboard shortcuts

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