:: Re: [DNG] Linux's sucky cut and pas…
Góra strony
Delete this message
Reply to this message
Autor: Ludovic Bellière
Data:  
Dla: dng
Temat: Re: [DNG] Linux's sucky cut and paste: was: problematic mouse driver?
Hey Steve,

I believe you have some misconception on how cut and paste
works on the X Window environment. I believe that a proper
understanding on how you host environment behave would help you figure
out an appropriate workflow.

On Tue, 17 Nov 2020 19:07:06 -0500
Steve Litt <slitt@???> wrote:

> On Tue, 17 Nov 2020 08:16:11 -0500
> Hendrik Boom <hendrik@???> wrote:
>
> Other than deliberate exclusion of Linux users by Microsoft and their
> henchmen, the only area I've seen where Windows is better than Linux
> is cut and paste. On Windows, it's Ctrl+C, Ctrl+V, and IIRC that works
> seamlessly on both CLI and GUI. On Linux, it can be Ctrl+C and Ctrl+V,
> or highlight and middle mouse button (be sure to press and not turn at
> all), or menu edit and paste, or who knows what else. I hate, hate,
> HATE it: It deeply cuts into my daily workflow.
>


Whenever you select something, the content is then sent to the PRIMARY
selection. As such, selecting text would be the equivalent of MS
Windows's CTRL-C. Content is then accessed using the middle mouse
button.

Whenever the user specifically request the content to be copied, with
CTRL-C, the content would then be sent to the CLIPBOARD selection.
Accessed then using CTRL-V.

There can be any number of selections (ie. buffers containing your
data), but we usually needs to take care of only three: PRIMARY,
SECONDARY and CLIPBOARD.

Writing this email, whenever I select some text it then becomes
available across all windows through the click of the middle mouse
button so long the text remains selected. If I want a more permanent
buffer, I would then need to use CTRL-C.

See: https://tronche.com/gui/x/icccm/sec-2.html#s-2.6

There is another behavior called cut buffers. Cut buffers store data
regardless of the state of the window from which it originates. These
behave like the PRIMARY selection, selecting text would then send the
content to a cut buffer. I believe terminals, such as xterm, make use
of the cut buffer mechanism. The guake terminal, however, does not and
uses the PRIMARY selection instead without clearing it after the text
is no longer highlighted.

See: https://tronche.com/gui/x/icccm/sec-3.html#s-3

> I've tried pastebin managers in the past, but they seemed to make
> things worse.
>
> If anybody knows of a pastebin manager (but not associated with KDE)
> that makes cut and paste on any Linux X (not associated with a
> specific wm/de (Window Manager/Desktop Environment)), please let me
> know.
>


That does not exists per say. The clipboard is managed by the X window
system for very good reason, one of them is to enable the copied
content to be shared between applications. The behavior of the
clipboard may be different depending on what takes ownership of it,
which is why you may have found different behavior with different set
of software.

Different software can take ownership of the selections, and those
software can behave differently. For instance claws-mail will purge the
PRIMARY selection whenever I stop selecting text within the window,
where as guake will not. That can lead to some weird stuff.

For instance:
- I select text within xterm -> sent to a cut buffer and PRIMARY
- Cut buffers are not available within claws mail, PRIMARY is.
- I select something in claws mail, PRIMARY gets cleared
- The content of the cut buffer is still available to xterm, so long
PRIMARY is empty.

As for the clipboard manager, I use xfce4-clipman. It handle the CTRL-C
requests and store a history. Leaves the PRIMARY selection alone. There
is also a xclipboard, but that software changes the behavior of the
selections.

>
> > Also: a lot of mouses have a middle scroll button that doubles as
> > a middle clickable button. There can be a mechanical problem here;
> > when I click on my middle button, I sometimes get a click, sometimes
> > one step of a scroll (usually upwards), and sometimes both.
> > Annoying. It takes come carefulness to get the signal I want.
>
> Yes. You need to press straight down, with absolutely no hint of
> pressure up or down, left or right. Cutting and pasting shouldn't be
> this hard.
>


Smells like a hardware problem to me. A click needs to feel like a
click, not a breeze.

Cheers,
Ludovic