mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-02 07:45:40 +00:00
Fix NPE when receiving non-view-associated mouse events with absolute mouse mode enabled
This commit is contained in:
parent
ff5d9f72aa
commit
885b59fd52
@ -1869,7 +1869,9 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
|
|
||||||
if (deltaX != 0 || deltaY != 0) {
|
if (deltaX != 0 || deltaY != 0) {
|
||||||
if (prefConfig.absoluteMouseMode) {
|
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 {
|
else {
|
||||||
conn.sendMouseMove(deltaX, deltaY);
|
conn.sendMouseMove(deltaX, deltaY);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user