From 885b59fd524a962c6e737ca577bc755cbfe95ca2 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 25 Oct 2023 23:13:54 -0500 Subject: [PATCH] Fix NPE when receiving non-view-associated mouse events with absolute mouse mode enabled --- app/src/main/java/com/limelight/Game.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java index c15469d2..b7ee510c 100644 --- a/app/src/main/java/com/limelight/Game.java +++ b/app/src/main/java/com/limelight/Game.java @@ -1869,7 +1869,9 @@ public class Game extends Activity implements SurfaceHolder.Callback, if (deltaX != 0 || deltaY != 0) { if (prefConfig.absoluteMouseMode) { - conn.sendMouseMoveAsMousePosition(deltaX, deltaY, (short)view.getWidth(), (short)view.getHeight()); + // NB: view may be null, but we can unconditionally use streamView because we don't need to adjust + // relative axis deltas for the position of the streamView within the parent's coordinate system. + conn.sendMouseMoveAsMousePosition(deltaX, deltaY, (short)streamView.getWidth(), (short)streamView.getHeight()); } else { conn.sendMouseMove(deltaX, deltaY);