Bug 113973 - Linux middle mouse button copy does not work correctly
Summary: Linux middle mouse button copy does not work correctly
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Linux (All)
: medium trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Cut-Copy
  Show dependency treegraph
 
Reported: 2017-11-21 14:43 UTC by Michael Lashkevich
Modified: 2023-09-09 03:06 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
A screenshot from clipboard. (65.29 KB, image/png)
2018-05-21 10:47 UTC, Michael Lashkevich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Lashkevich 2017-11-21 14:43:16 UTC
Description:
When I select a part of text with mouse in LibreOffice under Linux, it does not automatically copy the contents to the buffer (though the syncronization of both buffers are turned on on my computers). I always need to type Ctrl-C as under Windows. It is a highly annoying feature, since (nearly) all other Linux X-Window applications support autocopying mouse selection, and I get accustomed to use it. 

Steps to Reproduce:
1. Open any document (of any kind).
2. Select a part by a mouse.
3. Try to paste it to another place (with either middle botton or Ctrl-V).

Actual Results:  
You see that the pasted text does not coincide with the copied one.

Expected Results:
The pasted text coincides with the copied one (with or without formatting depending on the place I insert).


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Comment 1 Xavier Van Wijmeersch 2017-11-22 14:22:03 UTC
no repro, did try dragging and copy/past even to another document, the only thing i remarked was when cutting in writer when there where table/rows inserted

Version: 6.0.0.0.alpha1+
Build ID: f1a55c4bfc6afcd9fd316e055e626097e0666ea8
CPU threads: 8; OS: Linux 4.14; UI render: default; VCL: kde4; 
Locale: nl-BE (en_US.UTF-8); Calc: group threaded
Comment 2 Buovjaga 2017-11-23 18:58:55 UTC
Works here.

Not sure, if relevant for this case, but check that Tools - Options - LibreOffice - View: Mouse, Middle mouse button has "Paste clipboard"

You have the earliest version affected as 3.3.0, but I assume you also tested something like 5.4.x?

Arch Linux 64-bit
Version: 6.0.0.0.alpha1+
Build ID: 008673c23db0c812eb0b48a1c29ab88b48aaa867
CPU threads: 8; OS: Linux 4.13; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on November 23rd 2017

Arch Linux 64-bit
Version: 5.4.3.2
Build ID: 5.4.3-1
CPU threads: 8; OS: Linux 4.13; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Comment 3 Michael Lashkevich 2017-11-23 19:11:41 UTC
> Not sure, if relevant for this case, but check that Tools - Options -
> LibreOffice - View: Mouse, Middle mouse button has "Paste clipboard"
Yes, I have this option set. In fact, when a text is copied with Ctrl-C it can be pasted by the middle mouse button correctly. But if it is just selected by mouse, both Ctrl-V and middle button fail. Thus, it is a problem of copying rather than pasting.

