Remove disabled backends
This commit is contained in:
parent
89131db79b
commit
2211b8a662
7 changed files with 23 additions and 88 deletions
15
backend.go
15
backend.go
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
package main
|
||||
|
||||
import "sort"
|
||||
|
||||
type PointerButton int
|
||||
type Key int
|
||||
|
||||
|
|
@ -54,12 +56,17 @@ const (
|
|||
type BackendInfo struct {
|
||||
Name string
|
||||
Init func() (Backend, error)
|
||||
|
||||
priority int
|
||||
}
|
||||
|
||||
var Backends []BackendInfo = []BackendInfo{
|
||||
{"X11", InitX11Backend},
|
||||
{"RemoteDesktop portal", InitPortalBackend},
|
||||
{"Windows", InitWindowsBackend},
|
||||
var Backends []BackendInfo
|
||||
|
||||
func RegisterBackend(name string, init func() (Backend, error), priority int) {
|
||||
Backends = append(Backends, BackendInfo{name, init, priority})
|
||||
sort.SliceStable(Backends, func(i, j int) bool {
|
||||
return Backends[i].priority < Backends[j].priority
|
||||
})
|
||||
}
|
||||
|
||||
type UnsupportedPlatformError struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue