mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 13:07:26 +01:00
devicescale: Rename windowManager -> desktop
This commit is contained in:
parent
60993fe3ea
commit
75f5cbd45a
@ -26,23 +26,23 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type windowManager int
|
type desktop int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
windowManagerUnknown windowManager = iota
|
desktopUnknown desktop = iota
|
||||||
windowManagerGnome
|
desktopGnome
|
||||||
windowManagerCinnamon
|
desktopCinnamon
|
||||||
)
|
)
|
||||||
|
|
||||||
func currentWindowManager() windowManager {
|
func currentDesktop() desktop {
|
||||||
tokens := strings.Split(os.Getenv("XDG_CURRENT_DESKTOP"), ":")
|
tokens := strings.Split(os.Getenv("XDG_CURRENT_DESKTOP"), ":")
|
||||||
switch tokens[len(tokens)-1] {
|
switch tokens[len(tokens)-1] {
|
||||||
case "GNOME":
|
case "GNOME":
|
||||||
return windowManagerGnome
|
return desktopGnome
|
||||||
case "X-Cinnamon":
|
case "X-Cinnamon":
|
||||||
return windowManagerCinnamon
|
return desktopCinnamon
|
||||||
default:
|
default:
|
||||||
return windowManagerUnknown
|
return desktopUnknown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,14 +87,14 @@ func cinnamonScale() float64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func impl() float64 {
|
func impl() float64 {
|
||||||
switch currentWindowManager() {
|
switch currentDesktop() {
|
||||||
case windowManagerGnome:
|
case desktopGnome:
|
||||||
s := gnomeScale()
|
s := gnomeScale()
|
||||||
if s <= 0 {
|
if s <= 0 {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
case windowManagerCinnamon:
|
case desktopCinnamon:
|
||||||
s := cinnamonScale()
|
s := cinnamonScale()
|
||||||
if s <= 0 {
|
if s <= 0 {
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
Reference in New Issue
Block a user