clipboard #14

Merged
sashakoshka merged 17 commits from clipboard into main 2023-03-30 19:45:29 -06:00
2 changed files with 2 additions and 1 deletions
Showing only changes of commit 17422cc054 - Show all commits

View File

@ -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)

View File

@ -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 {