Bug 486229 - Disabling middle click "Pastes selected text" setting still pastes text
Summary: Disabling middle click "Pastes selected text" setting still pastes text
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 6.0.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-28 04:02 UTC by miranda
Modified: 2025-02-17 09:54 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description miranda 2024-04-28 04:02:10 UTC
SUMMARY
Disabling MMB (middle mouse button) pasting does not disable pasting altogether, and just switches it to pasting the normal clipboard items.

This is undesirable because, in order to properly use MMB scrolling, I need to disable MMB pasting. Especially as certain applications (namely discord) will auto-focus the text box once it detects you've entered any characters.

STEPS TO REPRODUCE
1. Under System Settings > Workspace > General Behavior > uncheck "Middle Click: Pastest selected text"
2. Restart for the setting to apply
3. Copy an item with ctrl-c
4. Middle mouse click in a text field

OBSERVED RESULT
It pastes the copied item

EXPECTED RESULT
The setting does exactly what it says: Disables the feature, rather than replacing it with a slightly similar pasting feature

SOFTWARE/OS VERSIONS
Linux Version: 6.8.7-arch1-2
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Graphics Platform: Wayland

ADDITIONAL INFORMATION
This is probably in the wrong category - feel free to move it.
Comment 1 Titouan Camus 2024-04-28 23:15:45 UTC
Can reproduce.

Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.5.0-28-generic (64-bit)
Graphics Platform: Wayland
Comment 2 Filip 2024-11-13 12:01:23 UTC
This seems to be working correctly on:
Operating System: Arch Linux 
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.6-arch1-1 (64-bit)
Graphics Platform: Wayland

If someone can confirm, we can close this as resolved fixed.
Comment 3 hadyn 2024-11-13 16:37:42 UTC
Can still reproduce.

Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.8.0-48-generic (64-bit)
Graphics Platform: Wayland
Comment 4 Peter 2024-12-26 18:13:10 UTC
Operating System: CachyOS Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.12.6-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7735HS with Radeon Graphics
Memory: 30,6 GiB of RAM
Graphics Processor: AMD Radeon 680M
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ASUS TUF Gaming A15 FA507NV_FA507NV

Can still reproduce.
Comment 5 Nate Graham 2025-01-22 20:41:29 UTC
I'm not able to reproduce this issue on current git master with Qt 6.8.1.
Comment 6 Méven 2025-01-24 09:36:45 UTC
Please specify the application that are concerned, or whether multiple applications are concerned.
Test dolphin and/or kwrite for instance.
Some application don't take this setting into account, firefox notably IIRC.
Comment 7 Méven 2025-01-24 09:37:43 UTC
Need application(s) concerned.

Make sure to have rebooted after changing the setting.
Comment 8 miranda 2025-01-27 07:07:39 UTC
(In reply to Méven from comment #7)
> Need application(s) concerned.
> 
> Make sure to have rebooted after changing the setting.

I mentioned an application in the original description, but I can also reproduce this in firefox and dolphin. In firefox I need to ensure I don't click MMB over any text fields.

I can reproduce this on latest everything arch, QT 6.8.1, KDE 6.2.5 wayland. I've definitely restarted.
Comment 9 Peter 2025-01-27 19:44:38 UTC
(In reply to Méven from comment #6)
> Please specify the application that are concerned, or whether multiple
> applications are concerned.
> Test dolphin and/or kwrite for instance.
> Some application don't take this setting into account, firefox notably IIRC.

I can do this in every application. No matter what.. Firefox, Edge, Dolphin, Slack, Thunderbird.... Like literally all applications.
I've also rebooted after it.
Comment 10 Méven Car 2025-02-01 09:09:19 UTC
(In reply to Peter from comment #9)
> (In reply to Méven from comment #6)
> > Please specify the application that are concerned, or whether multiple
> > applications are concerned.
> > Test dolphin and/or kwrite for instance.
> > Some application don't take this setting into account, firefox notably IIRC.
> 
> I can do this in every application. No matter what.. Firefox, Edge, Dolphin,
> Slack, Thunderbird.... Like literally all applications.
> I've also rebooted after it.

I don't reproduce in kate, kwrite, dolphin as expected.

Applications run through XWayland can't be affected by this setting, probably the case for slack.
Firefox/thunderbird can't work.
Please check you are in Wayland, this can't be disabled in X11.
Comment 11 miranda 2025-02-01 10:08:36 UTC
(In reply to Méven Car from comment #10)
> (In reply to Peter from comment #9)
> > (In reply to Méven from comment #6)
> > > Please specify the application that are concerned, or whether multiple
> > > applications are concerned.
> > > Test dolphin and/or kwrite for instance.
> > > Some application don't take this setting into account, firefox notably IIRC.
> > 
> > I can do this in every application. No matter what.. Firefox, Edge, Dolphin,
> > Slack, Thunderbird.... Like literally all applications.
> > I've also rebooted after it.
> 
> I don't reproduce in kate, kwrite, dolphin as expected.
> 
> Applications run through XWayland can't be affected by this setting,
> probably the case for slack.
> Firefox/thunderbird can't work.
> Please check you are in Wayland, this can't be disabled in X11.

By "Applications run through XWayland can't be affected by this setting", I'm assuming you mean that it will still paste things on MMC in XWayland applications no matter what? If so, that makes sense, and we'll just have to wait for those to be ported off of xorg (or we jump ahead and supply certain arguments to electron apps as is often the case).

That said, giving a more thorough test, it looks like most wayland-native applications avoid MMC pasting most of the time. But there's still corner cases in my experience. Using dolphin as an example, try hovering over the location bar *without* left clicking it, and middle click. In my experience it pastes as an http URI and opens my browser.
Comment 12 Méven Car 2025-02-01 11:23:26 UTC
> Using dolphin as an example, try hovering over the location bar *without* left clicking it, and middle click. In my experience it pastes as an http URI and opens my browser.

That's a particular behavior of the url navigator indeed.
The same will happen in gwenview and the file open/save dialog.

KUrlNavigator::mouseReleaseEvent is responsible for this.
Comment 13 Bug Janitor Service 2025-02-01 11:26:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1808
Comment 14 Méven 2025-02-17 09:54:48 UTC
Git commit ad15481ddb53f6353c489fd0fec26f1c4a1ff89e by Méven Car.
Committed on 17/02/2025 at 09:38.
Pushed by meven into branch 'master'.

kurlnavigator: restrict middle click pasting from selection clipboard

Also better check the url coming from the clipboard, passing the current
working directory along the way.

M  +11   -3    src/filewidgets/kurlnavigator.cpp

https://invent.kde.org/frameworks/kio/-/commit/ad15481ddb53f6353c489fd0fec26f1c4a1ff89e