[Xquartz-dev] Proposal for PRIMARY and CLIPBOARD Copy/Paste

Jeremy Huddleston jeremyhu at apple.com
Thu Sep 11 13:20:00 PDT 2008


Ok, my original response was over iPhone, so I couldn't really  
elaborate too much...  here's the basic logic/pseudocode for how this  
should work:

Event PRIMARY changed (ie someone selected new text):
	if option_proxy_on_select:
		PRIMARY -> PB

Event X11.app Edit->Copy menu item:
	PRIMARY -> PB

Event CLIPBOARD changed:
	if option_proxy_CLIPBOARD:
		CLIPBOARD -> PB

Event PB updated:
	if option_proxy_pb_to_clipboard:
		PB -> CLIPBOARD (this involves "grabbing" the CLIPBOARD)
	if option_proxy_pb_to_primary:
		PB -> PRIMARY (essentially same as above)

Event server asks for PRIMARY/CLIPBOARD:
	get what's in PB and return

On Sep 11, 2008, at 07:19, Jeremy Huddleston wrote:

> I don't really like the idea of adding more to applewm or the menus.
> I'm thinking we should just have the pbproxy code on a thread in the
> server and not make it so difficult for someone to run other wm.  The
> extra menus make our life easier to implement and less ambiguous but
> hurt the user experience.
>
> The default option for copy should be PRIMARY to pb.
>
> We should have an option that changing CLIPBOARD causes that to be
> proxies to pb.  The reason being that users don't want to copy twice
> (once to CLIPBOARD then to pb).  Additionally, most users don't
> understand what that would even mean.
>
> The user almost never expects the copy action in our menu to copy
> CLIPBOARD.
>
> On Sep 9, 2008, at 13:24, George Peter Staplin <georgeps at xmission.com>
> wrote:
>
>> Hi,
>>
>> I've been working on pbproxy, and examining other X11 selection code.
>>
>> It seems to me that we need the following menus and corresponding
>> messages that the AppleWM could provide to a pbproxy-like app:
>>
>> Copy Primary
>> Copy Clipboard
>> Paste Primary
>> Paste Clipboard
>>
>> The reasons are as follows for the Copy menu items:
>>
>> The existing Copy isn't precise enough.  The user may have text
>> selected in an xterm that uses the PRIMARY selection, and an image or
>> text copied in the Gimp or another Gtk+ app that uses CLIPBOARD.
>>
>> This means that it's unclear which selection to Copy to the
>> NSPasteboard/pbs.  If we copy PRIMARY then it may not be what the  
>> user
>> wants.  If we copy CLIPBOARD that may not be what the user wants
>> either.
>>
>> The reasons for the Paste menu items are as follows:
>>
>> When calling XSetSelectionOwner to set the X11 selection, it's also
>> imprecise to set ownership of the PRIMARY and CLIPBOARD.  The user  
>> may
>> wonder why the previously selected PRIMARY xterm text selection is no
>> longer usable.
>>
>> I wish the situation could be handled in a simpler manner, but X11
>> complicates this for us.  The existing way is ambiguous.
>>
>> I'm hoping to be able to have the pbproxy code working with these new
>> messages from the AppleWM soon.
>>
>> I wrote an Xlib-based prototype that I showed to Jeremy that supports
>> the INCR protocol, so users will be able to paste large amounts of
>> text properly from toolkits that use the INCR protocol (such as Tk  
>> and
>> Xt/Xaw/Motif).  The prototype also supports images, so it should
>> eventually be possible to copy and paste images from/to X11.
>>
>> Any thoughts or opinions on this?
>>
>>
>> George
>> -- 
>> http://www.xmission.com/~georgeps/  http://whim.linuxsys.net
>> http://code.google.com/p/megapkg/
>> _______________________________________________
>> Xquartz-dev mailing list
>> Xquartz-dev at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/xquartz-dev
> _______________________________________________
> Xquartz-dev mailing list
> Xquartz-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/xquartz-dev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3221 bytes
Desc: not available
Url : http://lists.macosforge.org/pipermail/xquartz-dev/attachments/20080911/c75f5bd4/attachment.bin 


More information about the Xquartz-dev mailing list