mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 13:55:58 +00:00
fix: Automatic dual screen needs a real second touch panel (Odin keeps its side rail) (#1801)
* fix: AYN Odin handhelds are single-screen in automatic dual-screen mode * Use a second screen only when more than one physical screen is lit, instead of excluding AYN models * fix: open the session panel when the second screen turns on, and keep the On mode's display choice * fix: let the session panel open again after its screen goes away and returns * fix: Automatic dual screen needs a touchscreen for the second panel instead of counting lit displays * fix: check the second screen again when a touchscreen comes back after the display * fix: check the second screen again when a touchscreen is added or removed, and on resume * Keep the second screen panel closed once the session has ended
This commit is contained in:
1 parent
524292f457
commit
021e7153fa
5 files changed
+80
-6
No files matched your search
@@ -528,6 +528,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
refreshControls()
|
||||
updatePointerCapture()
|
||||
updateHandCamera()
|
||||
refreshSecondScreenDisplays()
|
||||
}
|
||||
override fun onInputDeviceRemoved(deviceId: Int) {
|
||||
physicalShortcuts.onDeviceRemoved(deviceId)
|
||||
@@ -539,10 +540,12 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
refreshControls()
|
||||
updatePointerCapture()
|
||||
updateHandCamera()
|
||||
refreshSecondScreenDisplays()
|
||||
}
|
||||
override fun onInputDeviceChanged(deviceId: Int) {
|
||||
joyConVr?.refresh()
|
||||
refreshControls()
|
||||
refreshSecondScreenDisplays()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2990,11 +2993,15 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
val newIds = candidates.map { it.id }.toSet()
|
||||
if (secondScreenMode != SecondScreenMode.NONE && oldIds.isNotEmpty() && selectedSecondScreenDisplay !in newIds) {
|
||||
closeSecondScreen(reset = true)
|
||||
SessionState.secondScreenAutoOpened = false
|
||||
return
|
||||
}
|
||||
if (selectedSecondScreenDisplay !in newIds) selectedSecondScreenDisplay = candidates.firstOrNull()?.id ?: -1
|
||||
if (secondScreenMode != SecondScreenMode.NONE && candidates.isEmpty()) closeSecondScreen(reset = true)
|
||||
else if (started && secondScreenMode != SecondScreenMode.NONE && secondScreenPresentation == null) showSecondScreen(secondScreenMode)
|
||||
if (secondScreenMode != SecondScreenMode.NONE && candidates.isEmpty()) {
|
||||
closeSecondScreen(reset = true)
|
||||
SessionState.secondScreenAutoOpened = false
|
||||
} else if (started && secondScreenMode != SecondScreenMode.NONE && secondScreenPresentation == null) showSecondScreen(secondScreenMode)
|
||||
else if (started && !ended && ::loading.isInitialized && !loading.visible) openDualScreenControls()
|
||||
updateKeyboardRoute()
|
||||
}
|
||||
|
||||
@@ -3897,6 +3904,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
}
|
||||
(getSystemService(INPUT_SERVICE) as? InputManager)
|
||||
?.registerInputDeviceListener(deviceListener, Handler(Looper.getMainLooper()))
|
||||
refreshSecondScreenDisplays()
|
||||
if (SessionState.guestPid > 1) padBridge?.syncConnectedControllers()
|
||||
joyConVr?.refresh()
|
||||
onScreenControls?.reload()
|
||||
|
||||
Reference in new issue
Block a user