atom/atom — pull request #3027 by czaks (2014-07-21 19:45:30+00:00)
Title: Proper Linux second clipboard support

CC: #2272 #2244

My implementation follows the traditional X11 behaviour as closely as possible:

1. The main clipboard (Ctrl+C, Ctrl+V) is a different one than the second one (select, middle-click) which I'm implementing here. That means, by copying to one, the second one is left intact.
2. When pasting, the text cursor goes to a position under the mouse, then the second clipboard data are pasted (ie. it ignores and overwrites the previous cursor position and selection).
3. When copying, text is copied to the second clipboard only if I select the text with a mouse (not with a keyboard, not if the text is selected with some kind of automatic behaviour). This also includes double-click and triple-click selection.
4. When I deselect the text (this is why I check the length), the second keyboard is left intact.
5. The second clipboard should work between applications.