-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
SDL_SetRelativeMouseMode causes xrel/yrel in SDL_MOUSEMOTION to be large absolute values #1836
Comments
Any updates or workarounds on this bug? |
Does setting vmmouse.present to false not work anymore? This appears to be a quirk of vmware...? |
I have the issue with the pen tablet (not in vmware) the values of xrel and yrel are crazy high. I made some hacky workaround for it last night. If anyone is interested, TLDR; if values are crazy high switch back to non-relative mode.
|
Is this a bug in XInput? |
I haven't looked at this yet, but I'd bet anything that we are screwing up with devices that report absolute coordinates instead of relative. (and this may or may not be a separate issue from the vmware thing.) |
Yeah, it makes sense that we're not handling absolute coordinates correctly. I moved this to 2.0.24 for investigation. |
Ok, looked into this, and we don't check the XIValuatorClass of devices at all, which means we accept absolute coordinates as relative values. Scratching this together shortly, which I think will fix this issue. |
This is untested! Reference Issue #1836.
I've pushed an attempt at this, but I can't find my tablet, which might have been thrown out a long time ago, so someone is going to have to tell me if it works. It definitely still works in the not-absolute-coordinate case, but that's all I can promise here at the moment. |
Anyone with a tablet have a chance to see if the latest in revision control fixes this issue? @mika314? |
I am too lazy, I have a workaround. It takes forever to rebuild Unreal Engine. |
I'm going to kick this out of the milestone and try to find a device for 2.26; in the worst case, we're not any worse off than we were, so I think we're good for 2.24. |
I was tracking this down a bit as Unreal Editor is hitting this in TigerVNC, annnd testing this new patch and still running into the same issue. Digging a little more found a few things: Using
While on TigerVNC:
Which you can see for the RawMotion event... is using Absolute, which can be fine BUT further compounding the issue is:
Is True... so the valuator thinks its relative, while event coords are not. I can see the issue using xinput test-xi2, which is not using SDL2. Im not 100% if all the causes are caused by the same issues here... but seems more related to the x11 server directly (Ive not tried any wayland servers out yet) vs SDL at this point. |
So TigerVNC is lying and saying it's relative motion even though they're absolute coordinates? |
Yeah looking at bug reports over there, some talk on this (granted this vnc bug is mouse warping, and VNC not being able to hold onto the mouse vs a direct client...) Ive not looked at their source, though the original bug report here was VMWare stuff not TigerVNC, but we have had issues on Unreal Editor with I think all RDP for Linux soo unsure how related things are to what Im see :) |
This is untested! Reference Issue libsdl-org#1836.
So just to be clear: is there something we can do here? Or is this strictly a TigerVNC (and/or other VNC servers) issue at this point? If there's some reasonable way to decide we're being giving absolute coords when it thinks we're getting relative coords, we can put a check in there for that, but I'm not sure how to detect that. |
I've not fully dug enough in to say, and I've only spotted what looks to be an issue with the x11 server and how the mouse devices are being faked through xinput. With regards to TightVNC, Im quite rusty now with x11 but it really seems like something is either not implemented (xinput2 interface, while they say they support it, the devices say they are relative, but return absolute cords... which seems like a bug in the server implementation they are using) I need to double check, but even though its saying relative, I have a fear/guess that if you hit the edge of a window these events stop reporting. If this is the case, we really cannot work around much here sadly :( ... even faking it using the last known x/y, if no even when pushing right, or even if an event our x/y position against the edge of the window will be the same as the last giving us a 0 +/- :( Still needs more debugging but its ... quite annoying to debug x11 + remote setups :) |
This bug report was migrated from our old Bugzilla tracker.
Reported in version: 2.0.3
Reported for operating system, platform: Linux, x86_64
Comments on the original bug report:
On 2015-04-21 23:59:20 +0000, Wouter van Oortmerssen wrote:
On 2016-01-19 22:43:01 +0000, Anthony Birkett wrote:
On 2016-01-19 23:00:15 +0000, Anthony Birkett wrote:
On 2016-01-20 20:26:03 +0000, Philipp Wiesemann wrote:
On 2016-01-23 18:52:10 +0000, Wouter van Oortmerssen wrote:
On 2018-09-29 21:32:52 +0000, wrote:
On 2019-09-19 11:43:49 +0000, Stijn Volckaert wrote:
On 2019-09-19 12:26:47 +0000, Stijn Volckaert wrote:
On 2019-09-19 20:10:33 +0000, Stijn Volckaert wrote:
The text was updated successfully, but these errors were encountered: