Bug 425852 - When non-default "middle-click to paste sticky note in panel" behavior somehow gets activated, there is no UI to turn it off
Summary: When non-default "middle-click to paste sticky note in panel" behavior someho...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel (show other bugs)
Version: 5.19.4
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2020-08-27 00:04 UTC by Lukas Ba.
Modified: 2021-11-07 19:24 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24


Attachments
kde mouse settings (32.24 KB, image/png)
2020-08-31 10:42 UTC, Lukas Ba.
Details
screen recording (61.19 KB, application/x-matroska)
2020-09-22 05:42 UTC, Lukas Ba.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Ba. 2020-08-27 00:04:26 UTC
SUMMARY
Add a setting to to disable middle click to paste to increase usability.

STEPS TO REPRODUCE
1. Copy text with the mouse.
2. Select a text box or hover over the text box and click middle mouse button.

OBSERVED RESULT
The contents of the copied text are pasted into the text box.

EXPECTED RESULT
There should be an option in Systemsettings > Mouse.
If enabled, middle clicking on text entry boxes should not paste the content from the clipboard into the text entry box.
Note that the middle mouse button should continue working for other purposes, for example to close a tab.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.19.4
KDE Frameworks Version: 5.73.0
Qt Version: 5.15.0
Kernel Version: 5.8.3-arch1-1
OS Type: 64-bit

ADDITIONAL INFORMATION
I have previously suggested this bug here
https://bugs.kde.org/show_bug.cgi?id=374892
and it was suggested i should file this as a bug against Qt, which would affect all Qt applications
https://bugreports.qt.io/browse/QTBUG-58087#
but as you can see the Qt developers are too lazy to work on this.

Thus i am opening it as a new bug against KDE, with the scope being KDE applications and the KDE desktop.
Comment 1 2wxsy58236r3 2020-08-27 14:18:58 UTC
How about this workaround?
https://unix.stackexchange.com/a/277488

See also:
https://github.com/milaq/XMousePasteBlock
Comment 2 Christoph Feck 2020-08-27 14:31:25 UTC
> Thus i am opening it as a new bug against KDE, with the scope being KDE applications and the KDE desktop.

For the desktop, you can disable MMB pasting using the Mouse Actions settings.

For other applications, see my question at bug 374892 comment 1. If your answer is different, we can investigate, otherwise I can again only refer to upstream.
Comment 3 David Edmundson 2020-08-27 15:19:33 UTC
Marking as needsinfo based on cfeck's question from 3 years ago.

