simon-git: putty (master): Simon Tatham
Commits to Tartarus CVS repository.
tartarus-commits at lists.tartarus.org
Wed Sep 2 22:15:19 BST 2015
TL;DR:
a50da0e Initial support for clipboard on OS X.
Repository: git://git.tartarus.org/simon/putty.git
On the web: http://tartarus.org/~simon-git/gitweb/?p=putty.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2015-09-02 22:15:19
commit a50da0e30952c4edfacebb1ba01b5b91b0fee63c
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=a50da0e30952c4edfacebb1ba01b5b91b0fee63c;hp=0de1ac95e5fe91e71061120de314b9bd852c2303
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Sep 2 21:37:33 2015 +0100
Initial support for clipboard on OS X.
Rather than trying to get my existing hugely complicated X-style
clipboard code to somehow work with the Quartz GTK back end, I've
written an entirely new and much simpler alternative clipboard handler
usnig the higher-leve GtkClipboard interface. It assumes all clipboard
text can be converted to and from UTF-8 sensibly (which isn't a good
assumption on all front ends, but on OS X I think it's reasonable),
and it talks to GDK_SELECTION_CLIPBOARD rather than PRIMARY, which is
the only clipboard OS X has.
I had to do a fiddly thing to cope with the fact that each call to
gtk_clipboard_set_with_data caused a call to the clipboard clear
function left over from the previous set of data, so I had to avoid
mistaking that for a clipboard-clear for the _new_ data and
immediately deselecting it. I did that by allocating a distinct
placeholder object in memory for each instance of the copy operation,
so that I can tell whether a clipboard-clear is for the current copy
or a previous one.
This is only very basic support which demonstrates successful copying
and pasting is at least possible. For a sensible OS X implementation
we'll need a more believable means of generating a paste UI action
(it's quite easy to find a Mac on which neither Shift-Ins nor the
third mouse button even exists!). Also, after the trouble I had with
the clipboard-clear event, it's a bit annoying to find that it
_doesn't_ seem to get called when another application becomes the
clipboard owner. That may just be something we have to put up with, if
I can't find any reason why it's failing.
unix/gtkwin.c | 259 +++++++++++++++++++++++++++++++++++++++++++++++----------
unix/unix.h | 2 +
2 files changed, 217 insertions(+), 44 deletions(-)
More information about the tartarus-commits
mailing list