Default to fullscreen mode on Steam Deck
This commit is contained in:
parent
d4e378d7e0
commit
4b80831ccd
5 changed files with 30 additions and 0 deletions
4
flags.go
4
flags.go
|
@ -86,6 +86,10 @@ func parseFlags() *game.Game {
|
|||
flag.IntVar(&debug, "debug", 0, "Debug level")
|
||||
flag.Parse()
|
||||
|
||||
if game.DefaultFullscreen() {
|
||||
fullscreen = true
|
||||
}
|
||||
|
||||
var forceLanguage *language.Tag
|
||||
if locale == "" {
|
||||
var err error
|
||||
|
|
|
@ -29,3 +29,7 @@ func GetLocale() (string, error) {
|
|||
}
|
||||
return string(out), nil
|
||||
}
|
||||
|
||||
func DefaultFullscreen() bool {
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -3,9 +3,20 @@
|
|||
package game
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
)
|
||||
|
||||
func GetLocale() (string, error) {
|
||||
return os.Getenv("LANG"), nil
|
||||
}
|
||||
|
||||
func DefaultFullscreen() bool {
|
||||
buf, err := os.ReadFile("/sys/devices/virtual/dmi/id/board_vendor")
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
steamDevice := bytes.Equal(bytes.ToLower(bytes.TrimSpace(buf)), []byte("valve"))
|
||||
return steamDevice // Default to fullscreen mode on Steam Deck.
|
||||
}
|
||||
|
|
|
@ -7,3 +7,7 @@ import "syscall/js"
|
|||
func GetLocale() (string, error) {
|
||||
return js.Global().Get("navigator").Get("language").String(), nil
|
||||
}
|
||||
|
||||
func DefaultFullscreen() bool {
|
||||
return false
|
||||
}
|
||||
|
|
7
game/platform_windows.go
Normal file
7
game/platform_windows.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
//go:build windows
|
||||
|
||||
package game
|
||||
|
||||
func DefaultFullscreen() bool {
|
||||
return false
|
||||
}
|
Loading…
Reference in a new issue