<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2655.35">
<TITLE>RE: [Annoyances] X-Windows Copy & Paste</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Richard Boulton wrote:</FONT>
</P>
<BR>
<P><FONT SIZE=2>> I've found this a most interesting discussion.</FONT>
</P>
<P><FONT SIZE=2>> To summarise, my understanding is that applications should set PRIMARY to the contents of the selection whenever it is modified, and set CLIPBOARD only on an explicit user command. Whenever CLIPBOARD is set, PRIMARY should also be set to the same thing (but this probably happens implicitly anyway, since the usual way to set CLIPBOARD involved making a selection first).</FONT></P>
<P><FONT SIZE=2>> Applications should paste from CLIPBOARD if an explicit paste is done (eg, from a menu), but may support an alternate method for pasting from PRIMARY, such as middle button click. CLIPBOARD is the copy&paste mechanism that must be implemented to ensure interoperability with all applications - therefore applications must simply provide some means of setting CLIPBOARD in order to be able to paste into all other applications.</FONT></P>
<P><FONT SIZE=2>> The "explicit action" to set CLIPBOARD could be a keyboard shortcut, a toolbar menu option, a context menu option, or possibly something else, as long as it is an explicit step that the user takes to perform the copy. CLIPBOARD should not be set simply by making a selection, since this is too destructive of data deliberately copied by the user.</FONT></P>
<P><FONT SIZE=2>> The only time it would be excusable to set CLIPBOARD on selection without an explicit action would be if there was absolutely no way that such an action could be built into the UI. However, I don't know of a situation where this is the case: for a terminal application for example, at least one of a right-click context menu or a keyboard shortcut would be appropriate.</FONT></P>
<BR>
<P><FONT SIZE=2>> An appropriate patch to Pterm to make it support the above would be:</FONT>
<BR><FONT SIZE=2>> * Leave the current behaviour of setting PRIMARY on selection with the</FONT>
<BR><FONT SIZE=2>> left button, and pasting from PRIMARY on the middle button.</FONT>
<BR><FONT SIZE=2>> * Add context menu options for "cut" and "paste", which work only on</FONT>
<BR><FONT SIZE=2>> CLIPBOARD, and have no interaction with PRIMARY.</FONT>
</P>
<P><FONT SIZE=2>> This seems neat, and hopefully avoids confusing users. It also avoid the risk that when I'm pasting from one pterm to another I slip and press the wrong mouse button (particularly common when using "emulate 3 buttons"), and lose my selection.</FONT></P>
<P><FONT SIZE=2>> I think I've got it clear enough in my head I can write a patch now, and convince the maintainers to accept it. Thanks for that.</FONT></P>
<BR>
<P><FONT SIZE=2>This seems fine except that most XDG-compliant applications will also be X applications</FONT>
<BR><FONT SIZE=2>and as such should be compliant with the ICCCM. I think this is part of the point that</FONT>
<BR><FONT SIZE=2>Havoc was making. The ICCCM is explicit on the PRIMARY selection:</FONT>
</P>
<P><FONT SIZE=2>"The selection named by the atom PRIMARY is used for all commands that take</FONT>
<BR><FONT SIZE=2>only a single argument and is the principal means of communication between clients that</FONT>
<BR><FONT SIZE=2>use the selection mechanism".</FONT>
</P>
<P><FONT SIZE=2>Only a small change to Richard's text is needed.</FONT>
<BR><FONT SIZE=2>In the third paragraph above it should be enough to change "but may" to "and must" here:</FONT>
</P>
<P><FONT SIZE=2>"... but may support an alternate method for pasting from PRIMARY,</FONT>
<BR><FONT SIZE=2>such as middle button click."</FONT>
</P>
<P><FONT SIZE=2>The appeal to existing standards also makes it clear what is really wrong with the</FONT>
<BR><FONT SIZE=2>Mozilla/pterm/Wine example: Wine ignores the primary selection. Its not clear what the</FONT>
<BR><FONT SIZE=2>right behaviour is for an emulator, but Unix-style middle button paste would probably be more useful in practice that the Windows middle-button actions.</FONT></P>
<P><FONT SIZE=2>There is also a more interesting issue of usablility here.</FONT>
<BR><FONT SIZE=2>I have been somewhat surprised at the view that</FONT>
<BR><FONT SIZE=2>middle button paste is some sort of frill for experts. Am I alone in finding the</FONT>
<BR><FONT SIZE=2>traditional X-windows actions (slice/move/click) a vastly superior user interface to</FONT>
<BR><FONT SIZE=2>the Mac/Windows slice/control-c/move/control-v, with hands moving between</FONT>
<BR><FONT SIZE=2>mouse and keyboard? (Of course in practice that is often</FONT>
<BR><FONT SIZE=2>slice/control-c/move/click edit/click chevrons/click "paste special"/</FONT>
<BR><FONT SIZE=2>click "text"/click OK, thanks to the inclusion formatting by default,</FONT>
<BR><FONT SIZE=2>but that is another story.) We have a genuinely superior interface and</FONT>
<BR><FONT SIZE=2>should make the most of it, not treat it as an anachronism to be hidden.</FONT>
</P>
<P><FONT SIZE=2>Giles</FONT>
</P>
</BODY>
</HTML>