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

[MS-RDPBCGR] Relative mouse input #3091

Draft
wants to merge 6 commits into
base: devel
Choose a base branch
from

Conversation

sasha0552
Copy link
Contributor

@sasha0552 sasha0552 commented May 25, 2024

@sasha0552 sasha0552 changed the title [MS-RDPBCGR] Relative mouse input (TS_RELPOINTER_EVENT) [MS-RDPBCGR] Relative mouse input May 26, 2024
@matt335672
Copy link
Member

Thanks for this @sasha0552

One (fairly significant) comment/question at this stage; The general approach you're taking (if I'm reading this right) is to send both relative and absolute events to xorgxrdp, and then within the module to generate an absolute position.

Wouldn't it be better to simply do this within xrdp before sending the event to the module? That way you'll get support for the VNC backend for free - at the moment this won't work with VNC without duplicating the code you're adding to xorgxrdp within vnc.c.

@sasha0552
Copy link
Contributor Author

sasha0552 commented May 28, 2024

@matt335672

The general approach you're taking (if I'm reading this right) is to send both relative and absolute events to xorgxrdp, and then within the module to generate an absolute position.

No, neither xrdp nor xorgxrdp hold absolute position when using relative input - they just pass relative mouse movements directly to Xorg, and then, Xorg itself calculates the absolute position and passes the events with delta to the applications.

Applications that need relative input don't want absolute coordinates, they need only delta (by how many pixels the cursor has been moved, this value may even exceed the screen borders), so doing this on the xrdp side essentially implements the current behavior, but with the risk that the cursor may desynchronize.

The applications want this:
image

And about VNC - I don't think VNC supports relative input. I'm not sure how xrdp works with the VNC backend - does xrdp just translate RDP to VNC? If so, then relative input is not possible on the VNC backend.

@matt335672
Copy link
Member

Thanks for the clarification - that makes more sense now.

Classic VNC doesn't support relative mouse events:-

https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#pointerevent

which from what you've said means either:-

  1. [Eventually] we will need a way to disable advertising of INPUT_FLAG_MOUSE_RELATIVE in the server capability flags where the user knows they will be connecting to a VNC session.
  2. We'll need to convert relative mouse events to absolute ones before sending them to VNC.

Also from what you've said, 2) runs the risk of de-synchronisation.

@jsorg71
Copy link
Contributor

jsorg71 commented Jun 25, 2024

@sasha0552 I want to test this. What clients supports relative mouse? I know it's added to later version of FreeRDP but does mstsc or any other clients support this feature?

@sasha0552
Copy link
Contributor Author

I don't think clients other than FreeRDP currently support this feature.

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

Successfully merging this pull request may close these issues.

Relative mouse input support
3 participants