mirror of
https://github.com/xaionaro-go/streamctl.git
synced 2025-09-27 03:45:52 +08:00
31 lines
605 B
Go
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()
|
|
}
|
|
}
|