diff --git a/v2/claim.go b/v2/claim.go index 82fbf95..01b194c 100644 --- a/v2/claim.go +++ b/v2/claim.go @@ -16,18 +16,11 @@ type Claim struct { } // NewClaim claims ownership of a specified selection, and allows using data -// passed to it to fulfill requests for the selection's contents. If the claim -// happens because of a user input event, use NewClaimWithTimestamp instead of -// this function. See the documentation of NewClaimWithTimestamp for details. -func NewClaim (window *xwindow.Window, selection xproto.Atom, data Data) *Claim { - return NewClaimWithTimestamp(window, selection, data, 0) -} - -// NewClaimWithTimestamp claims ownership of a specified selection, and allows -// using data passed to it to fulfill requests for the selection's contents. The -// timestamp should be set to that of the event that triggered the claim, such -// as a Ctrl+C event, or a mouse motion that led to text being selected. -func NewClaimWithTimestamp (window *xwindow.Window, selection xproto.Atom, data Data, timestamp xproto.Timestamp) *Claim { +// passed to it to fulfill requests for the selection's contents. The timestamp +// should be set to that of the event that triggered the claim, such as a Ctrl+C +// event, or a mouse motion that led to text being selected. If the claim was +// not triggered by an event, specify xproto.TimeCurrentTime. +func NewClaim (window *xwindow.Window, selection xproto.Atom, data Data, timestamp xproto.Timestamp) *Claim { // Follow: // https://tronche.com/gui/x/icccm/sec-2.html#s-2.1 diff --git a/v2/examples/copy/main.go b/v2/examples/copy/main.go index a17e1a1..ba3d421 100644 --- a/v2/examples/copy/main.go +++ b/v2/examples/copy/main.go @@ -62,7 +62,7 @@ func main () { // obtain claim on CLIPBOARD log.Println("obtaining claim") clipboard, _ := xprop.Atm(X, "CLIPBOARD") - claim := xgbsel.NewClaim(window, clipboard, data) + claim := xgbsel.NewClaim(window, clipboard, data, xproto.TimeCurrentTime) // listen for events window.Listen(xproto.EventMaskPropertyChange)