mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 12:56:06 +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
@@ -32,6 +32,24 @@ class DualScreenTest {
|
||||
assertFalse(DualScreen.isBuiltIn(null, "Pixel 8"))
|
||||
}
|
||||
|
||||
@Test fun aSecondPanelNeedsATouchscreenOfItsOwnSize() {
|
||||
val top = 1920 to 1080
|
||||
val bottom = 1280 to 960
|
||||
assertTrue(DualScreen.hasOwnTouchPanel(bottom, top, listOf(1920 to 1080, 1280 to 960)))
|
||||
assertTrue(DualScreen.hasOwnTouchPanel(bottom, top, listOf(1080 to 1920, 960 to 1280)))
|
||||
assertTrue(DualScreen.hasOwnTouchPanel(bottom, top, listOf(1920 to 1080, 1279 to 959)))
|
||||
assertFalse(DualScreen.hasOwnTouchPanel(bottom, top, listOf(1920 to 1080)))
|
||||
assertFalse(DualScreen.hasOwnTouchPanel(bottom, top, emptyList()))
|
||||
}
|
||||
|
||||
@Test fun aPhantomPanelTheSizeOfTheMainScreenIsNotASecondScreen() {
|
||||
val main = 1920 to 1080
|
||||
assertFalse(DualScreen.hasOwnTouchPanel(main, main, listOf(1920 to 1080)))
|
||||
assertFalse(DualScreen.hasOwnTouchPanel(main, main, listOf(1080 to 1920)))
|
||||
assertTrue(DualScreen.hasOwnTouchPanel(main, main, listOf(1920 to 1080, 1920 to 1080)))
|
||||
assertTrue(DualScreen.hasOwnTouchPanel(main, null, listOf(1920 to 1080)))
|
||||
}
|
||||
|
||||
@Test fun oneScreenDevicesGetNoSecondScreenInAnyMode() {
|
||||
for (mode in DualScreen.modes) {
|
||||
SessionPrefs.setDualScreenMode(context, mode)
|
||||
|
||||
Reference in new issue
Block a user