Skip to content

Commit

Permalink
Merge pull request #22 from AnomalRoil/fix/weirdarchs
Browse files Browse the repository at this point in the history
A few more fixes
  • Loading branch information
kbinani authored Aug 9, 2024
2 parents b87d318 + 3e604f0 commit 66e068f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions screenshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
package screenshot

import (
"errors"
"image"
)

// ErrUnsupported is returned when the platform or architecture used to compile the program
// does not support screenshot, e.g. if you're compiling without CGO on Darwin
var ErrUnsupported = errors.New("screenshot does not support your platform")

// CaptureDisplay captures whole region of displayIndex'th display, starts at 0 for primary display.
func CaptureDisplay(displayIndex int) (*image.RGBA, error) {
rect := GetDisplayBounds(displayIndex)
Expand Down
2 changes: 1 addition & 1 deletion screenshot_supported.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build !darwin && !windows && (linux || freebsd || openbsd || netbsd)
//go:build !s390x && !ppc64le && !darwin && !windows && (linux || freebsd || openbsd || netbsd)

package screenshot

Expand Down
5 changes: 1 addition & 4 deletions screenshot_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
//go:build !(cgo && darwin) && !windows && !linux && !freebsd && !openbsd && !netbsd
//go:build s390x || ppc64le || (!(cgo && darwin) && !windows && !linux && !freebsd && !openbsd && !netbsd)

package screenshot

import (
"errors"
"image"
)

var ErrUnsupported = errors.New("screenshot does not support your platform")

// Capture returns screen capture of specified desktop region.
// x and y represent distance from the upper-left corner of primary display.
// Y-axis is downward direction. This means coordinates system is similar to Windows OS.
Expand Down

0 comments on commit 66e068f

Please # to comment.