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

This commit is contained in:
sapphirerd 2025-09-11 07:05:32 -06:00 committed by OpenSauce04
parent 5b65763479
commit b0be21beaf
3 changed files with 6 additions and 9 deletions

View file

@ -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)

View file

@ -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

View file

@ -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 ||