From b0be21beaf2539121174d2d56e5bbbc55ee686ab Mon Sep 17 00:00:00 2001 From: sapphirerd Date: Thu, 11 Sep 2025 07:05:32 -0600 Subject: [PATCH] Removed primary-screen checks so the input overlay always forwards touch events, ensuring all touches reach the native handler even when multiple displays are active --- .../java/org/citra/citra_emu/display/SecondaryDisplay.kt | 3 --- .../main/java/org/citra/citra_emu/overlay/InputOverlay.kt | 8 ++------ src/core/frontend/emu_window.cpp | 4 ++++ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/android/app/src/main/java/org/citra/citra_emu/display/SecondaryDisplay.kt b/src/android/app/src/main/java/org/citra/citra_emu/display/SecondaryDisplay.kt index dd5c76ad4..606355a6d 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/display/SecondaryDisplay.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/display/SecondaryDisplay.kt @@ -104,10 +104,7 @@ class SecondaryDisplayPresentation( } }) - val sendToSecondary = DisplayHelper.isBottomOnSecondary() - this.surfaceView.setOnTouchListener { _, event -> - if (!sendToSecondary) return@setOnTouchListener true val pointerIndex = event.actionIndex val pointerId = event.getPointerId(pointerIndex) diff --git a/src/android/app/src/main/java/org/citra/citra_emu/overlay/InputOverlay.kt b/src/android/app/src/main/java/org/citra/citra_emu/overlay/InputOverlay.kt index 4fd742417..f7519bb81 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/overlay/InputOverlay.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/overlay/InputOverlay.kt @@ -24,7 +24,6 @@ import androidx.preference.PreferenceManager import org.citra.citra_emu.CitraApplication import org.citra.citra_emu.NativeLibrary import org.citra.citra_emu.R -import org.citra.citra_emu.display.DisplayHelper import org.citra.citra_emu.utils.EmulationMenuSettings import org.citra.citra_emu.utils.TurboHelper import java.lang.NullPointerException @@ -105,8 +104,6 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex val isActionUp = motionEvent == MotionEvent.ACTION_UP || motionEvent == MotionEvent.ACTION_POINTER_UP - val isTouchScreenHere = DisplayHelper.isBottomOnPrimary() - val pointerList = (0 until event.pointerCount).toMutableList() // Move the pointer that triggered the most recent event to the front // of the list so that it is processed first @@ -152,7 +149,7 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex val hasActiveOverlay = hasActiveButtons || hasActiveDpad || hasActiveJoystick - if (preferences.getBoolean("isTouchEnabled", true) && !hasActiveOverlay && isTouchScreenHere) { + if (preferences.getBoolean("isTouchEnabled", true) && !hasActiveOverlay) { if (isActionMove) { NativeLibrary.onTouchMoved(xPosition.toFloat(), yPosition.toFloat()) continue @@ -254,8 +251,7 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex if (preferences.getBoolean("isTouchEnabled", true) && isActionDown && - !anyOverlayStateChanged && - isTouchScreenHere + !anyOverlayStateChanged ) { // These need to be recalculated because touching the area // right in the middle of the dpad (between the "buttons") or diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index c352dbdf0..ee81b177e 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -66,6 +66,10 @@ bool EmuWindow::IsWithinTouchscreen(const Layout::FramebufferLayout& layout, uns } #endif + if (!layout.bottom_screen_enabled) { + return false; + } + Settings::StereoRenderOption render_3d_mode = Settings::values.render_3d.GetValue(); if (render_3d_mode == Settings::StereoRenderOption::SideBySide ||