fix: keep select mapping and panel input ownership consistent

Keep Select-as-Steam in the existing one-time profile migration and remove the obsolete bridge flag. Raw SELECT state stays stable across router attachment changes, while explicit native, disabled and local profile bindings remain authoritative.

Let the panel close its shared DeckControls source. Detached sticks, D-pads and face buttons release only their own controls, preserving other trackpad contacts and clicks.

Add seven regressions. All 2,246 JVM tests pass; the debug APK build, session assets and runtime inputs validate. Thor validation remains pending.
This commit is contained in:
Delete228 committed 2026-10-24 02:52:09 +03:00
1 parent 1dae4bf8ee
commit 884671a065
7 files changed
+250 -15

No files matched your search

@@ -551,7 +551,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
}
val bridge = PadBridge(File(LinuxRuntime.sessionRoot(this), "dev/input"))
bridge.setSelectSteam(ControllerPrefs.read(this).selectSteam)
bridge.setBuiltinPad(SessionState.mode != SessionService.MODE_STEAM || SessionPrefs.builtinPad(this))
padBridge = bridge
inputRouter = InputRouter(inputOutput).also { bridge.setInputRouter(it); DeckControls.setRouter(it); physicalInputBindings = com.droiddeck.launcher.input.PhysicalInputBindings(it) }
@@ -67,7 +67,6 @@ public final class PadBridge {
}
private final Handler mainHandler = new Handler(Looper.getMainLooper());
private boolean open;
private volatile boolean selectSteam;
private volatile boolean builtinPad = true;
private TouchRoute touchRoute;
private boolean touchMouseActive;
@@ -122,10 +121,6 @@ public final class PadBridge {
for (int slot = 1; slot < SLOTS; slot++) playerStates[slot] = new PadState();
}
public void setSelectSteam(boolean on) {
selectSteam = on;
}
public synchronized void setInputRouter(InputRouter router) {
if (inputRouter == router) return;
for (InputRouter.PadSource route : physicalRoutes) if (route != null) route.close();
@@ -363,9 +358,6 @@ public final class PadBridge {
case KeyEvent.KEYCODE_BUTTON_L1: pad.press(4, pressed); break;
case KeyEvent.KEYCODE_BUTTON_R1: pad.press(5, pressed); break;
case KeyEvent.KEYCODE_BUTTON_SELECT:
if (selectSteam && inputRouter == null) pad.press(PadState.GUIDE, pressed);
else pad.press(6, pressed);
break;
case KeyEvent.KEYCODE_BACK: pad.press(6, pressed); break;
case KeyEvent.KEYCODE_BUTTON_START:
case KeyEvent.KEYCODE_MENU: pad.press(7, pressed); break;
@@ -551,8 +551,7 @@ class DeckControlsPanel(
override fun onDetachedFromWindow() {
setClick(false)
if (knobX != 0f || knobY != 0f) move(0f, 0f, 1f)
deckSource.close()
super.onDetachedFromWindow()
super.onDetachedFromWindow()
}
}
@@ -610,8 +609,7 @@ class DeckControlsPanel(
override fun onDetachedFromWindow() {
set(0)
deckSource.close()
super.onDetachedFromWindow()
super.onDetachedFromWindow()
}
}
@@ -672,8 +670,7 @@ class DeckControlsPanel(
override fun onDetachedFromWindow() {
set(emptySet())
deckSource.close()
super.onDetachedFromWindow()
super.onDetachedFromWindow()
}
}