simon-git: xcopy (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Wed Feb 21 21:11:45 GMT 2018


TL;DR:
  f2c4a66 Use a real X server time in TIMESTAMP and SetSelectionOwner.
  41e0690 Set the window's event mask at CreateWindow time.
  5595a96 Fix 32/64-bit confusion in xcopy -T -r.

Repository:     https://git.tartarus.org/simon/xcopy.git
On the web:     https://git.tartarus.org/?p=simon/xcopy.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2018-02-21 21:11:45

commit f2c4a6636fd432edbe4da44ae4690ffb2b09e82f
web diff https://git.tartarus.org/?p=simon/xcopy.git;a=commitdiff;h=f2c4a6636fd432edbe4da44ae4690ffb2b09e82f;hp=39eeb6f455e2a66ef2bf57a34340a1d6652cfddb
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 21 21:03:43 2018 +0000

    Use a real X server time in TIMESTAMP and SetSelectionOwner.
    
    I found out today that at least one X client (namely the local->remote
    clipboard transfer in xtightvncviewer) actually checks the value in a
    selection timestamp, and uses it to decide whether to update the
    remote clipboard again from the local one. Putting the non-value
    'CurrentTime' in the selection has exactly the wrong effect, because
    xtightviewer treats that as meaning 'infinitely old'.
    
    Using the actual server time is not as easy in this application as it
    would be in a typical GUI, because a typical GUI writes the selection
    in response to some keyboard or mouse event, and can copy the server
    time out of the event that triggered the act of selection. But here,
    there is no triggering X event, and there's no GetServerTime request
    in the X protocol either. Solution: set a pointless property on our
    own window, and ensure we have PropertyChangeMask selected so that
    we'll see a PropertyNotify event informing us of the change. That
    event will have a timestamp in it.

 xcopy.c | 39 ++++++++++++++++++++++++++++++---------
 1 file changed, 30 insertions(+), 9 deletions(-)

commit 41e06900d6f51e8f1be9ffdfb9a4d1733caa0e7a
web diff https://git.tartarus.org/?p=simon/xcopy.git;a=commitdiff;h=41e06900d6f51e8f1be9ffdfb9a4d1733caa0e7a;hp=f2c4a6636fd432edbe4da44ae4690ffb2b09e82f
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 21 21:06:48 2018 +0000

    Set the window's event mask at CreateWindow time.
    
    Now that we're setting the same event mask everywhere, it seems silly
    not to fold it into the original window creation. Saves a round trip.

 xcopy.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

commit 5595a9622bb9327772f5773f11b083b464e6b26f
web diff https://git.tartarus.org/?p=simon/xcopy.git;a=commitdiff;h=5595a9622bb9327772f5773f11b083b464e6b26f;hp=41e06900d6f51e8f1be9ffdfb9a4d1733caa0e7a
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 21 21:10:28 2018 +0000

    Fix 32/64-bit confusion in xcopy -T -r.
    
    When we retrieve the TIMESTAMP selection target from a selection
    owner, we were printing it out as an unsigned long, which led to
    sign-extension if unsigned long is 64 bits and the timestamp had its
    top bit set. Now we use uint32_t, which should be sensible everywhere
    (since the size of the X11 server time is fixed by the wire protocol).

 xcopy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



More information about the tartarus-commits mailing list