mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 18:42:46 +00:00
Ignore non-relative MotionEvents on Oreo to fix mouse jumping when toggling capture
This commit is contained in:
parent
8bac873e67
commit
40c406051c
@ -970,6 +970,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
lastMouseX = (int)event.getX();
|
lastMouseX = (int)event.getX();
|
||||||
lastMouseY = (int)event.getY();
|
lastMouseY = (int)event.getY();
|
||||||
}
|
}
|
||||||
|
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
// We get a normal (non-relative) MotionEvent when starting pointer capture to synchronize the
|
||||||
|
// location of the cursor with our app. We don't want this, so we must discard this event.
|
||||||
|
lastMouseX = (int)event.getX();
|
||||||
|
lastMouseY = (int)event.getY();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// First process the history
|
// First process the history
|
||||||
for (int i = 0; i < event.getHistorySize(); i++) {
|
for (int i = 0; i < event.getHistorySize(); i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user