LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
15.41k stars 743 forks source link

Pen input active while hovering #2756

Open cfalas opened 1 week ago

cfalas commented 1 week ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

After the change from legacy input to inputtino, the pen input has changed behaviour:

Video (not sure if it's very clear)

A simple fix (see commit on my fork 21484e5b6a477173245a0fcd06d2e8192c54c85e) appears to mostly solve this, but not entirely:

e.g. trying to draw a dashed line results in something like this:

I can see some correlation between when it happens and pressure and/or tilt angle (i.e. when pressure is higher, it doesn't happen as much, and when pressure is low and tilt angle is close to the screen it happens most of the time)

Expected Behavior

When the pen is hovering, the pointer is moved without clicking anything. When the pen touches the pointer acts as a pen in apps supporting pen input (e.g. Xournal++). As soon as the pen is lifted, the pen stops writing.

Additional Context

For testing, I am using moonlight-android on a Samsung S9 Ultra with the S pen.

Host Operating System

Linux

Operating System Version

Arch Linux, kernel 6.9.5

Architecture

64 bit

Sunshine commit or version

10666c0

Package

other (self built)

GPU Type

Intel

GPU Model

UHD 770

GPU Driver/Mesa Version

24.1.2

Capture Method

wlroots (Linux)

Config

adapter_name = /dev/dri/renderD128
output_name = 0
resolutions = [
    352x240,
    480x360,
    858x480,
    1280x720,
    1920x1080,
    2560x1080,
    3440x1440,
    1920x1200,
    3840x2160,
    3840x1600,
    2960x1848
]
channels = 2

Apps

No response

Relevant log output

N/A
ABeltramo commented 6 days ago

Thanks for the detailed issue and PR, unfortunately I don't have the HW to test this, so I was just relying on the libinput unit tests and documentation. It might be worth to double-check what exactly Moonlight sends over the wire by enabling the debug logs in Sunshine; the client could just report the wrong values..

cfalas commented 6 days ago

I already checked both client and sunshine logs before making the issue so I'm confident the issue is within sunshine.

It looks like the combination of https://github.com/LizardByte/Sunshine/commit/21484e5b6a477173245a0fcd06d2e8192c54c85e and https://github.com/games-on-whales/inputtino/pull/10 completely fix this. I'll test some more over the next few days and make a PR here as well.