Page MenuHomePhabricator

Copy-paste by middle-click with the mouse button on Linux pastes the text in the previous cursor location
Closed, ResolvedPublic

Description

@Pamputt tried to copy and paste text by selecting the text and then clicking with the middle button to paste it at the position of the click (i.e., not at the end of the selected text). The text was pasted where the cursor (still) was. Pamputt expected it to be pasted at the location of the click.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Esanders subscribed.

Sounds fixable, but not a very common use case.

This happens for me, too, but I always thought this was a bug/feature in xfce, as all other applications show the very same behavior.

I am using KDE, so I think XFCE is not the guilty. Actually, I would not say that it is not "a very common use case"; I would say it is about linux users but indeed linux users are not so large. It is really common on Lin ux to use select/middle click to copy-paste.

This actually works fine for me on Chrome+Ubuntu

Here, it does not work with Firefox and Mageia 5. Does it work for you on Firefox+Ubuntu?

Doesn't work for me with Firefox+Mint(Ubuntu). I agree this is frustrating for linux users. [afaik osX/win don't do middle-click?]

Doesn't work for me with Firefox+Mint(Ubuntu). I agree this is frustrating for linux users. [afaik osX/win don't do middle-click?]

Middle-click doesn't paste on Windows, and middle-click doesn't exist at all on Macs. Think different. :-p

Ack, I thought this was a CodeMirror task (I was linked here from Extension talk:CodeMirror). I've struck my comment above.
I can middleclick paste in VE and NWE (firefox+mint/ubuntu). (woooo!) Sorry for the mistake.

Actually, middle-click to paste works a bit with the visual editor on linux but not the same as in "normal" wikitext or in other any applications that I use on Linux.Here is how it works usually
1/ Select the words you want to copy (by clicking left and moving the mouse for example)
2/ Mouve your mouse to where you want to past the text you copied
3/ Middle-click allows to paste the text at the curosr position

In the visual editor, both steps 1 and 2 are similar. The difference comes from the fact if I click with the middle button, the text will be copied at the position where the cursor was at the end of the copy (or at another position if I clicked in another place), not at the position where the mouse is when I click with the middle button.

matmarex changed the task status from Open to Stalled.Aug 8 2022, 8:30 PM

We've made several changes related to middle-click pasting recently (https://gerrit.wikimedia.org/r/q/topic:middle-click-paste). Does this issue still occur?

Looks mostly fixed from my brief tests. Plain text and rich text are pasted successfully, in the correct location. Yay!
I noticed one edge-case (that is likely to occur in actual usage, but is possibly hard to resolve...?).

  • If I middle-click outside of the .mw-body area --
  • (e.g. to the left of the 1st character (in LTR) on a line, or underneath the final line of a page) --
  • then it will initially paste the desired text at the beginning, but subsequent pastes start using other content from that line (?!!). Intriguing enough that I made a screencast:

matmarex assigned this task to Esanders.

@Quiddity Thanks for testing, I filed this as T316717 now.

I'll close this task, since the feature seems to be mostly okay!