feat(settings): pick lxqt or kde plasma in the desktop cog

This commit is contained in:
xXJsonDeruloXx committed 2026-09-28 18:56:18 -04:00
1 parent 9a9a7daee8
commit 51f4c74d8c
2 files changed
+18 -1

No files matched your search

@@ -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<List<Pair<String, String>>>(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) {
@@ -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<Pair<String, String>> = 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,