Subject: Re: bug#53894: 27.2; Clipboard copy -> C-y -> M-y -> Same clipboard copy does not push to kill ring

From: Po Lu <[email-masked]>
Date: Sat, 12 Feb 2022 10:28:45 +0800

Po Lu <[email-masked]> writes:

> Ignacio Casso <[email-masked]> writes:
>
>> It is a typo indeed. Sorry, English is not my native language.
>
> Thanks, your analysis is indeed correct.  I will look into how other
> programs handle this problem and ack.

It is OK to rely on the timestamp always increasing, since the X server
ensures that there will be no races.  The timestamp is in server time,
so there is no need to worry about it moving backwards if the system
time is moved backwards.

So if (x-get-selection 'CLIPBOARD 'TIMESTAMP) is larger than the last
time it was recorded, then it is safe to say that the selection has
"changed".

However, it will still be necessary to keep the DWIM logic on X as a
fallback in the case that the clipboard timestamp has not changed, since
some clients are badly behaved and only change their record of the
current period's selection if they already own it.

On other systems it should work to rely on the clipboard modification
counters.