SUMMARY Recently middle-click pasting got implemented for the Wayland platform (Bug 422426). However, this feature could be regarded as an annoyance due to the risk of inadvertent pasting. Especially users coming from different operating systems are not used to this behaviour and dislike it. Moreover, this feature could potentially be a privacy risk, since marked texts are automatically added to a clipboard, altough they might contain sensitive information. Additionally, it might conflict different uses of the middle mouse button. There currently appears to be no way to disable middle-click paste on both Plasma Wayland and X11. It would be nice if an option could be added to the System Settings mouse configuration page (or alternatively to the clipboard settings) to disable middle-click paste at least for the Wayland platform (and if technically possible, also for X11). STEPS TO REPRODUCE 1. Mark an arbitrary text in a Wayland (or X11) session 2. Activate a text input widget 3. Press the middle mouse button OBSERVED RESULT The marked text will be pasted into the widget. EXPECTED RESULT There should be an option to disable middle-click pasting, at least for Wayland (and for X11 if feasible). SOFTWARE/OS VERSIONS Operating System: KDE neon 5.22 KDE Plasma Version: 5.22.4 KDE Frameworks Version: 5.85.0 Qt Version: 5.15.3 Kernel Version: 5.11.0-27-generic (64-bit) Graphics Platform: Wayland ADDITIONAL INFORMATION - The idea for this report started on Nate Graham's blog (https://pointieststick.com/2021/08/20/this-week-in-kde-some-cool-new-stuff/#comment-23401). - Middle-click pasting is optional in GNOME (according to https://linuxconfig.org/how-to-disable-middle-mouse-button-click-paste-on-ubuntu-20-04-focal-fossa-linux) - Not sure whether I chose the right component. Feel free to move the issue if you know a better place.
l. 6: * and might dislike it l. 8/9: * conflict with Pity one can't edit posts in Bugzilla.
Should be optional on X11 too.
If someone can give me some pointers, I'd be interested in working on an MR. I've skimmed through https://invent.kde.org/plasma/kwayland-server/-/merge_requests/15/diffs?commit_id=c82b0db029f35e0c853f7170cf03c81d09cd25c7 but given that I have zero experience with KDE's code base it is not obvious where to add the conditional behavior, or where/how to pull in configuration. And I don't have the time to invest in digging through and understanding the project.
*** Bug 392488 has been marked as a duplicate of this bug. ***
*** Bug 389710 has been marked as a duplicate of this bug. ***
*** Bug 443855 has been marked as a duplicate of this bug. ***
*** Bug 452364 has been marked as a duplicate of this bug. ***
Is there even a way to disable this behavior on Plasma Wayland? This is annoying when using the middle click to move the canvas around on Figma, for example, but pasting whatever is on clipboard after releasing the button
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2487
(In reply to Bug Janitor Service from comment #9) > A possibly relevant merge request was started @ > https://invent.kde.org/plasma/kwin/-/merge_requests/2487 If I understood this right, once the PR is merged, we can add the lines below to `~/.config/kwinrc` to disable middle-click paste on Wayland? ``` [Wayland] EnablePrimarySelection=false ```
(In reply to geisserml from comment #10) > (In reply to Bug Janitor Service from comment #9) > > A possibly relevant merge request was started @ > > https://invent.kde.org/plasma/kwin/-/merge_requests/2487 > If I understood this right, once the PR is merged, we can add the lines > below to `~/.config/kwinrc` to disable middle-click paste on Wayland? > ``` > [Wayland] > EnablePrimarySelection=false > ``` Yes you got correct. But this needs to be reviewed, please be patient. In any case I am on it, they are chances we can have it for Plasma 5.25 but more assuredly 5.26.
> But this needs to be reviewed, please be patient. Sure, take your time :)
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/970
I was really hoping for a setting to disable middle-click altogether. Even with paste disabled, middle click still has weird outcomes, like middle clicking on a firefox tab closes that tab. Currently you can set the touchpad to left or right-handed (which swaps the left/right buttons while keeping middle click in place), or you can set right click to "Press bottom-right corner" (which, of course, is actually the bottom left corner when in left handed mode) or "Press anywhere with two fingers"). The latter disables middle click on the touchpad, which is cool, but it also makes it so the mouse moves around when you rest your thumb on the bottom of the touchpad. In conclusion, disabling middle click paste is cool, but where is the option to disable middle click completely (and choose how you want the middle area mapped)? I would prefer the middle area to be a left click, with only the corner used for right click.
Remapping/disabling hardware or virtual software buttons is kind of out of scope, but you can do it. I used to re-map Libinput's virtual buttons using xinput to do the same thing IIRC. FWIW if leaving your thumb on the bottom of your touchpad moves the cursor or starts a two-finger scroll, that's a bug in Libinput and you should report it at https://gitlab.freedesktop.org/libinput/libinput/-/issues/. It's supposed to filter out a lazy thumb on the touchpad, and this works for me with my touchpad.
(In reply to ryantg from comment #14) > I was really hoping for a setting to disable middle-click altogether. Please open a different, this is not the same issue. > Even with paste disabled, middle click still has weird outcomes, like middle > clicking on a firefox tab closes that tab. This is common to most applications with tabs including dolphin. > > In conclusion, disabling middle click paste is cool, but where is the option > to disable middle click completely (and choose how you want the middle area > mapped)? I would prefer the middle area to be a left click, with only the > corner used for right click.
Git commit 4082fdf96092005106b5895e238e94a614035b0b by Méven Car. Committed on 19/06/2022 at 05:49. Pushed by meven into branch 'master'. WaylandServer: Add a setting to disable PrimarySelection M +3 -0 src/kwin.kcfg M +1 -4 src/main.cpp M +8 -4 src/main_wayland.cpp M +14 -1 src/wayland_server.cpp M +3 -0 src/wayland_server.h https://invent.kde.org/plasma/kwin/commit/4082fdf96092005106b5895e238e94a614035b0b
Git commit 9577fd5c762ea14382961fd359b3365bcec512a9 by Méven Car. Committed on 19/06/2022 at 05:43. Pushed by meven into branch 'master'. KCM Behavior: in Wayland allow to disable primary selection Aka middle click pasting M +0 -0 kcms/activities/kcm_activities.desktop M +21 -0 kcms/workspaceoptions/package/contents/ui/main.qml M +17 -6 kcms/workspaceoptions/workspaceoptions.cpp M +6 -0 kcms/workspaceoptions/workspaceoptions_kwinsettings.kcfg https://invent.kde.org/plasma/plasma-desktop/commit/9577fd5c762ea14382961fd359b3365bcec512a9
Thanks!
It's fixed only in wayland, not in x11.
I think it was stated in comment [1] that it is not nicely possible to implement this setting with X11. [1] https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/970#note_462083
What is currently working for me seamlessly in X11 is `while true; do xsel -fin </dev/null; done` (source https://unix.stackexchange.com/a/501445) in a user service. Not sure if that could be incorporated in a patch somehow. Seems robust and with no performance issues.
(In reply to geisserml from comment #21) > I think it was stated in comment [1] that it is not nicely possible to > implement this setting with X11. > > [1] > https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/970#note_462083 > I don't want to devote time to implement this in X11, it is going to take me far longer than what it took for the Wayland case. Users have already available workarounds. The work arounds are not perfect. E.g. obsidian users currently have no solution https://forum.obsidian.md/t/linux-middle-click-paste-is-problematic-and-needs-to-be-automatically-disabled/34717/12 The workaround I use does not work here.
(In reply to soredake from comment #20) > It's fixed only in wayland, not in x11. For me still doesn't work even in wayland (even after enabling the setting)
(In reply to matteodinoia02 from comment #24) > (In reply to soredake from comment #20) > > It's fixed only in wayland, not in x11. > > For me still doesn't work even in wayland (even after enabling the setting) It's functional for most applications for me in Wayland. I found some applications like Firefox or the Jetbrains suite have a built-in config/key bind for this that aren't affected by the KDE setting. For Firefox (as an example) the about:config option `middlemouse.paste` needs to be set to false manually.
(In reply to Mel from comment #25) > (In reply to matteodinoia02 from comment #24) > > (In reply to soredake from comment #20) > > > It's fixed only in wayland, not in x11. > > > > For me still doesn't work even in wayland (even after enabling the setting) > > It's functional for most applications for me in Wayland. I found some > applications like Firefox or the Jetbrains suite have a built-in config/key > bind for this that aren't affected by the KDE setting. > > For Firefox (as an example) the about:config option `middlemouse.paste` > needs to be set to false manually. I tried again and now is working (nothing is different than before). I already had tried rebooting several times, so i really don't know why.
(In reply to Mel from comment #25) > (In reply to matteodinoia02 from comment #24) > > (In reply to soredake from comment #20) > > > It's fixed only in wayland, not in x11. > > > > For me still doesn't work even in wayland (even after enabling the setting) > > It's functional for most applications for me in Wayland. I found some > applications like Firefox or the Jetbrains suite have a built-in config/key > bind for this that aren't affected by the KDE setting. > Are those applications run using XWayland ?
(In reply to Méven from comment #27) > (In reply to Mel from comment #25) > > (In reply to matteodinoia02 from comment #24) > > > (In reply to soredake from comment #20) > > > > It's fixed only in wayland, not in x11. > > > > > > For me still doesn't work even in wayland (even after enabling the setting) > > > > It's functional for most applications for me in Wayland. I found some > > applications like Firefox or the Jetbrains suite have a built-in config/key > > bind for this that aren't affected by the KDE setting. > > > > Are those applications run using XWayland ? Dunno, i did try on various kde applications (like dolphin, setting, konsole...) and it still pasted but after some day it just stopped being a problem. No clue why (i did already reboot various time but gained nothing). So I still don't know what was the problem.