Giter Club home page Giter Club logo

Comments (2)

feschber avatar feschber commented on July 28, 2024

What I definitely want to avoid is amplification of acceleration across devices (pointer acceleration is captured and then accelerated again when being emulated remotely).

In my opinion the only correct thing to do is to send unaccelerated motion to the compositor and let the compositor handle acceleration instead of lan-mouse, since the compositor is the only component that can correctly identify if accelerated or unaccelerated motion is required (through interfaces like relative-pointer-unsatble-v1, which report both accelerated and unaccelerated events, letting applications chose what they want).
In other words: Sending accelerated motion to the compositor (and this means any artificial acceleration added by lan-mouse either on the capture or emulation side) would make it impossible for the compositor to infer the original unaccelerated motion.

So ideally, we want to send unaccelerated motion, but also tell the compositor, that it is infact unaccelerated, which I tried to do wherever possible, though in reality most backends do not yet do it correctly.

As for KDE -> KDE, you are (almost certainly) using the layer-shell capture backend, which is explicitly using dx_unaccel / dy_unaccel, so this is working as intended.

On the emulation side, it's either the remote desktop portal org.freedesktop.impl.portal.RemoteDesktop.NotifyPointerMotion for KDE < 6.1 or libei using ei_pointer.motion_relative on KDE >= 6.1.

The RDP documentation says "The (dx, dy) vector represents the new pointer position in the streams logical coordinate space.", which if I'm understanding correctly is the compositor coordinate space, hence unfortunately motion in its accelerated form... which makes sense, considering the "remote desktop" usecase.

As for libei, it's a little bit more complicated: ei_device_type. Virtual devices generate events in a pixel coordinate space
and physical devices in millimeters. So we probably want to have device type physical here and report unaccelerated motion.
However GNOME and KDE both seem to advertise only devices of type VIRTUAL to libei from what I have seen so far, so no luck here either...

The only emulation backend where acceleration should work correctly, is probably the wlroots backend, which uses zwlr_virtual_pointer_v1, where the documentation explicitly states "This protocol allows clients to emulate a physical pointer device."

I personally am very much in favor of having no pointer acceleration at all, but having this be configurable would not hurt anyone I guess (though the drawback is what I stated above).

from lan-mouse.

asahilina avatar asahilina commented on July 28, 2024

Yes, this is with layer-shell capture (due to #140) and libei for emulation.

I agree that sending unaccelerated motion and then handling it locally in the compositor is ideal, but of course then there needs to be an interface that allows that (that is implemented properly in compositors).

I do think that at least a simple linear scale config on the sender side is probably still appropriate, since different mice have different DPI and the linear scale appropriate with one mouse might not be appropriate with another mouse.

from lan-mouse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.