Files
streamctl/pkg/windowmanagerhandler/window_manager_handler_linux.go
2024-10-31 00:42:47 +00:00

31 lines
605 B
Go

//go:build linux && !android
// +build linux,!android
package windowmanagerhandler
import (
"context"
"os"
)
type WindowID uint64
type PID int // using the same underlying type as `os` does
type UID int // using the same underlying type as `os` does
type XWMOrWaylandWM interface {
Close() error
WindowFocusChangeChan(ctx context.Context) <-chan WindowFocusChange
}
type PlatformSpecificWindowManagerHandler struct {
XWMOrWaylandWM
}
func (wmh *WindowManagerHandler) init() error {
if os.Getenv("DISPLAY") != "" {
return wmh.initUsingXServer()
} else {
return wmh.initUsingWayland()
}
}