3

I've started to experience an issue with my middle mouse key (scroll wheel press) and selections.

If I select a text, anywhere, it seems to put it into some sort of secondary clipboard without me having to do anything else but drag/select text.

It's not the same as the clipboard, I can copy any text (ctrl+c) and keep that in my clipboard, select another text. If I then use ctrl+v to paste what I have copied, it's the text I specifically copied (ctrl+c), but if I click middle mouse key, it pastes the text I last selected.

Why is this happening, and how do I turn the secondary clipboard off, so that it doesn't auto-copy when I select text? Usually, I'm using ubuntu at work and I'm afraid this one day will lead to accidents.

Edit: I don't want to disable the middle mouse key. I only want Ubuntu to stop copying text without my action. Having stuff copied that I didn't explicitly tell Ubuntu to copy will lead to complications.

Edit: This question is not a duplicate as it's about disabling the copy-on-select feature, not the actual paste feature. Pasting is totally unrelated, because pasting something that wasn't copied in the first place means nothing will be pasted in the first place.

Copy-on-select is potentially a very dangerous behavior, as users with no intention of copying a text may not know that selecting a text copied it. With todays auto-save functionality in most document software its very likely an unintentional paste is performed when the intent is simply just to scroll a document, and any changes to documents are automatically persisted to a central storage / backup solution, with document revisions. Sensitive and/or confidential information could be at stake.

terdon
  • 100,812
Daniel
  • 236
  • 2
    "What else would your middle button press want it to be?" Middle mouse is used to scroll areas and browser views, and close windows/views. Not Copy/paste. Standard behavior has never been to copy text when selecting text. It's something that has been introduced on later years. – Daniel Feb 28 '18 at 08:42
  • @Daniel middle-click paste was indeed the original default behavior on Unix, long ago before http and web browsers were invented. Apple, Microsoft, and the Linux/Unix community (including Gnome) never agreed on a common use for the button, so it varies from system to system. Not worth arguing about here either. – user535733 Feb 28 '18 at 13:15
  • @user535733 You're not making sense. Also, I'm not arguing. I'm simply asking; "how do I turn this feature off?" with the OP. It's very counter-intuitive to have two types of clipboards and especially when the 2nd one is commonly known to be the "close window" action. – Daniel Mar 02 '18 at 07:48
  • @user535733 This is not a duplicate as the other question is about disabling the middle mouse key to prevent pasting. This question is about disabling the copy-on-select functionality. – Daniel Mar 02 '18 at 13:01
  • 1
    What's the difference? If it isn't pasted, why would you care if it is copied? It isn't copied to the same buffer as the Ctrl+C copy functionality (which came much later). This is a separate thing and very, very old. Anyway, if it isn't pasted, your problem goes away doesn't it? – terdon Mar 02 '18 at 13:20
  • Why the downvotes? I think this is a legitimate question. Although I LOVE this feature ;-) Why he might want to stop the copy function? Someone could grab the contents with malware ... But I admit, this is not a very likely attack vector. – pLumo Mar 02 '18 at 13:25
  • @terdon The difference is that if the user didn't explicitly ask to copy a text, a text shouldn't be copied. The mouse key 3 binding for pasting makes this extremely dangerous for the reasons I explained in the question. But this doesn't really belong as a discussion, my question was simply if the automatic copy on selection could be disabled. – Daniel Mar 02 '18 at 14:29
  • In 17.10, I have not located a "do not copy on select" option, which would seem to make this a Wishlist Bug in that particular Desktop Environment. – user535733 Mar 02 '18 at 16:07
  • 1
    @user535733 the copying has nothing to do with the desktop environment, it's an Xorg and, presumably, Wayland thing. It has been the default action for at least the last 20 years and I'm pretty sure it was the default ever since the first use of the mouse. – terdon Mar 02 '18 at 18:04
  • Clarification: Mine doesn work either, but Iḿ using the middle/scroll button of the keyboard, in case it makes any difference... Specifically, I'm using a thinkpad external USB keyboard (still last model). I can install Tweaks and ldeactivate pasting in middle button, but the option refers to a mouse, which I don use, and they keyboard midle scrolling button keeps pasting (probably less frequently though) Any ideas about what to do in this case? Should I open a new question? – Martin Oct 27 '18 at 12:12

1 Answers1

2

Do the following steps.

  1. Install GNOME Tweak Tool (aka GNOME Tweaks) by running

    sudo apt-get install gnome-tweak-tool
    
  2. Launch GNOME Tweak Tool.

  3. Go to the "Keyboard and Mouse" section.

  4. Toggle OFF the "Middle-click Paste" option.
    enter image description here

pomsky
  • 68,507
  • This is a gnome specific solution and does not work with unity. The unity-tweak-tool does not offer this option. – Daniel Mar 02 '18 at 07:45
  • @Daniel Have you verified that it does not work with unity? Since Unity and GNOME share many schemas, one can use gnome-tweak-tool to tweak some stuffs. Install gnome-tweak-tool and try the fix if you haven't done it before and reply back. – pomsky Mar 02 '18 at 11:35
  • Installed it in Ubuntu, turned it off as you @pomsky said but middle button still does the same (pasting wathever I copied)... – Martin Oct 24 '18 at 14:16
  • I had posted it as an aswer with a pic (no pics allowed here) but deleted as it was probably innapropiated. – Martin Oct 24 '18 at 14:17