1

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.

  • "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 8: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 2 '18 at 7:48
  • 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 2 '18 at 13:20
  • 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 2 '18 at 18:04
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

  • This is a gnome specific solution and does not work with unity. The unity-tweak-tool does not offer this option. – Daniel Mar 2 '18 at 7: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 2 '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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.