Don't create new requestor objects for finished transfers
hackerb9 opened this issue · 1 comments
Currently, when xclip owns the selection and it finishes sending the data via INCR, xcin() returns 1 to signal that it is done and the requestor should be deleted from our linked list in xclip.c. However, after doing that, xclip immediately recreates the requestor it just deleted after receiving a final PropertyNotify message from the client to let us know that it is finished. We ignore the message, so no harm is done, but it is a silly thing to do.
It may make sense to use the PropertyNotify events to move the state machine in xcin() forward instead of ignoring them. Currently, only PropertyNotify events with evt.state == PropertyDelete are used and only in XCIN_INCR. It is typical to receive evt.state == PropertyNewValue during INCR, but we just ignore them.