-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Scrolling is too fast on touchpads #99
Comments
Is there a difference between the resolution of your client and the resolution of the remote screen? |
I'm sorry @ehfd , I didn't get it. What do you mean by client vs remote screen resolution? |
Okay. The screen resolution is the same. It's another bug. |
Potentially solvable in tandem to #98 |
From what I observed:
So I'm thinking as touchpad scroll event are thrice than mouse scroll, thus making the scrolling fast. Please correct me if I'm wrong. |
You're right. We will fix that. However, we are still unsure why the Mac's touchpad is hypersensitive in whatever browser you are using. We would need more information on your environment. |
Related to #76. |
Here's my environment information:
I remember trying to access the remote desktop few weeks back via windows laptop as well using brave browser and had encountered same scrolling sensitive issue with touchpad. Please let me know if more information is needed. Thank you! |
@ehfd I'm not an expert in python or js but I'd like to work on this issue. Could you guide me please. |
I also reproduce in Windows. |
Hello @ehfd, any update on this issue?
I can see a difference upon scrolling the system applications like scrolling in terminal, but when it comes to browsers in remote client, it's still same as before (scrolling is still hypersensitive). Also one small doubt, may I know why the icons are too small when the remote and client resolution is same. |
Thanks for your investigation. Greatly appreciate it. Looks like this needs a solution from the JavaScript side. We will investigate the issue and come back to you. |
Thanks to you for replying.
In the above sentence are you referring to the scrolling issue or screen resolution? |
For the resolution issue... A larger DPI should be used when launching the X server for now. Hard to change the DPI on the fly. Also, I believe Xfce is not that good at HiDPI. |
I have moved the DPI issue to #110. |
Hi @ehfd. I actually got some working solution to this hypersensitiveness of scroll for touchpad. Let me know what you think of this So the problem here as stated before is, the number of events that get triggered for scroll on touchpad is much higher in number compared to typical mouse wheel. This is due to the effect of
To mitigate this I tried setting a When looked into neko, I saw the same technique of limiting number of events, but instead of just sending an event with button_mask just to scroll one notch up/down, they're sending a magnitude of value. _mouseWheel(event) {
var mtype = (document.pointerLockElement ? "m2" : "m");
var button = 3;
if (event.deltaY < 0) {
button = 4;
}
// truncate the floating point decimal numbers and get an absolute value
var deltaY = Math.abs(Math.trunc(event.deltaY));
// this._scrollMagnitue=10
var magnitude = Math.min(deltaY, this._scrollMagnitude);
var mask = 1 << button;
var toks;
// Simulate button press and release.
for (var i = 0; i < 2; i++) {
if (i === 0)
this.buttonMask |= mask;
else
this.buttonMask &= ~mask;
toks = [
mtype,
this.x,
this.y,
this.buttonMask,
magnitude
];
this.send(toks.join(","));
}
event.preventDefault();
} And on the server side I'd modified the part to support sending of multiple scroll events to X server based on the received magnitude. It's working quite reasonably compared to before. But this fails to provide smooth scrolling in devices other than Mac. This is because the delta values differ from device to device. In mac the least delta value is 1 and in other devices it could be 4 or 5, producing different levels of granularity based on the hardware of the device and OS. This kind of makes the scrolling at high pace than user intended pace on non-mac devices. So to mitigate this I tried to normalise the values by taking the least delta as a scale factor and scale the subsequent values with this factor. This resolved the issue of touchpad on other devices. But, fails for mouse wheel events of non-mac devices by producing much slower scroll effect. This is due to the delta values being constant in most of the devices (except for Mac's connected mice) and exists in the range of 100 to 130. By applying the normalising technique, the delta values would always end up at a constant value To resolve this we've two options:
I've chosen the second approach (as it's easier to manipulate things at hand than to generate non existing ones) to remove the threshold on mouse wheel events. This solved the problem for touchpads and mice both in mac and non-mac devices. Kindly let me know your thoughts on this approach. I've the changes ready and can make the PR as soon as possible. |
@PMohanJ Lovely! |
I've pushed the image to docker hub. You can test it by spinning up a container:
Note: If you shift from touchpad to mouse, then the transition won't be smooth for 3-4 scroll notches. This is due to the fact that the scale factor needs to be adjusted. Also the touchpad scrolling is still bit sensitive (it wouldn't be as same as our physical devices). This is primarily due to the fact that browsers still abstract the actual input event that occur that OS level, so we don't have raw inputs to manipulate them. And on the servers side the package
So on the server side we don't really have much control. |
@PMohanJ Do you have the PR? |
And perhaps investigating #102 in conjunction would help with a lot of hassle. Would it be possible? |
I'll open a PR in few minutes. |
I've deployed the example docker file provided by the repo, locally. But the scroll speed is too fast when using touchpad of the mac(I'm using mac 2020 model), but if I try with physical mouse the scrolling speed is fine.
Is something need to be done from gst-web/frontend or selkies_gstreamerhttps://github.com/selkies-project/selkies-gstreamer/tree/main/src/selkies_gstreamer, or any configuration is required after desktop has started?
Any kind of help is appreciated.
The text was updated successfully, but these errors were encountered: