File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ func GetDisplayBounds() []image.Rectangle {
16
16
bounds = append (bounds , screenshot .GetDisplayBounds (i ))
17
17
}
18
18
19
- if runtime .GOOS == "linux" {
19
+ if runtime .GOOS == "linux" && n > 0 {
20
20
// gdk_monitor_get_geometry considers 0,0 to be the corner of the bounding box of all the monitors,
21
21
// not the 0,0 of the main monitor
22
22
boundingBox := bounds [0 ]
@@ -36,7 +36,10 @@ func GetDisplayBoundsAt(x, y int) image.Rectangle {
36
36
37
37
displays := GetDisplayBounds ()
38
38
39
- curDisplay := displays [0 ] // use main display as fallback
39
+ curDisplay := image .Rect (0 , 0 , 0 , 0 )
40
+ if len (displays ) > 0 {
41
+ curDisplay = displays [0 ] // use main display as fallback
42
+ }
40
43
41
44
for _ , d := range displays {
42
45
if point .In (d ) {
You can’t perform that action at this time.
0 commit comments