Prefer replacing then deleting the selection to the other way around. This way less events need to be reported and the clipboard manager doesn't get confused.
mentioned in commit 10e1b6fd