Compare commits
2 Commits
46523a2217
...
36b3e4f0ed
Author | SHA1 | Date | |
---|---|---|---|
36b3e4f0ed | |||
d9d84ddada |
17
v2/claim.go
17
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
|
||||
|
||||
|
@ -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
6
v2/go.sum
Normal 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=
|
Loading…
Reference in New Issue
Block a user