gujjwal00 / avnc

VNC Client for Android
GNU General Public License v3.0
600 stars 57 forks source link

Feature Request: Lock viewport while zoomed in #221

Closed RadarNyan closed 3 months ago

RadarNyan commented 5 months ago

Currently, the viewport would follow the cursor (and keeping it in the center while possible) when zoomed in. This works fine and is the standard behavior for most screen magnifiers, but it would be nice to have an option to lock the viewport in place.

This would be very helpful when working on a small window, so I can move the cursor without having the whole screen move around - which is kind of dizzy-inducing when the zoom level is high.

gujjwal00 commented 5 months ago

That was the original behaviour, but was changed in #58 . In addition to what's described in that issue, one thing I found was that the pointer can get "lost" when zoom level is high.

RadarNyan commented 5 months ago

Then how about adding an option to scroll the viewport only when the cursor reaches the edges? That way, there's no danger of losing the pointer while also preventing the viewport from moving around too much while the zoom level is high.

gujjwal00 commented 3 months ago

Sorry, I don't want to add another option for this. Please use the Touchscreen gesture style when you need to keep the viewport fixed.

RadarNyan commented 3 months ago

Well, I understand you don't want to add an option that is unlikely to be widely used. Sadly, using the "Touchscreen" mode isn't a viable workaround for me, as I'm mainly using avnc on my phone, and my finger isn't what I'd call a precise input device.

I managed to create a custom build with a quick and dirty workaround: https://github.com/RadarNyan/avnc/commit/fa047fb515e069c67f1dbdd203045deb9d82c8b4?diff=unified&w=1

Basically, I used the zoom lock flag to determine whether to skip the center screen code.

Of course, this will create the problem that the cursor can go outside the viewport, but I still have the ability to scroll the viewport with two fingers, and I can always turn off zoom lock and regain the center screen feature.

gujjwal00 commented 3 months ago

You can also look at the original commit implementing this behaviour: https://github.com/gujjwal00/avnc/commit/c6b28ea6f168870acb4d89d3b9ad631d5cedfb4e