hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.08k stars 2.16k forks source link

Touchpad scrolling is not smooth #16600

Open hrydgard opened 1 year ago

hrydgard commented 1 year ago

An increasing amount of PC laptops are sold with great touchpads that support smooth two-finger scrolling as well as Apple does. Unfortunately we only support the old school mousewheel up/down events, which feels very jerky and uncontrollable on these. So this needs fixing on Windows.

Additionally, I think SDL now has support for smooth scrolling so we should look into supporting this on Mac and Linux as well.

hrydgard commented 1 year ago

Oh, this might be of use:

https://learn.microsoft.com/en-us/windows/compatibility/precision-touchpad-devices

https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#highresolutionscrollingaware

EDIT: Turns out not to help, we're doing something else wrong.

hrydgard commented 1 year ago

This has been fixed on Windows.

On Mac/Linux, according to https://github.com/Genymobile/scrcpy/issues/3363, we can use preciseX and preciseY in SDL_MouseWheelEvent.

hrydgard commented 1 year ago

Ok, I'm stuck, on Mac at least. preciseX/Y requires SDL 2.0.18, but even with "brew upgrade" and all that, my SDL headers seem stuck somehow, or we specify the minimum SDL version somewhere I can't find.

I get this log line, so it does look like the latest version is actually installed:

Info: We compiled against SDL version 2.0.16, but we are linking against SDL version 2.26.3., be aware that this can lead to unexpected behaviors

unknownbrackets commented 1 year ago

Isn't there a bundled SDL on macOS? This thing?

https://github.com/hrydgard/ppsspp-mac-sdl

-[Unknown]

hrydgard commented 1 year ago

Oh darn, I completely forgot we had that.

hrydgard commented 1 year ago

OK so I copied a new SDL2.framework into that submodule locally, but it doesn't build with it:

In file included from /Users/hrydg/ppsspp/SDL/SDLMain.mm:8:
/Users/hrydg/ppsspp/SDL/macOS/SDL2.framework/Headers/SDL.h:32:10: fatal error: 'SDL2/SDL_main.h' file not found
#include <SDL2/SDL_main.h>

But it's strange, the framework seems to be organized pretty much the same as the old one, so I just don't get it..

unknownbrackets commented 1 year ago

Hm, https://github.com/hrydgard/ppsspp-mac-sdl/blob/main/SDL2.framework/Versions/A/Headers/SDL.h doesn't currently contain "SDL2/". Maybe missing some new files that weren't committed? Or I don't really know how include paths work with these frameworks.

-[Unknown]

hrydgard commented 1 year ago

It's exactly the same in both the old and the new framework. Maybe there's some hidden symlink or something, I don't know either.

hrydgard commented 1 year ago

This was solved a while ago, though there are still some DPI issues on linux. Closing.

tolotrasamuel commented 2 weeks ago

This is not fixed on MAC. Please reopen this issue. Two finger scroll not smooth on Mac

hrydgard commented 2 weeks ago

For me, it is pretty smooth on Mac actually, although could be silkier I guess. For you, is it scrolling in steps?