> You have the earliest version affected as 3.3.0, but I assume you also
> tested something like 5.4.x?
In fact, I remember this problem from the first versions of Open/LibreOffice I used many many years ago. But since lastly I began to use LibreOffice more intensively, it annoys me more, and I decided to report it.
Comment 4 Buovjaga 2017-11-23 19:27:51 UTC
What kind of a Linux environment you currently have? Desktop environment or window manager & distro?
Comment 5 Michael Lashkevich 2017-11-23 20:16:20 UTC
(In reply to Buovjaga from comment #4)
> What kind of a Linux environment you currently have? Desktop environment or
> window manager & distro?

OpenSUSE 42.2, KDE Plasma 5.8.8.
Comment 6 Buovjaga 2017-11-24 08:15:39 UTC
(In reply to Michael Lashkevich from comment #5)
> (In reply to Buovjaga from comment #4)
> > What kind of a Linux environment you currently have? Desktop environment or
> > window manager & distro?
> 
> OpenSUSE 42.2, KDE Plasma 5.8.8.

Hmm, I just found bug 110988

Are you running LibreOffice version 5.4.1 or greater?
Comment 7 Michael Lashkevich 2017-11-24 21:45:23 UTC
(In reply to Buovjaga from comment #6)

> Are you running LibreOffice version 5.4.1 or greater?
No, libreoffice-5.3.5.2-18.9.4.x86_64.
Comment 8 Buovjaga 2017-11-25 08:51:45 UTC
(In reply to Michael Lashkevich from comment #7)
> (In reply to Buovjaga from comment #6)
> 
> > Are you running LibreOffice version 5.4.1 or greater?
> No, libreoffice-5.3.5.2-18.9.4.x86_64.

Then please try 5.4.3 as it will most probably work.
Comment 9 Jean-Baptiste Faure 2017-12-24 16:16:23 UTC
What is works for me:
1/ select some text
2/ maintain left button and drag to another place then release the button -> moves the selected text
3/ maintain ctrl+left button and drag to another place then release the button -> paste a copy of the selected text

Same behavior as in Gedit text editor.

Versions 5.4.3, 6.0.0.1.0+ and master / Ubuntu 16.04 x86-64

Best regards. JBF
Comment 10 Xisco Faulí 2018-01-24 09:17:49 UTC Comment hidden (obsolete)
Comment 11 Michael Lashkevich 2018-05-20 21:43:37 UTC
Recently, I installed 6.0.4.2. The problem has not yet been solved.

It is really possible to copy by left-button - middle-button within a document or between different LibreOffice windows, but the copied text does not go the the system clipboard (either an empty string or the first letter goes their), so that you cannot copy it to any other application (editor, browser, mail client etc.) without makin Ctrl-C in the LibreOffice window.
Comment 12 Buovjaga 2018-05-21 06:28:05 UTC
(In reply to Michael Lashkevich from comment #11)
> Recently, I installed 6.0.4.2. The problem has not yet been solved.
> 
> It is really possible to copy by left-button - middle-button within a
> document or between different LibreOffice windows, but the copied text does
> not go the the system clipboard (either an empty string or the first letter
> goes their), so that you cannot copy it to any other application (editor,
> browser, mail client etc.) without makin Ctrl-C in the LibreOffice window.

I can middle mouse button paste from LibreOffice to Konsole just fine. Maybe you could also try in Safe mode, just check that the "Paste clipboard" option is set while testing: Help - Restart in safe mode and then Continue in safe mode.
Comment 13 Michael Lashkevich 2018-05-21 10:47:17 UTC
Created attachment 142225 [details]
A screenshot from clipboard.
Comment 14 Michael Lashkevich 2018-05-21 10:48:18 UTC
(In reply to Buovjaga from comment #12)
> I can middle mouse button paste from LibreOffice to Konsole just fine. Maybe
> you could also try in Safe mode, just check that the "Paste clipboard"
> option is set while testing: Help - Restart in safe mode and then Continue
> in safe mode.
No use. The problem is not with the middle button, but with the left one. When I mark any text out in any other program by the mouse left button, I can see it in the clipboard. When I mark in the LibreOffice, it does not appear their (either a void string of the first letter).
Comment 15 Buovjaga 2018-05-21 10:58:59 UTC
Your original description had: "Try to paste it to another place (with either middle botton or Ctrl-V)"

Are you now saying middle button works, but Ctrl-V does not? I can confirm that Ctrl-V does not work, but this is how it is in all the other software. The middle button buffer is not the same.

Go to Konsole, select a string, ctrl-shift-c to put it in clipboard, ctrl-shift-v to see paste result, then select another string in Konsole with left mouse button, ctrl-shift-v to see it is still pasting the string you first put into clipboard.
Comment 16 Michael Lashkevich 2018-05-21 20:23:10 UTC
(In reply to Buovjaga from comment #15)
> Are you now saying middle button works, but Ctrl-V does not? I can confirm
> that Ctrl-V does not work, but this is how it is in all the other software.
> The middle button buffer is not the same.
No, both middle button and Ctrl-V work well, when there is something in the clipboard. The problem, that LibreOffice, in contrast to all other X-Window applications, sends nothing to the clipboard (except for the first symbol), if you just mark a text with the mouse with pressed _left_ button.

I _never_ use Ctrl-C, because I _never_ need it in Linux. I just mark with the mouse and paste with the mouse. LibreOffice is the only program that forces me to use Ctrl-C, because mouse marking does not work properly.
Comment 17 Jean-Baptiste Faure 2018-05-21 21:02:41 UTC
(In reply to Michael Lashkevich from comment #16)
> [...]
> I _never_ use Ctrl-C, because I _never_ need it in Linux. I just mark with
> the mouse and paste with the mouse. LibreOffice is the only program that
> forces me to use Ctrl-C, because mouse marking does not work properly.

I just tried to copy&paste (using only left click and middle click) between Writer and Thunderbird (mail editor) and it works. I did that with LO 6.0.4 provided by Ubuntu.

Best regards. JBF
Comment 18 Michael Lashkevich 2018-05-21 21:20:41 UTC
(In reply to Jean-Baptiste Faure from comment #17)
> I just tried to copy&paste (using only left click and middle click) between
> Writer and Thunderbird (mail editor) and it works. I did that with LO 6.0.4
> provided by Ubuntu.
Maybe, it depends on the build or on the graphic environment? I use OpenSUSE 42.3, the build from the main distribution, within KDE Plasma 5.
Comment 19 Buovjaga 2018-05-22 06:21:32 UTC
(In reply to Michael Lashkevich from comment #18)
> (In reply to Jean-Baptiste Faure from comment #17)
> > I just tried to copy&paste (using only left click and middle click) between
> > Writer and Thunderbird (mail editor) and it works. I did that with LO 6.0.4
> > provided by Ubuntu.
> Maybe, it depends on the build or on the graphic environment? I use OpenSUSE
> 42.3, the build from the main distribution, within KDE Plasma 5.

Sure, it seems to be a problem in your Linux system. I use Arch Linux and KDE Plasma 5 still, like last year.

I recommend creating a live USB with another KDE-using distro just to confirm it works. Maybe you could also do a USB with openSUSE to see, if the problem is in your personal system and not openSUSE itself.
Comment 20 Xisco Faulí 2018-06-22 14:06:31 UTC
Does it work if you try 'SAL_USE_VCLPLUGIN=gtk soffice' ?

I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' once the answer has been replied
Comment 21 Michael Lashkevich 2018-06-22 14:42:19 UTC
(In reply to Xisco Faulí from comment #20)
> Does it work if you try 'SAL_USE_VCLPLUGIN=gtk soffice' ?
No difference.
Comment 22 mkts 2018-06-28 05:47:08 UTC Comment hidden (no-value)
Comment 23 Raymond Wu Won 2018-07-01 11:52:52 UTC
I can reproduce this in 6.0.5.2 *but* I always thought it was purely a desktop environment/window manager decision as well as the general user preference - i.e., copying on select would lead to the undesirable effect of wiping cut or copied contents in a "standard" word processing scenario for many. although now that I say that, I notice browsers such as Firefox allow it.

Anyway, if possible - please test a simple workaround by installing a clipboard manager such as ClipIt, which does have a copy on select option that works with LibreOffice.

There's also a good list of various clipboard managers at https://wiki.archlinux.org/index.php/Clipboard#List_of_clipboard_managers

Of possible interest too would be the Arch Linux "most popular apps of 2017+" survey via reddit - it will help to narrow down the dilemma of choice: https://www.reddit.com/r/archlinux/comments/63pqvt/survey_vote_for_the_most_popular_apps_of_2017/dfw6nzd/

I hope this is of use.
Ray.
Comment 24 Michael Lashkevich 2018-07-01 12:23:27 UTC
(In reply to Raymond Wu Won from comment #23)
> Anyway, if possible - please test a simple workaround by installing a
> clipboard manager such as ClipIt, which does have a copy on select option
> that works with LibreOffice.
Just the same. The clipboard only gets the first character.
Comment 25 Vojtech Michalek 2019-04-12 09:48:13 UTC
I just want to confirm the same behaviour as described by Michael Lashkevich on both Debian 9 with XFCE and Ubuntu 18.10 with MATE on different machines, so it is not problem of his particular system. Similarly as Michael, I have seen this behaviour for a long time already.
Comment 26 Olivier 2019-05-27 19:41:42 UTC
In my experience (Debian, LibreOffice 6.1.5.2, XFCE 4.12, Clipman manager):

- In Writer: copy works well, i.e. the clipboard manager gets the selection, either with Ctrl+C or with LMB selection.

- In Calc: copy DOES NOT WORK when a cell is selected, i.e. the clipboard manager gets nothing, neither with Ctrl+C nor with LMB selection. Copy works from the "input line", but this is a pale workaround, since one expects the copy to work directly for a cell.

The defective copy is a major annoyance (and a symptom of wrong programming?)

Note: LMB above means "Left Mouse Button"
Comment 27 Olivier 2019-05-27 20:41:27 UTC
So, to me, the MMB works correctly for pasting.
It's only with the "calc" application that there is a specific problem. 
I opened bug 125534 for this specific problem.

Note: MMB = "Middle Mouse Button".
Comment 28 David Faure 2019-08-26 11:16:47 UTC
This bug is back again. I upgraded from libreoffice-writer-6.1.3.2 (where LMB-copy worked) to libreoffice-writer-6.2.5.2, and LMB-copy stopped working.
This happened on two different computers, both running OpenSuSE Leap 15.1.
Comment 29 Xisco Faulí 2019-09-03 10:31:10 UTC
(In reply to David Faure from comment #28)
> This bug is back again. I upgraded from libreoffice-writer-6.1.3.2 (where
> LMB-copy worked) to libreoffice-writer-6.2.5.2, and LMB-copy stopped working.
> This happened on two different computers, both running OpenSuSE Leap 15.1.

This bug is inherit from OOo, thus, it's not a regression
Comment 30 Zak McKracken 2019-09-14 22:07:12 UTC
My setup:
openSUSE Tumbleweed, LibreOffice Version: 6.3.0.4, Build-ID: 30(Build:4)

I tried a few things, and found the following:

1: Initially, the preferences are set to auto-scroll. I'd prefer insert.

2: After setting it to "paste the clipboard", LO wants to restart. I close LO, click the file I'd been editing in Dolphin, and middle click does nothing

3: I set it do "do nothing", restart again, no change

4: After seeing the thread on ask.libreoffice [1], I set it to "insert clipboard", started writer from the commandline, with the filename as argument. Then tried to copy something into the document from a console window -- select/insert works!

5: Same trick within the same document works now! I closed LO again, opened via doubleclick: Still works, directly.

6: Set it to "do nothing" -- middle click really does nothing

7: back to "insert clipboard": still does nothing, and I have to restart before it works again, despite no message to this effect.


...So maybe there's something going wrong the first time the feature is being used?



[1] https://ask.libreoffice.org/en/question/53433/why-cant-i-get-middle-mouse-button-action-to-paste-cilpboard-in-lo-5003/
Comment 31 Zak McKracken 2019-09-14 22:18:33 UTC
One more remark:

I think it's slightly misleading to call the feature "paste clipboard" because it's not inserting the clipboard but the mouse buffer.

Test:
* select some text, press ctrl+c
* select some other text with the mouse
* place the text cursor somewhere, hit ctrl+v
* middle-click somewhere else

==> they are two separate tools, and this is how it should be on Linux: The mouse buffer (select/insert) and the clipboard (copy/paste) are separate and can have different contents. I also typically use them for different tasks.

I'd therefore suggest renaming the preference to "insert mouse buffer" or similar, to prevent users from making false assumptions (as I did until recently...) and reduce misunderstandings among devs/users about what the function should/should not do.
Comment 32 Safeer Pasha 2021-02-15 08:41:20 UTC
to all parties concerned:
please test now, I just Tested and its OK.

Version: 7.1.0.3 / LibreOffice Community
Build ID: 10(Build:3)
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 33 Fab Stz 2021-09-06 16:23:02 UTC
Still present in debian bullseye with this version of Libreoffice

Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: kf5
Locale: fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Debian package version: 1:7.0.4-4
Calc: threaded
Comment 34 Fab Stz 2021-09-06 17:31:01 UTC
And with 7.1.5.2 also, selecting text with left click, puts only the two first letters of the selection into the clipboard (KDE clipboard in my case)

Version: 7.1.5.2 / LibreOffice Community
Build ID: 10(Build:2)
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: kf5
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Debian package version: 1:7.1.5-2~bpo11+1
Calc: threaded
Comment 35 Fab Stz 2021-09-06 17:44:37 UTC
As an addition:

- double click on a word, copies it well to the clipboard
- triple click on a word, selects the paragraphs and copies the whole paragraph to the clipboard

So these two are working as expected.

- selecting from left to right or from right to left store either the first character or an empty string in the clipboard

In this last case, it is expected all the selected text to be in the clipboard
Comment 36 QA Administrators 2023-09-07 03:15:49 UTC Comment hidden (obsolete)
Comment 37 Michael Lashkevich 2023-09-08 07:55:17 UTC
I confirm the bug for LibreOffice 7.5.4.1 (OpenSUSE libreoffice-*-7.5.4.1-150400.17.12.4.x86_64.rpm).
Comment 38 QA Administrators 2023-09-09 03:06:08 UTC
Dear Michael Lashkevich,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug