From 0045c54d8ec1c09008f5e91cc82cb747e8654957 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 20 Mar 2021 11:11:12 -0500 Subject: [PATCH] Reapply a portion of 1d3e42f that should not have been reverted --- app/src/main/java/com/limelight/Game.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java index 9bf9dcd1..767c9102 100644 --- a/app/src/main/java/com/limelight/Game.java +++ b/app/src/main/java/com/limelight/Game.java @@ -598,6 +598,10 @@ public class Game extends Activity implements SurfaceHolder.Callback, public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); + // We can't guarantee the state of modifiers keys which may have + // lifted while focus was not on us. Clear the modifier state. + this.modifierFlags = 0; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { // Capture is lost when focus is lost, so it must be requested again // when focus is regained.