Vencord icon indicating copy to clipboard operation
Vencord copied to clipboard

feat(plugin): LimitMiddleClickPaste

Open alchzh opened this issue 2 years ago • 6 comments

Useful plugin for Linux users who use middle-click autoscroll to prevent Discord's default behavior of redirecting all paste events anywhere to the chat box temporarily after middle clicking.

Related: https://github.com/Vencord/Vesktop/pull/239

Tested on Vesktop. TODO: test in browsers

alchzh avatar Dec 01 '23 17:12 alchzh

@Nullmatic moving conversation from the other thread here. I fixed the timeout so rapid double clicks won't trigger pastes, can you test it?

~~Some pastes that don't get a target will still get passed through ComponentDispatch. This is pretty uncommon though (I mostly got this when middle clicking on a popout menu, which you can't scroll on anyway...).~~

~~Another approach that might work better is blocking input to the text input itself instead of trying to block paste events.~~

I added the event listeners to body as well to block those getting through. The plugin should be robust now but it still doesn't work 100% of the time for me. Oh well, I think it's good enough.

alchzh avatar Dec 02 '23 05:12 alchzh

What are the chances of this getting merged? I find this extremely useful for privacy reasons.

crispywaffles666 avatar Mar 02 '24 20:03 crispywaffles666

would also like this merged, very annoying when trying to autoscroll but things just end up getting pasted into the textbox

velamyGH avatar Jun 14 '24 22:06 velamyGH

I gave this a quick shot like you requested, I like the concept of this plugin a lot! However, setting the plugin to paste "Only when clicking on a text box" still pastes when I'm autoscrolling the chat log itself, even with the text entry field unfocused. Is this intentional?

The time delay on the other hand works as I expected it to. Autoscrolling for any amount of time less than 1s with the delay set to 1s does indeed prevent it from pasting.

Cheers for making this.

nixRidge avatar Aug 18 '24 04:08 nixRidge

Works great for me, I also set the --enable-blink-features=MiddleClickAutoscroll flag.

hollowstrawberry avatar Aug 24 '24 18:08 hollowstrawberry

Seems it still pastes when releasing middle click if you hold it longer than the delay

hollowstrawberry avatar Aug 24 '24 20:08 hollowstrawberry

this plugin isn't needed. users can just disable this in their entire system:

  • X11 (and apps running in XWayland): XMousePasteBlock
  • Wayland: your DE should have an option for this (e.g. Gnome tweaks)

Vendicated avatar Sep 04 '25 00:09 Vendicated