diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java index e583487e..bf4efd49 100644 --- a/app/src/main/java/com/limelight/Game.java +++ b/app/src/main/java/com/limelight/Game.java @@ -171,6 +171,20 @@ public class Game extends Activity implements SurfaceHolder.Callback, streamView.setOnGenericMotionListener(this); streamView.setOnTouchListener(this); + inputCaptureProvider = InputCaptureManager.getInputCaptureProvider(this, this); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + // The view must be focusable for pointer capture to work. + streamView.setFocusable(true); + streamView.setDefaultFocusHighlightEnabled(false); + streamView.setOnCapturedPointerListener(new View.OnCapturedPointerListener() { + @Override + public boolean onCapturedPointer(View view, MotionEvent motionEvent) { + return handleMotionEvent(motionEvent); + } + }); + } + // Warn the user if they're on a metered connection checkDataConnection(); @@ -257,20 +271,6 @@ public class Game extends Activity implements SurfaceHolder.Callback, getWindow().setSustainedPerformanceMode(true); } - inputCaptureProvider = InputCaptureManager.getInputCaptureProvider(this, this); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - // The view must be focusable for pointer capture to work. - streamView.setFocusable(true); - streamView.setDefaultFocusHighlightEnabled(false); - streamView.setOnCapturedPointerListener(new View.OnCapturedPointerListener() { - @Override - public boolean onCapturedPointer(View view, MotionEvent motionEvent) { - return handleMotionEvent(motionEvent); - } - }); - } - if (prefConfig.onscreenController) { // create virtual onscreen controller virtualController = new VirtualController(conn,