wgois / OIS

Official OIS repository. Object oriented Input System
https://wgois.github.io/OIS/
zlib License
257 stars 86 forks source link

Non-Exclusive LinuxMouse Offset Bugfix #94

Closed VENTDEV closed 8 months ago

VENTDEV commented 8 months ago

Fixes https://github.com/wgois/OIS/issues/93

We only change the mouse positions if the mouse is grabbed and we have focus. Otherwise, we get an offset. If we don't have the mouse grabbed, or mouse focus is lost, just pipe in the Xmotion values directly.

The code could probably be merged into the clipping/warping if(grabMouse) conditional below. But I believe this is cleaner with less nesting.

Affected backends Linux X11 Mouse.

VENTDEV commented 8 months ago

Gah! Sorry, forgot to put the change I was submitting into its own branch.

You can cherry pick out the code from the first comment if you want it.