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

Zooming with Thinkpad TrackPoint gets "stuck" at 100% #68

Closed
lord-ne opened this issue Jul 7, 2022 · 11 comments
Closed

Zooming with Thinkpad TrackPoint gets "stuck" at 100% #68

lord-ne opened this issue Jul 7, 2022 · 11 comments
Labels
question Further information is requested

Comments

@lord-ne
Copy link

lord-ne commented Jul 7, 2022

If an image is initially zoomed to less than 100% (such as if it is set to open in windowed mode), scrolling with the mouse wheel will get you to 100% zoom. Even if I stop scrolling and then start scrolling again, it still won't go past 100% zoom. Only after clicking and dragging a bunch does it "randomly" decide to go past 100% when I scroll more.

Here's a video showing what I mean. I have a program showing my keypresses in the bottom right for demonstration proposes; when the number is increasing, that means I am currently scrolling the mouse wheel up/down.

2022-07-07.11-18-51.mp4

You can see that it scrolls in normally until it hits 100%, but won't scroll further. I stop scrolling and start again, but it still won't scroll further. At around 15 seconds I try scrolling down to zoom out, but that also doesn't work. I try clicking and dragging then scrolling again, which doesn't work, but then I click and drag again and then it works.

@sylikc
Copy link
Owner

sylikc commented Feb 16, 2023

@lord-ne are you still having problems with this? I haven't ever been able to reproduce this problem.

What type of mouse are you using and is there custom software that interprets the window before doing something? Like it's actually trying to "scroll" the window?

@sylikc sylikc added the question Further information is requested label Feb 16, 2023
@lord-ne
Copy link
Author

lord-ne commented Feb 16, 2023

I was using the middle button on a Thinkpad. Is you hold down that button and move the red mouse, it acts as trying to scroll the window up or down.
image


I just retested with a normal USB mouse. When I scroll the mouse wheel, it will still briefly get stuck at 100% as long as I continue scrolling without taking my finger off of the mouse wheel. However it gets "unstuck" as soon as I even briefly lift my finger off the mouse wheel. Since it becomes "unstuck" if you even very briefly stop moving the scroll wheel, it's not very noticeable in this case.

2023-02-16.08-24-16.mp4

@sylikc
Copy link
Owner

sylikc commented Feb 16, 2023

Unfortunately that'll be a bit harder to debug...

I've owned a thinkpad before, and those software emulated mouse functions can interact strangely with certain apps. The mouse filter drivers that are installed affect USB mice as well iirc. Anyhow, I wouldn't really know how to even look into it.

Thanks for posting the videos though to show the behavior. It definitely looks jumpy from your videos but I can't reproduce it at all.

So what the middle scroll thingie on the Thinkpad is probably doing is that... it's polling JPEGView and seeing if there's anything on the window controls to scroll. It figures out there isn't anything (no scrollbars anywhere in the client area) and so it probably is falling back to some type of scroll emulation. That stuff is hit and miss on non-standard windows like image viewers. I used to have all types of problems scrolling through specialized applications, but that was a long time ago lol.

@sylikc sylikc changed the title Zooming with mouse wheel gets "stuck" at 100% Zooming with Thinkpad TrackPoint gets "stuck" at 100% Feb 16, 2023
@lord-ne
Copy link
Author

lord-ne commented Feb 17, 2023

Fair enough. Although I think the fact that I was able to get something similar to happen at 100% with a regular mousewheel (it's just less obvious) means that there's at least something more going on.

@lord-ne
Copy link
Author

lord-ne commented Feb 17, 2023

I was also able to replicate the issue with an AutoHotkey script (v2), if you're familiar with that.

#Requires AutoHotkey v2
#SingleInstance force
KeyHistory 0

; Clicking the wheel a bunch of times gets stuck
1:: {
    Send("{WheelUp 100}")
}

; Adding a delay between the clicks makes it not get stuck
2:: {
    Send("{WheelUp 100}")
    Sleep(1000)
    Send("{WheelUp 100}")
}

; But if the delay is too short, it still gets stuck
3:: {
    Send("{WheelUp 100}")
    Sleep(100)
    Send("{WheelUp 100}")
}

@sylikc
Copy link
Owner

sylikc commented Feb 17, 2023

I looked at the code, the hard stop at 100% is intentional

if ((dOldZoom - 1.0)*(m_dZoom - 1.0) <= 0 && m_bInZooming && !m_bZoomMode) {
// make a stop at 100 %
m_dZoom = 1.0;

@sylikc
Copy link
Owner

sylikc commented Feb 17, 2023

not all mice have fine control, so the intention is that it will always make a stop at 100% regardless of what scroll factor your mouse causes

@sylikc
Copy link
Owner

sylikc commented Feb 17, 2023

You can also test this behavior with the + and - keys... it will stop at 100%

@lord-ne
Copy link
Author

lord-ne commented Feb 17, 2023

Thank you for the help. I commented out the three lines you referenced and compiled, and it gives me the behavior I want. Interestingly, there is actually still a small stop at 100%, but only if you're zooming in very slowly (which is a good thing in my opinion, it feels like a "snap to 100%" feature).

Do you think it would be worth adding an option to disable the hard stop, for people who have various non-standard scrolling setups?

@sylikc sylikc closed this as completed in 6b99673 Feb 18, 2023
@sylikc
Copy link
Owner

sylikc commented Feb 18, 2023

It's an interesting idea... so I put it in. 100 is default, 0 to disable. Some people might want to pause at a different percentage... so I made it user changeable.

@RndUsr123
Copy link

Any chance the preference can be changed to disable the 100% snap previously mentioned too?

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

No branches or pull requests

3 participants