summaryrefslogtreecommitdiff
path: root/Source/Android
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-09-14 13:35:02 +0200
committerJosJuice <josjuice@gmail.com>2020-09-14 14:13:29 +0200
commitc8a76e6928e544a4a5be13ede6157913db047d19 (patch)
tree9e387e87d13fd8824724bb6230d53ba7991395ac /Source/Android
parenteae68194b30610c60f224c676f573de024ed3a78 (diff)
Android: Fix touch pointer not working after activity recreation
The only place where initTouchPointer was called automatically was Host_RequestRenderWindowSize, which is called at least once after emulation start, but not after activity recreation.
Diffstat (limited to 'Source/Android')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java
index ea1a6ecb54..f4878168ca 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java
@@ -123,7 +123,17 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
defaultOverlay();
// Load the controls.
- refreshControls();
+ if (NativeLibrary.IsRunning())
+ {
+ // We would've needed a refreshControls call here in addition to the initTouchPointer call
+ // if it wasn't for initTouchPointer calling refreshControls.
+ initTouchPointer();
+ }
+ else
+ {
+ // We can't call initTouchPointer yet because it needs the aspect ratio of the running game.
+ refreshControls();
+ }
// Set the on touch listener.
setOnTouchListener(this);