feat(agent): add screen blackout feature
- Physical displays blanked via overlay - Remote video and input keep working - Exclude overlay from screen capture - Add blackout API and UI toggle - Wire flag through capture protocol
This commit is contained in:
@@ -18,7 +18,7 @@ func RunHelper() int {
|
||||
in := bufio.NewReader(os.Stdin)
|
||||
out := bufio.NewWriter(os.Stdout)
|
||||
for {
|
||||
monitor, format, quality, err := readRequest(in)
|
||||
monitor, format, quality, omitLayered, err := readRequest(in)
|
||||
if err == io.EOF {
|
||||
return 0
|
||||
}
|
||||
@@ -27,7 +27,7 @@ func RunHelper() int {
|
||||
_ = out.Flush()
|
||||
return 1
|
||||
}
|
||||
img, err := grab(monitor, format, quality)
|
||||
img, err := grab(monitor, format, quality, omitLayered)
|
||||
if err != nil {
|
||||
if werr := writeErr(out, err.Error()); werr != nil {
|
||||
return 1
|
||||
@@ -46,11 +46,12 @@ func RunHelper() int {
|
||||
}
|
||||
}
|
||||
|
||||
func grab(monitor int, format string, quality int) (img models.CapturedImage, err error) {
|
||||
func grab(monitor int, format string, quality int, omitLayered bool) (img models.CapturedImage, err error) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = fmt.Errorf("panic: %v", r)
|
||||
}
|
||||
}()
|
||||
screenshot.SetOmitLayered(omitLayered)
|
||||
return screenshot.CaptureMonitor(monitor, format, quality)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user