From 359a1b3296e3133af35ca01ab54df675ba2f4490 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Tue, 21 Mar 2023 12:05:42 -0400 Subject: [PATCH] citra_android: Fix input shifting in emulation activity (#6352) --- .../activities/EmulationActivity.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/android/app/src/main/java/org/citra/citra_emu/activities/EmulationActivity.java b/src/android/app/src/main/java/org/citra/citra_emu/activities/EmulationActivity.java index 28659589e..114f1e427 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/activities/EmulationActivity.java +++ b/src/android/app/src/main/java/org/citra/citra_emu/activities/EmulationActivity.java @@ -5,7 +5,6 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.os.Bundle; -import android.os.Handler; import android.preference.PreferenceManager; import android.util.SparseIntArray; import android.view.InputDevice; @@ -124,7 +123,6 @@ public final class EmulationActivity extends AppCompatActivity { .append(R.id.menu_emulation_close_game, EmulationActivity.MENU_ACTION_CLOSE_GAME); } - private View mDecorView; private EmulationFragment mEmulationFragment; private SharedPreferences mPreferences; private ControllerMappingHelper mControllerMappingHelper; @@ -170,16 +168,6 @@ public final class EmulationActivity extends AppCompatActivity { mControllerMappingHelper = new ControllerMappingHelper(); - // Get a handle to the Window containing the UI. - mDecorView = getWindow().getDecorView(); - mDecorView.setOnSystemUiVisibilityChangeListener(visibility -> - { - if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { - // Go back to immersive fullscreen mode in 3s - Handler handler = new Handler(getMainLooper()); - handler.postDelayed(this::enableFullscreenImmersive, 3000 /* 3s */); - } - }); // Set these options now so that the SurfaceView the game renders into is the right size. enableFullscreenImmersive(); @@ -275,14 +263,14 @@ public final class EmulationActivity extends AppCompatActivity { } private void enableFullscreenImmersive() { - // It would be nice to use IMMERSIVE_STICKY, but that doesn't show the toolbar. - mDecorView.setSystemUiVisibility( + getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | - View.SYSTEM_UI_FLAG_IMMERSIVE); + View.SYSTEM_UI_FLAG_IMMERSIVE | + View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); } @Override