Also don't call developers lazy.
Comment 4 Lukas Ba. 2020-08-31 10:36:12 UTC
(In reply to 2wxsy58236r3 from comment #1)
> How about this workaround?
> https://unix.stackexchange.com/a/277488
> 
> See also:
> https://github.com/milaq/XMousePasteBlock

This particular workaround does not work reliably as it says on the github page.
Comment 5 Lukas Ba. 2020-08-31 10:36:55 UTC
(In reply to David Edmundson from comment #3)
> Marking as needsinfo based on cfeck's question from 3 years ago.
> 
> Also don't call developers lazy.


Can you repeat the question here? I'm not sure what you are referring to.
Comment 6 Lukas Ba. 2020-08-31 10:42:06 UTC
Created attachment 131307 [details]
kde mouse settings
Comment 7 Lukas Ba. 2020-08-31 10:42:36 UTC
(In reply to Christoph Feck from comment #2)
> For the desktop, you can disable MMB pasting using the Mouse Actions
> settings.

No there is no such setting, see the above screenshot.
Comment 8 2wxsy58236r3 2020-08-31 12:07:21 UTC
(In reply to Lukas Ba. from comment #5)
> Can you repeat the question here? I'm not sure what you are referring to.

Please refer to comment 2 above.
Comment 9 Lukas Ba. 2020-08-31 12:09:42 UTC
(In reply to 2wxsy58236r3 from comment #8)
> (In reply to Lukas Ba. from comment #5)
> > Can you repeat the question here? I'm not sure what you are referring to.
> 
> Please refer to comment 2 above.

comment 2:
> Which text entry box? If this is about the QLineEdit or QTextEdit, then this needs to be added in Qt, but Qt tries to avoid user configurable settings.

My answer:
All text entry boxes in all KDE applications and the KDE desktop UI.
Comment 10 Christoph Feck 2020-08-31 17:35:23 UTC
Already reported as bug 374892. No new information was provided.

Please ask in a help forum where to find the Mouse Action settings for the Plasma desktop.
Comment 11 2wxsy58236r3 2020-09-01 01:45:28 UTC
> Please ask in a help forum where to find the Mouse Action settings for the
> Plasma desktop.

Right-click on the desktop (i.e. wallpaper), and at the bottom you will find a setting to configure the desktop, then you will see the Mouse Action Settings.

Is the above correct? Would it be a good idea to expose this configuration menu in the KDE System Settings?
Comment 12 Christoph Feck 2020-09-01 06:15:51 UTC
No, because these settings are per desktop view, so you need to select them from there.
Comment 13 Lukas Ba. 2020-09-01 08:22:24 UTC
(In reply to Christoph Feck from comment #10)
> Already reported as bug 374892. No new information was provided.
> 
> Please ask in a help forum where to find the Mouse Action settings for the
> Plasma desktop.

Oh it seems there was a misunderstanding here, when i said i want to disable the middle mouse to paste on the desktop, i was refering to the whole KDE plasma desktop, including the startmenu, the taskbars, etc., not just the desktop background where you can set a background picture. I apologize for my inconcise wording.
Comment 14 Lukas Ba. 2020-09-01 08:23:58 UTC
Another example, when i middle mouse click on the taskbar, a sticky notes icon appears.
Comment 15 Christoph Feck 2020-09-01 08:58:49 UTC
Doesn't happen here, but reassigning to taskbar component for investigation.
Comment 16 Nate Graham 2020-09-21 17:29:14 UTC
(In reply to Lukas Ba. from comment #14)
> Another example, when i middle mouse click on the taskbar, a sticky notes
> icon appears.
Not a Task Manager issue, but maybe a Panel issue? Regardless, I cannot reproduce. Can you explain exactly what you're doing to get this to happen? A screen recording would help.
Comment 17 Lukas Ba. 2020-09-22 05:42:34 UTC
Created attachment 131854 [details]
screen recording
Comment 18 Nate Graham 2020-09-22 17:12:22 UTC
How bizarre. I cannot reproduce that at all. Middle-clicking on an empty area of the panel or task manager does not paste anything or create a sticky note. I wonder if I'm the weird one for mot being able to make it happen, or if you are affected by some weird bug.
Comment 19 Jacob 2020-09-25 15:15:05 UTC
I think this might be related to Manjaro/Arch, see the following discussion:

https://archived.forum.manjaro.org/t/notifications-on-plasma-desktop-panels/148102/13
Comment 20 Nate Graham 2020-09-25 19:29:02 UTC
So apparently, this behavior happens if your ~/.config/plasma-org.kde.plasma.desktop-appletsrc file has the text:

MidButton;NoModifier=org.kde.paste

Under "[ActionPlugins][1]"

[ActionPlugins][1] corresponds to the panel, while [ActionPlugins][0] corresponds to the desktop.

These defaults are set in desktoppackage/contents/defaults in the plasma-desktop repo. And our default file has the following in it:

[Desktop][ContainmentActions]
RightButton;NoModifier=org.kde.contextmenu
MidButton;NoModifier=org.kde.paste
wheel:Vertical;NoModifier=org.kde.switchdesktop
 
[Panel]
Containment=org.kde.panel
ToolBox=org.kde.paneltoolbox
[Panel][ContainmentActions]
RightButton;NoModifier=org.kde.contextmenu


So by default, we are not turning on this behavior; something else must be doing so. It may be another theme which sets this, and then it gets stuck in your config file forever. That would suck. It would also be a real bug in that it's pretty bad that you can't access a UI to disable this behavior, so once you somehow get stuck with it, it's practically impossible for you to get rid of it.

Either way, until this gets fixed, a workaround is to remove "
MidButton;NoModifier=org.kde.paste" from the "[ActionPlugins][1]" section of the ~/.config/plasma-org.kde.plasma.desktop-appletsrc file.
Comment 21 Lukas Ba. 2020-09-26 10:16:19 UTC
> Either way, until this gets fixed, a workaround is to remove "
MidButton;NoModifier=org.kde.paste" from the "[ActionPlugins][1]" section of the ~/.config/plasma-org.kde.plasma.desktop-appletsrc file.

That worked, maybe rename [ActionPlugins][1] to [ActionPlugins][Taskbar] ?
Comment 22 Nicolas Fella 2021-01-28 13:17:48 UTC
https://invent.kde.org/plasma/plasma-desktop/-/commit/f596c2cb6fa79ad311149ac20d142380d739c15f indicates that at some point middle-click on the panel was the default. if the configuration is from before that commit that could explains why it is still enabled today
Comment 23 Bug Janitor Service 2021-10-24 22:01:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/640
Comment 24 Nate Graham 2021-11-04 02:40:33 UTC
Git commit 423c1b69909af11a06f58505ccff6d563a6d8006 by Nate Graham.
Committed on 04/11/2021 at 02:39.
Pushed by ngraham into branch 'master'.

Remove middle-click-paste actions from panel config files

In the past, panels were configured to add a note on middle-click. This was changed
several years ago in
https://invent.kde.org/plasma/plasma-desktop/-/commit/f596c2cb6fa79ad311149ac20d142380d739c15f,
but the "MiddleButton;NoModifier=org.kde.paste" action was never removed from users'
config files, so some people still got this undesirable behavior with no GUI method
to change it.

This commit adds an update script that removes the config entry that enables this
behavior for all of the user's panels.
FIXED-IN: 5.24

A  +26   -0    desktoppackage/contents/updates/no_middle_click_paste_on_panels.js

https://invent.kde.org/plasma/plasma-desktop/commit/423c1b69909af11a06f58505ccff6d563a6d8006
Comment 25 Nate Graham 2021-11-04 02:42:22 UTC
Hopefully that should do it, but I am also looking into disabling or removing that code that reads this setting in the first place, so that even if youe config file gets messed up again somehow, middle-click-paste-on-a-panel-to-create-a-sticky-note won't come back again.
Comment 26 Lukas Ba. 2021-11-07 17:24:07 UTC
My original bugreport is more far-reaching and not resolved, as it was about middle-click to paste in general, not just the specific effect on the taskbar.
Comment 27 Nate Graham 2021-11-07 19:24:31 UTC
Hmm, since this bug report wound up being used for something else (sorry about that), let's track your original request with Bug 441668.