mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 21:35:59 +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
@@ -539,6 +539,11 @@ class FrontEndActivity : ComponentActivity() {
|
||||
override fun onDisplayRemoved(displayId: Int) = refreshSecondScreenDisplays()
|
||||
override fun onDisplayChanged(displayId: Int) = refreshSecondScreenDisplays()
|
||||
}
|
||||
private val secondScreenTouchListener = object : android.hardware.input.InputManager.InputDeviceListener {
|
||||
override fun onInputDeviceAdded(deviceId: Int) = refreshSecondScreenDisplays()
|
||||
override fun onInputDeviceRemoved(deviceId: Int) = refreshSecondScreenDisplays()
|
||||
override fun onInputDeviceChanged(deviceId: Int) = refreshSecondScreenDisplays()
|
||||
}
|
||||
|
||||
private val homeRoleRequest = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
||||
refreshHomeAppState()
|
||||
@@ -1688,6 +1693,7 @@ class FrontEndActivity : ComponentActivity() {
|
||||
addDataScheme("file")
|
||||
})
|
||||
displayManager.registerDisplayListener(secondScreenDisplayListener, ui)
|
||||
getSystemService(android.hardware.input.InputManager::class.java)?.registerInputDeviceListener(secondScreenTouchListener, ui)
|
||||
launcherStarted = true
|
||||
refreshSecondScreenDisplays()
|
||||
getSystemService(android.content.pm.LauncherApps::class.java).registerCallback(packageCallback, ui)
|
||||
@@ -1731,6 +1737,7 @@ class FrontEndActivity : ComponentActivity() {
|
||||
com.droiddeck.launcher.stores.StoresState.libraryListener = null
|
||||
com.droiddeck.launcher.stores.battlenet.BattleNetClient.opener = null
|
||||
displayManager.unregisterDisplayListener(secondScreenDisplayListener)
|
||||
getSystemService(android.hardware.input.InputManager::class.java)?.unregisterInputDeviceListener(secondScreenTouchListener)
|
||||
launcherStarted = false
|
||||
com.droiddeck.launcher.ui.DualScreenPanel.hide(taskId)
|
||||
flood = null
|
||||
|
||||
Reference in new issue
Block a user