Bug 305052 - Middle mouse button pastes clipboard to apps.
Summary: Middle mouse button pastes clipboard to apps.
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 4.8.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-12 22:32 UTC by Emmett Culley
Modified: 2022-04-07 12:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmett Culley 2012-08-12 22:32:47 UTC
This is a big problem for programmers as the pressing the middle button, which is also ussually the scroll wheel, pastes the current clipboard contents into all apps.  Or at least it does in Quanto, Konqueror and Konsole.

There doesn't seem to be a way in KDE to change this behavior.  The only way I've found to fix it it to run xinput to disable button 2..

Reproducible: Always

Steps to Reproduce:
1. Open a Konsole session
2. Press middle mouse button
3. Notice clipblard contents on command  line
Actual Results:  
Pastes clipboard at cursor position and there is no way to change or disable that action.

Expected Results:  
I expect to be able to change the action taken by any input device.

This is on a Fedora 17 machine, and it has been that way for many previous Fedora version.

However, I do not see this issue on CentOS 6 with KDE 4.3
Comment 1 Thomas Lübking 2012-08-13 07:35:13 UTC
That's a feature of the X11 server and all toolkits (and it's certainly not "a big problem for programmers", please only speak for yourself)

There's no way to turn that off from KWin's side (but actively grabbing the MMB what is effectively to disable it and could be done by a mini tool instead since input mapping is certainly not a WMs task)

optons:
1. get a better mouse that does not perform a MMB click when using the wheel
2. map the MMB to something less easy to invoke using xmodmap
3. file bugs against Qt, gtk+, tcl/tk, athena, wxwidgets, ... to make this handling optional (or developers of apps you're esp. interested in to optionally override this action)

> However, I do not see this issue on CentOS 6 with KDE 4.3
MMB pasting has been on X11 since > 20 years, it's certainly not been anway in a release (at best your MMB was disabled then)
Comment 2 Emmett Culley 2012-08-13 23:42:12 UTC
OK, I"ll speak for myself.  When scrolling though any source code it is very easy to press too hard.  This causes whatever was in the clipboard to be inserted wherever the cursor is at the time you "press too hard".

As you are scrolling you do not notice the inserted text, so the next time you complile or attempt to execute a script it fails.  And it fails in a way that is difficult to debug.  Of cousre once you've figured out that the middle mouse inserts then at least you know where to look when it happens.

OK, having said that, I see that middle button pastes has been in Linux from the beginning.  It was my mistake saying it doesn't happen in CentOS 6 as it was VNC session to that machine that the middle button doesn't paste.  Logging into the machine directly and running X does paste on middle button press.

I don't suppose it'll make a difference to report a bug to Qt or other tool kits, considering it has beem working like this > 20 years.  I guess I am stuck with it as I am pretty certain most will react as you did to my dilike of this "feature".

BTW, I am not sure I understand why handling input events would not be managable by a WM.  Why is that?

BTW, there is a way to set mouse actions in the desktop settings dialog.  Unfortunately changes there have no effect.
Comment 3 Thomas Lübking 2012-08-14 13:04:52 UTC
> I guess I am stuck with it as I am pretty certain most will react as you did to my dilike of this "feature".

If you cannot use the wheel w/o pressing the button it holds there's only one out of two sane things to do.
a) replace the mouse (not even the cheapest one i posses (MS-Tech SM-X35 ~€5) has such problem
b) map the button away (seriously: what would you use it for if you cannot control the invocation?)

> BTW, I am not sure I understand why handling input events would not be managable by a WM.  Why is that?

I did say that it's not a Window Managers task to map your input device events - please don't put words into my keyboard.
The X11 server can do input mapping itself (xmodmap) and if you need more extensive features (general global mouseactions) it's task of kglobalaccel or xbindkeys (iirc supports mapping mouse buttons to key presses)

> BTW, there is a way to set mouse actions in the desktop settings dialog.  Unfortunately changes there have no effect

You mean in the dialog from the desktops RMB menu?
That's desktop settings, ie. holds for the desktop (plasma-desktop, and afaik limited to that containment, but you'd have to ask some plasma developer) only - not sth. global.

There's no global mousebutton support in kglobalaccel so far (besides what kwin does with mouse input on non active windows - handling active windows this way is error prone and will not work under all circumstances)