This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
var (
|
||||
guardOnce sync.Once
|
||||
guardViolation func(string)
|
||||
guardViolation func(kind, reason string)
|
||||
guardStop chan struct{}
|
||||
suppressMu sync.Mutex
|
||||
suppressViolationsUntil time.Time
|
||||
@@ -37,7 +37,7 @@ func violationsSuppressed() bool {
|
||||
}
|
||||
|
||||
// Start monitors the Linux desktop environment (multi-display check)
|
||||
func Start(onViolation func(reason string)) {
|
||||
func Start(onViolation func(kind, reason string)) {
|
||||
guardOnce.Do(func() {
|
||||
if onViolation == nil {
|
||||
return
|
||||
@@ -46,7 +46,7 @@ func Start(onViolation func(reason string)) {
|
||||
guardStop = make(chan struct{})
|
||||
|
||||
if screenshot.NumActiveDisplays() > 1 {
|
||||
onViolation("Phát hiện nhiều hơn 1 màn hình. Vui lòng chỉ dùng một màn hình khi chạy Simple Care.")
|
||||
onViolation("multi_monitor", "Phát hiện nhiều hơn 1 màn hình. Vui lòng chỉ dùng một màn hình khi chạy Simple Care.")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ func checkEnvironment() {
|
||||
return
|
||||
}
|
||||
if n := screenshot.NumActiveDisplays(); n > 1 {
|
||||
guardViolation("Phát hiện nhiều hơn 1 màn hình. Vui lòng rút/bật tắt màn hình phụ.")
|
||||
guardViolation("multi_monitor", "Phát hiện nhiều hơn 1 màn hình. Vui lòng rút/bật tắt màn hình phụ.")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user