Fix to stop xwinclip from clobbering remote clipboard

Øyvind Harboe oyvind.harboe@zylin.com
Tue Dec 23 18:26:00 GMT 2003


I'm going out on a limb here, as my experience with xfree86 is extremely
limited. Perhaps there is an option to achieve what I'm suggesting here.

Oh well! :-)

xwinclip is clobbering the clipboard when I work w/e.g. OpenOffice:

- If I copy and paste a spreadsheet cell while xwinclip is running, only
the value is copied.
- If xwinclip is not running, I can copy and paste formulas without
problems.

AFAICT, xwinclip clobbers the remote clipboard by doing a "conversion
round-trip": remote clipboard->windows clipboard->remote clipboard. Such
round trip conversions are inheritely lossy and should be avoided.

After examining the source code(see below), I've come up with the
following "scheme" for a fix:

- register a new dummy windows clipboard data type, e.g. named
"REMOTEDATA".
- whenever xwinclip updates the Windows clipboard, it also invokes
SetClipboardData(REMOTEDATA, dummyval).
- whenever xwinclip executes a paste from the Windows clipboard to e.g.
an OpenOffice spreadsheet not running under Windows, xwinclip first
checks if REMOTEDATA is present in the Windows clipboard. If the flag is
present, xwinclip effectively needs to do nothing because the remote
clipboard already contains the correct data.


http://cvsweb.xfree86.org/cvsweb/xc/programs/Xserver/hw/xwin/winclipboardxevents.c


Øyvind




More information about the Cygwin-xfree mailing list