linux capturing fix (it fucking sucks)

This commit is contained in:
KingKDot
2026-04-03 19:43:41 -05:00
parent 37bb3aabd7
commit 69b3e7833c
10 changed files with 445 additions and 9 deletions
@@ -9,6 +9,15 @@ import (
)
func displayBounds(idx int) image.Rectangle {
if !isWaylandSession && !x11Disabled.Load() {
if b := x11DisplayBounds(idx); b.Dx() > 0 && b.Dy() > 0 {
return b
}
}
n := screenshot.NumActiveDisplays()
if idx < 0 || idx >= n {
return image.Rectangle{}
}
return screenshot.GetDisplayBounds(idx)
}
@@ -17,10 +26,10 @@ func displayScale(idx int) float64 {
}
func MonitorInfos() []MonitorInfo {
n := screenshot.NumActiveDisplays()
n := displayCount()
infos := make([]MonitorInfo, 0, n)
for i := 0; i < n; i++ {
b := screenshot.GetDisplayBounds(i)
b := displayBounds(i)
infos = append(infos, MonitorInfo{
Width: b.Dx(),
Height: b.Dy(),