mirror of https://github.com/jetkvm/kvm.git
fix(display): Don't attempt to start the tickers if the display is disabled
If max_brightness is zero, then there's no point in trying to dim it (or turn it off...)
This commit is contained in:
parent
f5035f28c9
commit
9896eba02a
|
@ -208,6 +208,11 @@ func watchTsEvents() {
|
||||||
// if they're not already set. This is done separately to the init routine as the "never dim"
|
// if they're not already set. This is done separately to the init routine as the "never dim"
|
||||||
// option has the value set to zero, but time.NewTicker only accept positive values.
|
// option has the value set to zero, but time.NewTicker only accept positive values.
|
||||||
func startBacklightTickers() {
|
func startBacklightTickers() {
|
||||||
|
// Don't start the tickers if the display is switched off.
|
||||||
|
if config.DisplayMaxBrightness == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
LoadConfig()
|
LoadConfig()
|
||||||
if dimTicker == nil && config.DisplayDimAfterSec != 0 {
|
if dimTicker == nil && config.DisplayDimAfterSec != 0 {
|
||||||
fmt.Printf("display: dim_ticker has started\n")
|
fmt.Printf("display: dim_ticker has started\n")
|
||||||
|
|
Loading…
Reference in New Issue