selectionClaim seeks to the start of the data before reading it
This commit is contained in:
parent
a16f3c2cd7
commit
17422cc054
@ -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)
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user