linux capturing fix (it fucking sucks)
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user