feat: replace the LXQt desktop with SteamOS-style KDE Plasma (#473)

* feat: replace the LXQt desktop with SteamOS-style KDE Plasma

* feat: leaving the KDE desktop logs out through Plasma and returns to gaming mode

* feat: DroidDeck logo wallpaper as the KDE desktop default

* feat: build the KDE wallpaper from the DroidDeck mark artwork

* ci: keep the built desktop package as a short-lived artifact for device testing

* fix: the desktop loading screen no longer promises Steam on the desktop

* docs: the output resize comments name the desktop's KWin

* fix: the desktop package verifies every package's Arch Linux ARM signature and never replaces a published tag

* fix: programs sent to the GPU from the desktop drop its software rendering overrides

* fix: an interrupted desktop install no longer counts as installed

* feat: pin the desktop package to its DroidDeck-Components release instead of the catalog
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-09 10:39:50 -04:00
1 parent 79880d1502
commit fe71084f23
94 files changed
+1904 -1182

No files matched your search

@@ -343,7 +343,6 @@ class MainActivity : ComponentActivity() {
private var steamDownloadsInBackground by mutableStateOf(false)
private var oscMode by mutableStateOf(SessionPrefs.OSC_AUTO)
private var backActionsInverted by mutableStateOf(false)
private var renderer by mutableStateOf("vulkan")
private var gameStorage by mutableStateOf("")
private var storageDiagnostics by mutableStateOf(false)
private var storageOptions by mutableStateOf<List<GameStorage.Option>>(emptyList())
@@ -1194,7 +1193,6 @@ class MainActivity : ComponentActivity() {
directAudio = if (mode == SessionService.MODE_STEAM) directAudio else null,
stretch16x9 = if (mode == SessionService.MODE_STEAM) stretch16x9 else null,
mic = if (mode == SessionService.MODE_STEAM) mic else null,
renderer = if (mode == SessionService.MODE_DESKTOP) renderer else null,
gameStorage = if (mode == SessionService.MODE_STEAM) gameStorage else null,
storageOptions = storageOptions,
storageDiagnostics = mode == SessionService.MODE_STEAM && storageDiagnostics,
@@ -1266,7 +1264,6 @@ class MainActivity : ComponentActivity() {
requestPermissions(arrayOf(Manifest.permission.RECORD_AUDIO), 2)
}
},
onRenderer = { r -> SessionPrefs.setDesktopRenderer(this, r); renderer = r },
onGameStorage = { path, label -> setGameStorage(path, label) },
onPickGameStorageFolder = {
pickGameStorage.launch(InAppFilePicker.buildDirIntent(this, getString(R.string.main_pick_game_storage), gameStorage.ifEmpty { null }))
@@ -1423,7 +1420,6 @@ class MainActivity : ComponentActivity() {
stretch16x9 = SessionPrefs.stretch16x9(this)
mic = SessionPrefs.micEnabled(this)
refreshWifiDiscovery()
renderer = SessionPrefs.desktopRenderer(this)
gameStorage = SessionPrefs.gameStorage(this)
storageDiagnostics = SessionPrefs.storageDiagnosticsEnabled(this)
settingsMode = mode
@@ -745,9 +745,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
}
private fun loadingTitle(): String = when (loadingMode()) {
SessionService.MODE_DESKTOP ->
if (!SessionState.running && intent.getStringExtra(SessionService.EXTRA_STEAM_UI) != null) getString(R.string.session_starting_steam_desktop)
else getString(R.string.session_starting_desktop)
// Also when the desktop was asked for with Steam (Big Picture's Switch to Desktop): the client
// does not open on it.
SessionService.MODE_DESKTOP -> getString(R.string.session_starting_desktop)
SessionService.MODE_RUN -> {
val program = if (SessionState.running) SessionState.program else intent.getStringExtra(SessionService.EXTRA_PROGRAM)
com.droiddeck.launcher.frontend.Library.nameForProgram(program)?.let { getString(R.string.session_starting_named, it) }
@@ -929,8 +929,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
/** Null when the desktop package is in, else the loading screen's closing line. */
private fun installDesktop(): String? {
uiHandler.post { loading.percent = -1; loading.say(getString(DESKTOP_LINES.downloading), DESKTOP_LINES.topic, readable = true) }
val entry = com.droiddeck.launcher.runtime.DesktopCatalog.fetch()?.firstOrNull { it.id == "desktop" }
?: return getString(R.string.session_desktop_catalog_unreachable)
val entry = com.droiddeck.launcher.runtime.DesktopCatalog.desktopEntry(this)
val problem = com.droiddeck.launcher.runtime.DesktopCatalog.install(this, entry,
progressFor(DESKTOP_LINES, entry.size / 1_000_000))
return problem?.let { getString(R.string.session_desktop_install_failed, it) }
@@ -53,7 +53,7 @@ object DeviceReport {
b.append("DroidDeck session report\n")
b.append("========================\n")
k("Written", SimpleDateFormat("yyyy-MM-dd HH:mm:ss zzz", Locale.US).format(Date()))
k("Session mode", when (mode) { SessionService.MODE_DESKTOP -> "desktop (labwc/LXQt)"; SessionService.MODE_RUN -> "a program under gamescope"; else -> "Steam client (gamescope)" })
k("Session mode", when (mode) { SessionService.MODE_DESKTOP -> "desktop (KDE Plasma)"; SessionService.MODE_RUN -> "a program under gamescope"; else -> "Steam client (gamescope)" })
h("App")
runCatching {
@@ -189,7 +189,7 @@ object DeviceReport {
}
for (name in listOf("droiddeck-tu-debug", "droiddeck-driver",
"droiddeck-osc", "droiddeck-no-pad",
"droiddeck-no-hud", "droiddeck-wlr-renderer")) {
"droiddeck-no-hud")) {
val f = File(Environment.getExternalStorageDirectory(), "Download/$name")
if (f.isFile) k(name, FileUtils.readString(f)?.trim()?.replace('\n', ' ')?.ifEmpty { "(present, empty)" } ?: "(present)")
}
@@ -25,7 +25,7 @@ import java.util.zip.ZipInputStream;
/**
* Imported LINUX Vulkan drivers: glibc Turnip ICDs ({@code Turnip-<tag>[-variant]-Linux.zip} from
* Banners-Turnip) for the runtime - the gamescope session that runs Valve's native ARM64 Steam
* client, and the labwc desktop beside it. This is the driver that DRAWS there: the client's own UI
* client, and the KDE Plasma desktop beside it. This is the driver that DRAWS there: the client's own UI
* (OpenGL through the runtime's Zink), every game the client launches (D3D through Proton's
* DXVK/VKD3D) and everything on the desktop. Putting the frame on the screen stays the Android
* driver's job, in the app's compositor ({@link TurnipDriver}).
@@ -242,7 +242,7 @@ object AppImageManager {
private fun menuEntry(context: Context, id: String) =
// A system directory, not ~/.local/share/applications: the desktop copies game entries from
// here into the user's with a GPU launcher (droiddeck-desktop-gpu) while it runs on pixman.
// here into the user's with a GPU launcher (droiddeck-desktop-gpu), since it composites in software.
File(LinuxRuntime.rootDir(context), "usr/local/share/applications/droiddeck-appimage-$id.desktop")
/** The Linux desktop's menu entry: the desktop's own Exec rules (and droiddeck-gpu) apply to it. */
@@ -232,10 +232,10 @@ object BwrapSpawner {
val driver = File(lib, "libvulkan_freedreno.so")
if (!driver.isFile || !File("/dev/kgsl-3d0").exists()) return null
if (env.containsKey("VK_ICD_FILENAMES") || env.containsKey("VK_DRIVER_FILES")) return null
// A window on the desktop while labwc composites with pixman gets shared-memory buffers
// only; Zink cannot present there, so such an app keeps Flathub's own Mesa (llvmpipe).
// From the desktop, games go through droiddeck-gpu's gamescope and do get the GPU.
if (env["WLR_RENDERER"] == "pixman" && env["GAMESCOPE_WAYLAND_DISPLAY"] == null) return null
// A window on the desktop gets shared-memory buffers only (KWin composites in software);
// Zink cannot present there, so such an app keeps Flathub's own Mesa (llvmpipe). From the
// desktop, games go through droiddeck-gpu's gamescope and do get the GPU.
if (env["BL_DESKTOP"] == "1" && env["GAMESCOPE_WAYLAND_DISPLAY"] == null) return null
val binds = ArrayList<Bind>()
for (name in listOf("libvulkan_freedreno.so", "libdisplay-info.so.3", "libSPIRV-Tools.so", "libSPIRV-Tools-opt.so")) {
val f = File(lib, name)
@@ -3,6 +3,7 @@ package com.droiddeck.launcher.runtime
import com.droiddeck.launcher.core.Hashes
import android.content.Context
import android.util.Log
import com.droiddeck.launcher.BuildConfig
import com.droiddeck.launcher.R
import com.droiddeck.launcher.core.Downloader
import com.droiddeck.launcher.core.FileUtils
@@ -74,10 +75,32 @@ object DesktopCatalog {
installed(context, PROTON_SEED_ID) == null &&
!File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/steamapps/appmanifest_4427310.acf").isFile
// labwc comes with the hosted desktop package itself (its launcher is staged by the app at
// every session, so it cannot tell whether the package is there); SessionFiles uses the same test.
fun desktopInstalled(context: Context): Boolean =
File(LinuxRuntime.rootDir(context), "usr/bin/labwc").isFile
/**
* The desktop: KDE Plasma (tools/desktop-kde). It replaced an LXQt/labwc package of id
* "desktop", which a runtime may still carry; that one does not count, so the first desktop
* after the update installs this one over it.
*/
const val DESKTOP_ID = "desktop-kde"
/**
* The desktop package this apk installs: pinned in tools/desktop-kde/release.env and published
* in DroidDeck-Components, not read from the catalog, so the desktop scripts staged by this
* apk always get the package they were made for.
*/
fun desktopEntry(context: Context) = Entry(
DESKTOP_ID, context.getString(R.string.content_linux_desktop), 1, BuildConfig.DESKTOP_KDE_TAG, "tar",
BuildConfig.DESKTOP_KDE_URL, BuildConfig.DESKTOP_KDE_SHA256, BuildConfig.DESKTOP_KDE_SIZE, "",
"", "",
)
// The desktop package installed to the end: KWin is there and the marker install() writes once
// the whole package is extracted. An install cut short (the app killed, storage full) leaves
// KWin without the marker, and the next desktop installs it again. The launcher is staged by
// the app at every session, so it cannot tell. SessionFiles uses the same test.
fun desktopInstalled(context: Context): Boolean = desktopInstalled(LinuxRuntime.rootDir(context))
fun desktopInstalled(root: File): Boolean =
File(root, "usr/bin/kwin_wayland").isFile && File(root, ".droiddeck-pkg-$DESKTOP_ID").isFile
/** Downloads, verifies and installs one package. Returns null on success, else a message. */
fun install(context: Context, entry: Entry, listener: LinuxRuntimeInstaller.ProgressListener?): String? {
@@ -111,7 +134,12 @@ object DesktopCatalog {
"Exec=env APPIMAGE_EXTRACT_AND_RUN=1 /opt/appimages/${entry.id}.AppImage\n" +
"Icon=${entry.icon}\nTerminal=false\nCategories=${entry.category};\n")
}
else -> if (!LinuxRuntimeInstaller.extract(context, download, root, listener)) return context.getString(R.string.deskpkg_extract_failed)
else -> {
// Not complete until written again at the end: a reinstall cut short must not
// leave the last install's marker saying it is.
marker(context, entry.id).delete()
if (!LinuxRuntimeInstaller.extract(context, download, root, listener)) return context.getString(R.string.deskpkg_extract_failed)
}
}
FileUtils.writeString(marker(context, entry.id), entry.version)
return null
@@ -5,6 +5,7 @@ import android.os.Environment
import android.util.Log
import com.droiddeck.launcher.R
import com.droiddeck.launcher.core.FileUtils
import com.droiddeck.launcher.runtime.DesktopCatalog
import com.droiddeck.launcher.runtime.LegacyNames
import com.droiddeck.launcher.runtime.LinuxRuntime
import com.droiddeck.launcher.runtime.ProotFastPath
@@ -86,16 +87,15 @@ object SessionFiles {
"usr/bin/steamos-polkit-helpers/jupiter-biosupdate" to "usr/bin/steamos-polkit-helpers/jupiter-biosupdate",
"usr/bin/steamos-polkit-helpers/jupiter-dock-updater" to "usr/bin/steamos-polkit-helpers/jupiter-dock-updater",
)
// The desktop's launcher and labwc defaults, only where the desktop package is installed:
// The desktop's launchers, only where the desktop package is installed:
// staging them into a runtime without it would make the desktop look present when it is not.
val desktop = arrayOf(
"usr/local/bin/droiddeck-desktop" to "usr/local/bin/droiddeck-desktop",
// Games and emulators from the menu, full screen in a gamescope of their own.
"usr/local/bin/droiddeck-gpu" to "usr/local/bin/droiddeck-gpu",
"usr/local/bin/droiddeck-desktop-gpu" to "usr/local/bin/droiddeck-desktop-gpu",
"etc/xdg/labwc/autostart" to "etc/xdg/labwc/autostart",
"etc/xdg/labwc/rc.xml" to "etc/xdg/labwc/rc.xml",
"etc/xdg/lxqt/panel.conf" to "etc/xdg/lxqt/panel.conf",
// KWin at the app's surface size, for Plasma's session (it starts KWin through this name).
"usr/local/bin/kwin_wayland_wrapper" to "usr/local/bin/kwin_wayland_wrapper",
"usr/lib/firefox/defaults/pref/droiddeck.js" to "usr/lib/firefox/defaults/pref/droiddeck.js",
)
// The patched gamescope (tools/gamescope): the runtime's own version rebuilt with the ARM64
@@ -116,10 +116,6 @@ object SessionFiles {
val msitools = listOf("msiinfo", "cabextract", "libmsi-1.0.so.0", "libgsf-1.so.114", "libgcab-1.0.so.0")
.map { "usr/local/lib/droiddeck-msitools/$it" } +
listOf("NOTICE", "GPL-2", "GPL-3", "LGPL-2.1").map { "usr/local/share/licenses/droiddeck-msitools/$it" }
// The patched wlroots (tools/wlroots) the desktop loads for its vulkan / gles2 renderers.
val wlroots = if (File(root, "usr/bin/labwc").isFile) {
arrayOf("usr/local/lib/droiddeck-wlroots/libwlroots-0.20.so" to "usr/local/lib/droiddeck-wlroots/libwlroots-0.20.so")
} else emptyArray()
val fexPreloads = listOf("x86_64", "i386").flatMap { arch ->
listOf("libblsession.so", "libfakeinput.so").map { "$arch/$it" to "usr/local/lib/droiddeck-fex/$arch/$it" }
} + listOf("libfaultreport.so", "libthunkaudit.so", "libvulkan-thunk.so").map { "x86_64/$it" to "usr/local/lib/droiddeck-fex/x86_64/$it" }
@@ -127,11 +123,11 @@ object SessionFiles {
"usr/local/bin/gamescope" to "usr/local/bin/gamescope",
"usr/local/lib/droiddeck/uruntime" to "usr/local/lib/droiddeck/uruntime",
"usr/local/share/licenses/uruntime/LICENSE" to "usr/local/share/licenses/uruntime/LICENSE",
) + wlroots + mangoapp + msitools.map { it to it } + fexPreloads).filter { (asset, _) ->
) + mangoapp + msitools.map { it to it } + fexPreloads).filter { (asset, _) ->
val dir = asset.substringBeforeLast('/')
runCatching { context.assets.list("linuxfs/$dir")?.contains(asset.substringAfterLast('/')) == true }.getOrDefault(false)
}
val all = (if (File(root, "usr/bin/labwc").isFile) files + desktop else files) + optional
val all = (if (DesktopCatalog.desktopInstalled(root)) files + desktop else files) + optional
for ((asset, relative) in all) {
val target = File(root, relative)
val staged = File(target.parentFile, target.name + ".staged")
@@ -19,7 +19,7 @@ import java.util.Locale
* wayland.log the app's compositor
* steam.log the Steam client's own log, scrubbed (Steam mode)
* steam/ the rest of the client's logs, scrubbed (Steam mode)
* desktop.log labwc, the panel and the programs on it (desktop mode)
* desktop.log KWin, Plasma and the programs on it (desktop mode)
* Download/DroidDeck/tools/ one-off commands: Flatpak installs, AppImage imports
* ```
*
@@ -634,21 +634,6 @@ object SessionPrefs {
return Pair(w and 1.inv(), h and 1.inv())
}
/**
* What the desktop shell composites with: vulkan (the default) or gles2 on the GPU, through the
* app's patched wlroots (tools/wlroots) - the Adreno stand-in is not a DRM device and stock
* wlroots cannot allocate on it - or pixman in software. A GPU renderer a device cannot start
* falls back to pixman by itself (droiddeck-desktop). `Download/droiddeck-wlr-renderer` still
* overrides it.
*/
fun desktopRenderer(context: Context): String = prefs(context).getString("desktopRenderer", "vulkan") ?: "vulkan"
fun setDesktopRenderer(context: Context, renderer: String) {
prefs(context).edit().putString("desktopRenderer", renderer).apply()
// A choice made again is a retry: forget that a renderer failed to start here before.
java.io.File(com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context), "root/.droiddeck-renderer-failed").delete()
}
/**
* HDR10 output for MODE_STEAM / MODE_DESKTOP. Off by default. Honoured only when the panel
* lists HDR10 (HdrSupport), and decided when the compositor starts, which is once per app
@@ -372,16 +372,6 @@ class SessionService : Service() {
SessionState.deckPad = false
deckBinds = emptyList()
if (controllersOn) addControllerEnvironment(guest, fakeInputDir, sessionDir)
// The desktop is wlroots (labwc). Stock wlroots allocates through gbm on a real DRM render
// node, and ours is a KGSL stand-in - labwc died at "unable to create allocator" - so the
// default is pixman (software, shm), where a Vulkan program cannot draw at all; those run
// through droiddeck-gpu instead. vulkan / gles2 use the app's patched wlroots and fall back
// to pixman by themselves. droiddeck-wlr-renderer in Downloads overrides the choice.
if (SessionState.mode == MODE_DESKTOP) {
val override = File(Environment.getExternalStorageDirectory(), "Download/droiddeck-wlr-renderer")
.takeIf { it.isFile }?.let { FileUtils.readString(it)?.trim() }
guest.add("BL_WLR_RENDERER=" + (override?.takeIf { it.isNotEmpty() } ?: SessionPrefs.desktopRenderer(this)))
}
// The user's own games, for the runtime's shortcuts writer to put in the client's library
// before the client starts (see frontend/AddedGames and droiddeck-steam-shortcuts).
if (steamHere) {
@@ -397,9 +387,6 @@ class SessionService : Service() {
// The second library's name, for droiddeck-steam-library; the bind itself is made below.
GameStorage.effective(this)?.let { guest.add("BL_LIBRARY_LABEL=" + it.label.replace('"', ' ')) }
if (SessionState.mode == MODE_STEAM && SessionState.steamUi == "desktop") guest.add("BL_STEAM_UI=desktop")
// The desktop asked for with Steam in it (the front end's "Steam Desktop UI", Big Picture's
// "Switch to Desktop"): the desktop's autostart opens the client's desktop UI there.
if (SessionState.mode == MODE_DESKTOP && SessionState.steamUi == "desktop") guest.add("BL_DESKTOP_STEAM=1")
val shellGuest = ArrayList(guest).apply {
add("SHELL=/bin/bash")
add("TERM=xterm-256color")
@@ -415,7 +402,7 @@ class SessionService : Service() {
}
// A program under gamescope: the script's run mode takes the path (an AppImage, a script
// or a binary inside the runtime). This is how an emulator gets the GPU - the desktop's
// labwc composites in software and offers no dma-buf, so a Vulkan swapchain cannot exist
// KWin composites in software and offers no dma-buf, so a Vulkan swapchain cannot exist
// there (RPCS3 died with VK_ERROR_SURFACE_LOST); gamescope's Xwayland is the path the
// Steam games already render through.
if (SessionState.mode == MODE_RUN) {
@@ -76,7 +76,6 @@ class ModeSettings(
val backActionsInverted: Boolean = false,
val directAudio: Boolean?,
val mic: Boolean?,
val renderer: String?,
val gameStorage: String? = null,
val storageOptions: List<com.droiddeck.launcher.session.GameStorage.Option> = emptyList(),
/** Steam only: record allocation and sampled storage timings in the next session's Share logs. */
@@ -140,7 +139,6 @@ class ModeSettingsActions(
val onBackActionsInverted: (Boolean) -> Unit = {},
val onDirectAudio: (Boolean) -> Unit,
val onMic: (Boolean) -> Unit,
val onRenderer: (String) -> Unit,
val onGameStorage: (path: String, label: String) -> Unit = { _, _ -> },
val onPickGameStorageFolder: () -> Unit = {},
val onStorageDiagnostics: (Boolean) -> Unit = {},
@@ -528,14 +526,6 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
onChange = a.onStorageDiagnostics,
)
}
if (!steam && tab == ModeSettingsTab.DISPLAY && s.renderer != null) SettingsGroup(stringResource(R.string.mode_renderer)) {
ChoiceRow(
host, "renderer", stringResource(R.string.mode_desktop_renderer), stringResource(R.string.mode_renderer_hint),
listOf("vulkan" to stringResource(R.string.mode_renderer_vulkan), "gles2" to stringResource(R.string.mode_renderer_gles2), "pixman" to stringResource(R.string.mode_renderer_pixman)), s.renderer,
note = stringResource(R.string.mode_renderer_note),
onPick = a.onRenderer,
)
}
}
if (explainWifiDiscovery) AlertDialog(
onDismissRequest = { explainWifiDiscovery = false },
@@ -314,7 +314,7 @@ public final class WaylandCompositor {
/** A new output size for a running compositor ("Follow screen": a foldable opening or closing).
* The compositor thread re-sends the wl_output mode and an xdg_toplevel configure to every
* client, and gamescope / labwc resize their output to it. Any thread. */
* client, and gamescope / the desktop's KWin resize their output to it. Any thread. */
public static native void nativeResizeOutput(int width, int height);
/** Re-arms the one-shot first-frame notice, for a new session under a compositor that has