Compare commits

...

2 Commits

Author SHA1 Message Date
36b3e4f0ed Collapse the claim constructors 2024-07-11 02:07:55 -04:00
d9d84ddada Add go.sum 2024-07-11 02:07:48 -04:00
3 changed files with 12 additions and 13 deletions

View File

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

View File

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

6
v2/go.sum Normal file
View File

@ -0,0 +1,6 @@
github.com/BurntSushi/freetype-go v0.0.0-20160129220410-b763ddbfe298/go.mod h1:D+QujdIlUNfa0igpNMk6UIvlb6C252URs4yupRUV4lQ=
github.com/BurntSushi/graphics-go v0.0.0-20160129215708-b43f31a4a966/go.mod h1:Mid70uvE93zn9wgF92A/r5ixgnvX8Lh68fxp9KQBaI0=
github.com/jezek/xgb v1.1.0 h1:wnpxJzP1+rkbGclEkmwpVFQWpuE2PUGNUzP8SbfFobk=
github.com/jezek/xgb v1.1.0/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk=
github.com/jezek/xgbutil v0.0.0-20230603163917-04188eb39cf0 h1:Pf/0BAbppEOq4azPH6fnvUX2dycAwZdGkdxFn25j44c=
github.com/jezek/xgbutil v0.0.0-20230603163917-04188eb39cf0/go.mod h1:AHecLyFNy6AN9f/+0AH/h1MI7X1+JL5bmCz4XlVZk7Y=