diff --git a/backends/x/selectionclaim.go b/backends/x/selectionclaim.go index 2ccb0b6..2b13ec4 100644 --- a/backends/x/selectionclaim.go +++ b/backends/x/selectionclaim.go @@ -153,6 +153,7 @@ func (claim *selectionClaim) handleSelectionRequest ( if confidence == confidenceNone { die(); return } reader, ok := claim.data[mime] if !ok { die(); return } + reader.Seek(0, io.SeekStart) data, err := io.ReadAll(reader) if err != nil { die() } claim.window.fulfillSelectionRequest(data, 32, event) diff --git a/data/data.go b/data/data.go index 9b43e20..9e99b3b 100644 --- a/data/data.go +++ b/data/data.go @@ -5,7 +5,7 @@ import "bytes" // Data represents arbitrary polymorphic data that can be used for data transfer // between applications. -type Data map[Mime] io.ReadCloser +type Data map[Mime] io.ReadSeekCloser // Mime represents a MIME type. type Mime struct {