Temporary redirect to patched xgbutil that will only work on my machine

This commit is contained in:
Sasha Koshka
2023-03-30 18:05:29 -04:00
parent f9e5503320
commit 017543aa0f
5 changed files with 15 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ type selectionClaim struct {
func (window *window) claimSelection (name xproto.Atom, data data.Data) *selectionClaim {
// Follow:
// https://tronche.com/gui/x/icccm/sec-2.html#s-2.1
// A client wishing to acquire ownership of a particular selection
// should call SetSelectionOwner. The client should set the specified
// selection to the atom that represents the selection, set the
@@ -35,6 +35,11 @@ func (window *window) claimSelection (name xproto.Atom, data data.Data) *selecti
window.xWindow.Id, name, 0).Check() // FIXME: should not be zero
if err != nil { return nil }
ownerReply, err := xproto.GetSelectionOwner (
window.backend.connection.Conn(), name).Reply()
if err != nil { return nil }
if ownerReply.Owner != window.xWindow.Id { return nil}
return &selectionClaim {
window: window,
data: data,
@@ -139,7 +144,7 @@ func (claim *selectionClaim) handleSelectionRequest (
for index, name := range targetNames {
atom, err := xprop.Atm(claim.window.backend.connection, name)
if err != nil { die(); return }
xgb.Put32(data[:index * 4], uint32(atom))
xgb.Put32(data[:(index + 1) * 4], uint32(atom))
}
claim.window.fulfillSelectionRequest(data, 8, event)