Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement MiddleClickAutoScroll setting (#171) #239

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Nullmatic
Copy link

Resolves #171

@D3SOX
Copy link
Contributor

D3SOX commented Nov 16, 2023

Works fine for me on KDE Plasma (X11) but the text in the clipboard is pasted anyway. Not sure if this can be prevented by Vesktop though.

Peek.2023-11-16.13-55.mp4

@Nullmatic
Copy link
Author

Nullmatic commented Nov 27, 2023

I left it out of the description since I thought it would be too long, but I would like to know if I should also put that it still pastes text. Something like: "Enables middle-click scrolling. Text will still be pasted though."

@alchzh
Copy link

alchzh commented Dec 1, 2023

@D3SOX @Nullmatic can you test the plugin in Vendicated/Vencord#2024 to test if it gets rid of the unwanted pastes?

@Nullmatic
Copy link
Author

@D3SOX @Nullmatic can you test the plugin in Vendicated/Vencord#2024 to test if it gets rid of the unwanted pastes?

Sorry for the late reply. The plugin did limit the number of pastes when enabled on my side at least. It doesn't stop them but makes it harder for it to happen every click so that is a plus.

The funny thing I also found when testing is that when enabling native Wayland capabilities using the flag: --ozone-platform-hint=auto and having middle click scroll enabled, after the first scroll it crashes the client.

@alchzh
Copy link

alchzh commented Dec 2, 2023

Sorry for the late reply. The plugin did limit the number of pastes when enabled on my side at least. It doesn't stop them but makes it harder for it to happen every click so that is a plus.

Can you try increasing the reenable delay slider in the plug-in settings? Also check the other setting for when to allow pastes- the text input is selected until you click on another element and by default I still allow pastes when text boxes are selected.

The funny thing I also found when testing is that when enabling native Wayland capabilities using the flag: --ozone-platform-hint=auto and having middle click scroll enabled, after the first scroll it crashes the client.

Should be reported to electron?

@Nullmatic
Copy link
Author

Can you try increasing the reenable delay slider in the plug-in settings? Also check the other setting for when to allow pastes- the text input is selected until you click on another element and by default I still allow pastes when text boxes are selected.

For me, when I set the settings to "Whenever a textbox is active" and set reenable delay to 1000ms usually after the first middle-click, the second one will paste into the chat box. The same happens when setting to "Only when clicking on a textbox." I might just be clicking a bit fast for it to register perhaps? As said before though, it works and isn't instantaneous.

Should be reported to electron?

Does this only affect electron applications or is this more of a problem with the blink engine?

@alchzh
Copy link

alchzh commented Dec 2, 2023

Ah! I forgot to clear the reenable timeout function after getting another click. I'll fix that

@D3SOX
Copy link
Contributor

D3SOX commented Dec 2, 2023

When this requires a Vencord plugin anyway, I don't see the need for this anymore as Vendicated/Vencord#2003 exists which does it just as a plugin. Or better yet add the flag via plugin so it only requires the plugin. Alternatively I think what you're doing in the plugin right now could be moved to here under src/renderer/patches

@alchzh
Copy link

alchzh commented Dec 2, 2023

When this requires a Vencord plugin anyway, I don't see the need for this anymore as Vendicated/Vencord#2003 exists which does it just as a plugin. Or better yet add the flag via plugin so it only requires the plugin. Alternatively I think what you're doing in the plugin right now could be moved to here under src/renderer/patches

Personally, I think the approach of both the desktop setting and plugin is better than the manual feature because

  • the desktop setting is much less complicated than the the manual mouse monitoring and scrolling, and works as the user would expect it from other apps (auto scroll behavior varies from platform to platform and app to app)
  • the plug-in is also useful for browser extension users.

@D3SOX
Copy link
Contributor

D3SOX commented Dec 2, 2023

I can definitely see your point here now. I haven't ever tried Vencord in a standalone Chromium browser with that flag.

@alchzh
Copy link

alchzh commented Dec 2, 2023

The funny thing I also found when testing is that when enabling native Wayland capabilities using the flag: --ozone-platform-hint=auto and having middle click scroll enabled, after the first scroll it crashes the client.

I was unable to replicate this on Plasma 5, middle click scroll works as normal when launched with native Wayland.

@Nullmatic Nullmatic marked this pull request as draft January 18, 2024 02:43
@nixRidge
Copy link

nixRidge commented Mar 11, 2024

Still works well on Plasma 6, running both as an xwayland and a wayland client, and no crashes.
Though it does attempt to paste whatever is on my clipboard when I autoscroll. Is it possible to prevent that? I know BetterDiscord as a modification to the desktop client disables middle-click pasting, but I have no idea if that's possible in Vesktop which I understand is not the desktop client.

@Haxorzz
Copy link

Haxorzz commented Mar 11, 2024

Still works well on Plasma 6, running both as an xwayland and a wayland client, and no crashes. Though it does attempt to paste whatever is on my clipboard when I autoscroll. Is it possible to prevent that? I know BetterDiscord as a modification to the desktop client disables middle-click pasting, but I have no idea if that's possible in Vesktop which I understand is not the desktop client.

There might be an electron blink launch flag to disable middle click pasting, or you can just disable it system-wide (or best effort) in plasma by going to settings -> General behavior (under workspace0 -> Middle click: Paste selected text (untick)

@nixRidge
Copy link

(or best effort) in plasma by going to settings -> General behavior (under workspace0 -> Middle click: Paste selected text

Thanks, I did consider doing that but I actually quite like the feature, just anywhere but in an instant messenger, lol =)
I'll take a look around and see if it could be added as a separate option, or perhaps just be disabled at the same time if autoscrolling is enabled.

@happenslol
Copy link

Is this still being considered? This is a very important feature for me.

I'd also note that middle-click pasting is still happening even though I have disabled it at OS-level. Webcord and all my other applications respect this, Vesktop is the only one still pasting.

@Haxorzz
Copy link

Haxorzz commented Jun 18, 2024

Is this still being considered? This is a very important feature for me.

I'd also note that middle-click pasting is still happening even though I have disabled it at OS-level. Webcord and all my other applications respect this, Vesktop is the only one still pasting.

for now you can add --enable-blink-features=MiddleClickAutoscroll in the launch options, and it works

@happenslol
Copy link

for now you can add --enable-blink-features=MiddleClickAutoscroll in the launch options, and it works

For anyone coming across this - this works and also disables middle click pasting. Thanks!

@nixRidge
Copy link

For anyone coming across this - this works and also disables middle click pasting. Thanks!

Which desktop environment do you use? On Plasma, it still pastes when I'm using autoscrolling, but the launch option does work.

@Haxorzz
Copy link

Haxorzz commented Jun 19, 2024

For anyone coming across this - this works and also disables middle click pasting. Thanks!

Which desktop environment do you use? On Plasma, it still pastes when I'm using autoscrolling, but the launch option does work.

on plasma you need to disable middle-click paste in settings > under workspace - general behavior > Middle click: Pastes selected text
do note this is wayland only

@nixRidge
Copy link

Ah ok thanks @Haxorzz, same as our previous correspondence in this thread then =) Wonder why this is only an issue in Vesktop and not regular Discord client with an autoscroll plugin.

@happenslol
Copy link

For the record, I'm on hyprland and I have the middle click paste option disabled. Even with the option on hyprland disabled though, it would still paste. After using the flag suggested above, it now no longer pastes, but only autoscrolls.

Webcord and the regular desktop client do not have this behavior (they autoscroll and don't paste by default).

@alchzh
Copy link

alchzh commented Aug 16, 2024

@nixRidge @Haxorzz @happenslol can you try my plugin in Vendicated/Vencord#2024 ? not sure how it interacts with that launch flag

@nixRidge
Copy link

@nixRidge can you try my plugin in Vendicated/Vencord#2024 ? not sure how it interacts with that launch flag

@alchzh Yes, I'd love to, but sorry to ask how do I load this plugin in Vesktop? I understand that Vencord needs to be built with the plugin, but I wasn't able to figure out where to put the relevant index.ts in order to build it with the Vesktop application.

@alchzh
Copy link

alchzh commented Aug 17, 2024

@alchzh Yes, I'd love to, but sorry to ask how do I load this plugin in Vesktop? I understand that Vencord needs to be built with the plugin, but I wasn't able to figure out where to put the relevant index.ts in order to build it with the Vesktop application.

Build Vencord with the plugin then go to Vesktop Settings in your app and change it to the Vencord/dist directory you just built in

image

@nixRidge
Copy link

Build Vencord with the plugin then go to Vesktop Settings in your app and change it to the Vencord/dist directory you just built in

Oh, doy! Thanks so much, I'll give it a shot sometime tonight.

@shrublet
Copy link

Is this still being considered? This is a very important feature for me.
I'd also note that middle-click pasting is still happening even though I have disabled it at OS-level. Webcord and all my other applications respect this, Vesktop is the only one still pasting.

for now you can add --enable-blink-features=MiddleClickAutoscroll in the launch options, and it works

on gnome, i'm still having it pasting even with middle click paste disabled via dconf settings and and this flag enabled. have been scouring around for a chromium solution to disabling middle click paste, as i'm getting mixed info on whether on wayland middle click paste is implemented by the system or the apps, with many saying it's the apps implementing the feature regardless of system settings (note firefox has a flag to disable this). hope a plugin/solution can be looked at again.

@Haxorzz
Copy link

Haxorzz commented Jan 23, 2025

Is this still being considered? This is a very important feature for me.
I'd also note that middle-click pasting is still happening even though I have disabled it at OS-level. Webcord and all my other applications respect this, Vesktop is the only one still pasting.

for now you can add --enable-blink-features=MiddleClickAutoscroll in the launch options, and it works

on gnome, i'm still having it pasting even with middle click paste disabled via dconf settings and and this flag enabled. have been scouring around for a chromium solution to disabling middle click paste, as i'm getting mixed info on whether on wayland middle click paste is implemented by the system or the apps, with many saying it's the apps implementing the feature regardless of system settings (note firefox has a flag to disable this). hope a plugin/solution can be looked at again.

It's both. There's a system level toggle on Wayland that won't force this behavior like x11 does (which seems broken on gnome, surprise surprise). And there's per-app implementation of autoscroll (and middle click paste), so any app can technically implement it or not implement auto scrolling if they wish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux: Option to enable MiddleClickAutoscroll
8 participants