diff --git a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt index e10bf04d2c..60b6e35db2 100644 --- a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt @@ -190,6 +190,7 @@ class MainActivity : ComponentActivity() { private var oscMode by mutableStateOf(SessionPrefs.OSC_AUTO) private var backActionsInverted by mutableStateOf(false) private var renderer by mutableStateOf("vulkan") + private var desktopShell by mutableStateOf(SessionPrefs.SHELL_LXQT) private var gameStorage by mutableStateOf("") private var storageOptions by mutableStateOf>>(emptyList()) private val pickGameStorage = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { r -> @@ -779,6 +780,7 @@ class MainActivity : ComponentActivity() { forceFullscreen = if (mode == SessionService.MODE_STEAM) forceFullscreen else null, mic = if (mode == SessionService.MODE_STEAM) mic else null, renderer = if (mode == SessionService.MODE_DESKTOP) renderer else null, + shell = if (mode == SessionService.MODE_DESKTOP) desktopShell else null, gameStorage = if (mode == SessionService.MODE_STEAM) gameStorage else null, storageOptions = storageOptions, fexPreset = if (mode == SessionService.MODE_STEAM) fexPreset else null, @@ -828,6 +830,7 @@ class MainActivity : ComponentActivity() { } }, onRenderer = { r -> SessionPrefs.setDesktopRenderer(this, r); renderer = r }, + onShell = { shell -> SessionPrefs.setDesktopShell(this, shell); desktopShell = shell }, onGameStorage = { path, label -> setGameStorage(path, label) }, onPickGameStorageFolder = { pickGameStorage.launch(InAppFilePicker.buildDirIntent(this, "Choose the game storage folder", gameStorage.ifEmpty { null })) @@ -932,6 +935,7 @@ class MainActivity : ComponentActivity() { forceFullscreen = SessionPrefs.forceFullscreen(this) mic = SessionPrefs.micEnabled(this) renderer = SessionPrefs.desktopRenderer(this) + desktopShell = SessionPrefs.desktopShell(this) gameStorage = SessionPrefs.gameStorage(this) storageOptions = GameStorage.options(this).map { it.label to it.path } if (mode == SessionService.MODE_STEAM) { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt b/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt index f7f8d32e1d..c0976bdca2 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt @@ -61,6 +61,8 @@ class ModeSettings( val clientDirectAudio: Boolean = false, val mic: Boolean?, val renderer: String?, + /** Desktop only: SessionPrefs.SHELL_LXQT or SHELL_PLASMA. */ + val shell: String? = null, val gameStorage: String? = null, val storageOptions: List> = emptyList(), val fexPreset: String? = null, @@ -118,6 +120,7 @@ class ModeSettingsActions( val onClientDirectAudio: (Boolean) -> Unit = {}, val onMic: (Boolean) -> Unit, val onRenderer: (String) -> Unit, + val onShell: (String) -> Unit = {}, val onGameStorage: (path: String, label: String) -> Unit = { _, _ -> }, val onPickGameStorageFolder: () -> Unit = {}, val onFexPreset: (String) -> Unit = {}, @@ -423,7 +426,17 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) { } } } - if (!steam && s.renderer != null) SettingsGroup("Renderer") { + if (!steam && s.shell != null) SettingsGroup("Shell") { + ChoiceRow( + host, "shell", "Desktop shell", "Applies at the next start.", + listOf(SessionPrefs.SHELL_LXQT to "LXQt", SessionPrefs.SHELL_PLASMA to "KDE Plasma"), s.shell, + note = "KDE Plasma downloads the first time it starts and composites in software, so games " + + "and emulators from its menu open full screen on the GPU. If it cannot start, the desktop comes up on LXQt.", + onPick = a.onShell, + ) + } + // labwc's renderer; KDE Plasma's KWin always composites in software here. + if (!steam && s.renderer != null && s.shell != SessionPrefs.SHELL_PLASMA) SettingsGroup("Renderer") { ChoiceRow( host, "renderer", "Desktop renderer", "Composites the desktop.", listOf("vulkan" to "vulkan - GPU", "gles2" to "gles2 - GPU (experimental)", "pixman" to "pixman - software"), s.renderer,