mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-04 20:15:44 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c197a017e6 | ||
|
|
15e8a57fc0 | ||
|
|
cd4f02d0b0 | ||
|
|
bf14487872 | ||
|
|
8035963559 | ||
|
|
cf556596f0 | ||
|
|
7f1a743733 | ||
|
|
6a9c5da0d0 |
No files matched your search
+2
-2
@@ -79,8 +79,8 @@ android {
|
||||
// file out of its own data directory, and this app's entire job is to exec a rootfs:
|
||||
// proot, gamescope, the Steam client and everything it launches all live under files/.
|
||||
targetSdkVersion 28
|
||||
versionCode 11
|
||||
versionName "0.3.1"
|
||||
versionCode 10
|
||||
versionName "0.3.0"
|
||||
buildConfigField "String", "BUILD_LABEL", "\"${escapedBuildLabel}\""
|
||||
buildConfigField "String", "SOURCE_COMMIT", "\"${sourceCommit}\""
|
||||
buildConfigField "int", "PR_NUMBER", "${prNumber}"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application>
|
||||
<!-- Debug builds only. Android grants DUMP to adb shell; release APKs have no bridge. -->
|
||||
<activity
|
||||
android:name=".agent.AgentStartActivity"
|
||||
android:exported="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:noHistory="true"
|
||||
android:permission="android.permission.DUMP"
|
||||
android:theme="@style/SessionTheme" />
|
||||
<provider
|
||||
android:name=".agent.AgentBridgeProvider"
|
||||
android:authorities="${applicationId}.agent"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.DUMP"
|
||||
android:grantUriPermissions="false" />
|
||||
</application>
|
||||
</manifest>
|
||||
File renamed without changes.
File renamed without changes.
@@ -71,10 +71,6 @@
|
||||
<action android:name="android.intent.action.CREATE_SHORTCUT" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.droiddeck.launcher.LAUNCH_GAME" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- Android owns the Home key. This small translucent Home handler routes the resulting
|
||||
@@ -127,14 +123,6 @@
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:theme="@style/AppTheme" />
|
||||
|
||||
<activity
|
||||
android:name=".agent.AgentStartActivity"
|
||||
android:exported="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:noHistory="true"
|
||||
android:permission="android.permission.DUMP"
|
||||
android:theme="@style/SessionTheme" />
|
||||
|
||||
<activity
|
||||
android:name=".SessionActivity"
|
||||
android:exported="false"
|
||||
@@ -185,11 +173,5 @@
|
||||
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
|
||||
</intent-filter>
|
||||
</provider>
|
||||
<provider
|
||||
android:name=".agent.AgentBridgeProvider"
|
||||
android:authorities="${applicationId}.agent"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.DUMP"
|
||||
android:grantUriPermissions="false" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -44,11 +44,6 @@ add_subdirectory(waylandcomp)
|
||||
add_library(sdnative SHARED sdnative/sdnative.c)
|
||||
target_link_libraries(sdnative log)
|
||||
|
||||
# The device info window's Vulkan section: the phone's own driver, asked once through the system
|
||||
# loader (opened with dlopen, so a phone without Vulkan still loads the app).
|
||||
add_library(deviceinfo SHARED deviceinfo/vkinfo.c)
|
||||
target_link_libraries(deviceinfo dl)
|
||||
|
||||
# Rebuild Termux terminal-emulator's PTY JNI helper with the app's NDK instead of carrying its
|
||||
# prebuilt libtermux.so with a redundant libstdc++.so dependency.
|
||||
add_library(termux SHARED termux/termux.c)
|
||||
@@ -1,112 +0,0 @@
|
||||
// What the phone's own Vulkan driver says about its GPU, for the app's device info window: one
|
||||
// instance on the system loader, the first physical device's properties, a few limits and the
|
||||
// extensions DXVK and VKD3D-Proton lean on. Returned as "key=value" lines; nothing is kept open.
|
||||
#include <dlfcn.h>
|
||||
#include <jni.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#define VK_NO_PROTOTYPES
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#define LINE(...) do { if (used < sizeof(out)) used += snprintf(out + used, sizeof(out) - used, __VA_ARGS__); } while (0)
|
||||
|
||||
static const char *const EXTENSIONS[] = {
|
||||
"VK_EXT_robustness2", "VK_EXT_transform_feedback", "VK_EXT_custom_border_color",
|
||||
"VK_KHR_dynamic_rendering", "VK_EXT_extended_dynamic_state3", "VK_EXT_descriptor_indexing",
|
||||
"VK_KHR_timeline_semaphore", "VK_EXT_mesh_shader", "VK_KHR_ray_query",
|
||||
};
|
||||
|
||||
static const char *type_name(VkPhysicalDeviceType type) {
|
||||
switch (type) {
|
||||
case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU: return "integrated GPU";
|
||||
case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU: return "discrete GPU";
|
||||
case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU: return "virtual GPU";
|
||||
case VK_PHYSICAL_DEVICE_TYPE_CPU: return "CPU";
|
||||
default: return "other";
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_droiddeck_launcher_gpu_VulkanInfo_nativeQuery(JNIEnv *env, jclass clazz) {
|
||||
static char out[4096];
|
||||
size_t used = 0;
|
||||
out[0] = 0;
|
||||
void *lib = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
|
||||
if (!lib) { LINE("error=no Vulkan loader\n"); return (*env)->NewStringUTF(env, out); }
|
||||
PFN_vkGetInstanceProcAddr gipa = (PFN_vkGetInstanceProcAddr) dlsym(lib, "vkGetInstanceProcAddr");
|
||||
PFN_vkCreateInstance create = gipa ? (PFN_vkCreateInstance) gipa(NULL, "vkCreateInstance") : NULL;
|
||||
PFN_vkEnumerateInstanceVersion instanceVersion = gipa ? (PFN_vkEnumerateInstanceVersion) gipa(NULL, "vkEnumerateInstanceVersion") : NULL;
|
||||
if (!create) { LINE("error=no vkCreateInstance\n"); dlclose(lib); return (*env)->NewStringUTF(env, out); }
|
||||
uint32_t loader = VK_API_VERSION_1_0;
|
||||
if (instanceVersion) instanceVersion(&loader);
|
||||
LINE("loader=%u.%u.%u\n", VK_API_VERSION_MAJOR(loader), VK_API_VERSION_MINOR(loader), VK_API_VERSION_PATCH(loader));
|
||||
|
||||
VkApplicationInfo app = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pApplicationName = "DroidDeck device info",
|
||||
.apiVersion = loader >= VK_API_VERSION_1_1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0 };
|
||||
VkInstanceCreateInfo info = { .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, .pApplicationInfo = &app };
|
||||
VkInstance instance = VK_NULL_HANDLE;
|
||||
if (create(&info, NULL, &instance) != VK_SUCCESS) { LINE("error=vkCreateInstance failed\n"); dlclose(lib); return (*env)->NewStringUTF(env, out); }
|
||||
|
||||
#define GET(name) PFN_##name name = (PFN_##name) gipa(instance, #name)
|
||||
GET(vkDestroyInstance); GET(vkEnumeratePhysicalDevices); GET(vkGetPhysicalDeviceProperties);
|
||||
GET(vkGetPhysicalDeviceProperties2); GET(vkGetPhysicalDeviceMemoryProperties);
|
||||
GET(vkEnumerateDeviceExtensionProperties); GET(vkGetPhysicalDeviceFeatures);
|
||||
uint32_t count = 1;
|
||||
VkPhysicalDevice device = VK_NULL_HANDLE;
|
||||
VkResult listed = vkEnumeratePhysicalDevices ? vkEnumeratePhysicalDevices(instance, &count, &device) : VK_ERROR_INITIALIZATION_FAILED;
|
||||
if ((listed != VK_SUCCESS && listed != VK_INCOMPLETE) || count == 0 || !device || !vkGetPhysicalDeviceProperties) {
|
||||
LINE("error=no Vulkan device\n");
|
||||
} else {
|
||||
VkPhysicalDeviceProperties p;
|
||||
vkGetPhysicalDeviceProperties(device, &p);
|
||||
LINE("device=%s\n", p.deviceName);
|
||||
LINE("type=%s\n", type_name(p.deviceType));
|
||||
LINE("api=%u.%u.%u\n", VK_API_VERSION_MAJOR(p.apiVersion), VK_API_VERSION_MINOR(p.apiVersion), VK_API_VERSION_PATCH(p.apiVersion));
|
||||
// Qualcomm packs its driver version as 10.10.12 bits, the same layout as VK_MAKE_VERSION.
|
||||
LINE("driver_version=%u.%u.%u\n", p.driverVersion >> 22, (p.driverVersion >> 12) & 0x3ff, p.driverVersion & 0xfff);
|
||||
LINE("vendor_id=0x%04x\ndevice_id=0x%08x\n", p.vendorID, p.deviceID);
|
||||
LINE("max_image_2d=%u\n", p.limits.maxImageDimension2D);
|
||||
|
||||
// Driver name and build string (Vulkan 1.2 or VK_KHR_driver_properties).
|
||||
uint32_t extCount = 0;
|
||||
if (vkEnumerateDeviceExtensionProperties) vkEnumerateDeviceExtensionProperties(device, NULL, &extCount, NULL);
|
||||
static VkExtensionProperties exts[512];
|
||||
if (extCount > 512) extCount = 512;
|
||||
if (extCount && vkEnumerateDeviceExtensionProperties) vkEnumerateDeviceExtensionProperties(device, NULL, &extCount, exts);
|
||||
int driverProps = p.apiVersion >= VK_API_VERSION_1_2;
|
||||
for (uint32_t i = 0; i < extCount; i++)
|
||||
if (!strcmp(exts[i].extensionName, "VK_KHR_driver_properties")) driverProps = 1;
|
||||
if (driverProps && vkGetPhysicalDeviceProperties2) {
|
||||
VkPhysicalDeviceDriverProperties driver = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES };
|
||||
VkPhysicalDeviceProperties2 p2 = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, .pNext = &driver };
|
||||
vkGetPhysicalDeviceProperties2(device, &p2);
|
||||
LINE("driver_name=%s\n", driver.driverName);
|
||||
LINE("driver_info=%s\n", driver.driverInfo);
|
||||
LINE("conformance=%u.%u.%u.%u\n", driver.conformanceVersion.major, driver.conformanceVersion.minor,
|
||||
driver.conformanceVersion.subminor, driver.conformanceVersion.patch);
|
||||
}
|
||||
LINE("extension_count=%u\n", extCount);
|
||||
for (size_t e = 0; e < sizeof(EXTENSIONS) / sizeof(*EXTENSIONS); e++) {
|
||||
int has = 0;
|
||||
for (uint32_t i = 0; i < extCount && !has; i++) has = !strcmp(exts[i].extensionName, EXTENSIONS[e]);
|
||||
LINE("ext.%s=%s\n", EXTENSIONS[e], has ? "yes" : "no");
|
||||
}
|
||||
if (vkGetPhysicalDeviceFeatures) {
|
||||
VkPhysicalDeviceFeatures f;
|
||||
vkGetPhysicalDeviceFeatures(device, &f);
|
||||
LINE("geometry_shader=%s\ntessellation_shader=%s\ntexture_bc=%s\n",
|
||||
f.geometryShader ? "yes" : "no", f.tessellationShader ? "yes" : "no", f.textureCompressionBC ? "yes" : "no");
|
||||
}
|
||||
if (vkGetPhysicalDeviceMemoryProperties) {
|
||||
VkPhysicalDeviceMemoryProperties m;
|
||||
vkGetPhysicalDeviceMemoryProperties(device, &m);
|
||||
VkDeviceSize largest = 0;
|
||||
for (uint32_t i = 0; i < m.memoryHeapCount; i++)
|
||||
if ((m.memoryHeaps[i].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) && m.memoryHeaps[i].size > largest) largest = m.memoryHeaps[i].size;
|
||||
LINE("device_heap_mb=%llu\n", (unsigned long long) (largest >> 20));
|
||||
}
|
||||
}
|
||||
if (vkDestroyInstance) vkDestroyInstance(instance, NULL);
|
||||
dlclose(lib);
|
||||
return (*env)->NewStringUTF(env, out);
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import com.droiddeck.launcher.session.ProtonDefault
|
||||
*/
|
||||
internal class ComponentsMenu(private val activity: android.app.Activity, private val ui: android.os.Handler) {
|
||||
var compSnapshot by mutableStateOf<ComponentsManager.Snapshot?>(null)
|
||||
var defaultProtonId by mutableStateOf<String?>(null)
|
||||
var compCatalog by mutableStateOf<List<ComponentsManager.CatalogItem>>(emptyList())
|
||||
var compCatalogAt by mutableStateOf(0L)
|
||||
var compProton by mutableStateOf<String?>(null)
|
||||
@@ -21,7 +22,6 @@ internal class ComponentsMenu(private val activity: android.app.Activity, privat
|
||||
var compChecking by mutableStateOf(false)
|
||||
var compBusy by mutableStateOf<String?>(null)
|
||||
var compDownloads by mutableStateOf<Map<String, Int>>(emptyMap())
|
||||
private var shownDefault: String? = null
|
||||
|
||||
/** Reads the Protons (and on first open saves their originals) off the UI thread; the Nightlies list comes from its cache. */
|
||||
fun refreshComponents(snapshotFirst: Boolean = false) {
|
||||
@@ -33,11 +33,9 @@ internal class ComponentsMenu(private val activity: android.app.Activity, privat
|
||||
val chosen = snap?.let { s -> runCatching { ProtonDefault.selectedId(activity, s.protons.map { it.proton }) }.getOrNull() }
|
||||
ui.post {
|
||||
compSnapshot = snap ?: ComponentsManager.Snapshot(emptyList(), emptyList())
|
||||
defaultProtonId = chosen
|
||||
if (cat != null && cat.fetchedAt > 0) { compCatalog = cat.items; compCatalogAt = cat.fetchedAt }
|
||||
if (chosen != null && chosen != shownDefault) {
|
||||
shownDefault = chosen
|
||||
compProton = chosen
|
||||
} else if (compProton == null || snap?.protons?.none { it.proton.id == compProton } == true) {
|
||||
if (compProton == null || snap?.protons?.none { it.proton.id == compProton } == true) {
|
||||
compProton = chosen ?: snap?.protons?.firstOrNull()?.proton?.id
|
||||
}
|
||||
}
|
||||
@@ -46,7 +44,6 @@ internal class ComponentsMenu(private val activity: android.app.Activity, privat
|
||||
|
||||
fun chooseProton(id: String) {
|
||||
val proton = compSnapshot?.protons?.firstOrNull { it.proton.id == id }?.proton ?: return
|
||||
compProton = id
|
||||
Thread({
|
||||
val message = runCatching {
|
||||
when (ProtonDefault.request(activity, proton)) {
|
||||
@@ -55,7 +52,10 @@ internal class ComponentsMenu(private val activity: android.app.Activity, privat
|
||||
ProtonDefault.Outcome.NOT_RUNNABLE -> activity.getString(R.string.comp_default_not_runnable, proton.name)
|
||||
}
|
||||
}.getOrElse { e -> activity.getString(R.string.comp_default_failed, e.message ?: e.javaClass.simpleName) }
|
||||
ui.post { android.widget.Toast.makeText(activity, message, android.widget.Toast.LENGTH_LONG).show() }
|
||||
ui.post {
|
||||
android.widget.Toast.makeText(activity, message, android.widget.Toast.LENGTH_LONG).show()
|
||||
refreshComponents()
|
||||
}
|
||||
}, "components-default").start()
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ import com.droiddeck.launcher.ui.ComponentsPage
|
||||
import com.droiddeck.launcher.session.GameSaves
|
||||
import com.droiddeck.launcher.session.SessionLogShare
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.session.SteamRepair
|
||||
import com.droiddeck.launcher.ui.ProtonPage
|
||||
import com.droiddeck.launcher.core.CpuCores
|
||||
import com.droiddeck.launcher.core.PhantomProcessLimit
|
||||
@@ -52,7 +51,6 @@ import com.droiddeck.launcher.core.WifiDiscovery
|
||||
import com.droiddeck.launcher.core.WirelessAdbPairingService
|
||||
import com.droiddeck.launcher.ui.CoreRow
|
||||
import com.droiddeck.launcher.ui.PerformancePage
|
||||
import com.droiddeck.launcher.ui.ModeSettingsPage
|
||||
import com.droiddeck.launcher.ui.ModeSettings
|
||||
import com.droiddeck.launcher.ui.ModeSettingsActions
|
||||
import com.droiddeck.launcher.ui.ConfirmDialog
|
||||
@@ -61,13 +59,16 @@ import com.droiddeck.launcher.ui.ControllerMappingPage
|
||||
import com.droiddeck.launcher.input.ControllerPrefs
|
||||
import com.droiddeck.launcher.input.ControllerEditorActivity
|
||||
import com.droiddeck.launcher.ui.FrontEndScreen
|
||||
import com.droiddeck.launcher.ui.SettingsCategory
|
||||
import com.droiddeck.launcher.ui.SettingsDestination
|
||||
import com.droiddeck.launcher.ui.SettingsHistory
|
||||
import com.droiddeck.launcher.ui.SettingsCategoryPage
|
||||
import com.droiddeck.launcher.ui.ModeSettingsContent
|
||||
import com.droiddeck.launcher.ui.MenuHost
|
||||
import com.droiddeck.launcher.ui.FrontEndState
|
||||
import com.droiddeck.launcher.ui.FrontEndActions
|
||||
import com.droiddeck.launcher.frontend.CoverArt
|
||||
import com.droiddeck.launcher.frontend.Library
|
||||
import com.droiddeck.launcher.frontend.GameFiles
|
||||
import com.droiddeck.launcher.frontend.GameFileSync
|
||||
import com.droiddeck.launcher.frontend.GameLaunchIntent
|
||||
import com.droiddeck.launcher.ui.DroidDeckTheme
|
||||
import com.droiddeck.launcher.ui.RomsDialog
|
||||
import com.droiddeck.launcher.files.InAppFilePicker
|
||||
@@ -114,14 +115,13 @@ class MainActivity : ComponentActivity() {
|
||||
private var glThread by mutableStateOf(true)
|
||||
private var noGlError by mutableStateOf(true)
|
||||
private var steamDeckMode by mutableStateOf(false)
|
||||
private var steamRepairQueued by mutableStateOf(false)
|
||||
private var mangoapp by mutableStateOf(true)
|
||||
private var steamController by mutableStateOf(SessionPrefs.CONTROLLER_DECK)
|
||||
private var showProtons by mutableStateOf(false)
|
||||
private val showProtons get() = settingsHistory.current is SettingsDestination.Protons
|
||||
// Components page: FEX / DXVK / VKD3D-Proton per Proton (ComponentsManager).
|
||||
private var showComponents by mutableStateOf(false)
|
||||
private val showComponents get() = settingsHistory.current is SettingsDestination.Components
|
||||
private var focusComponentsContent by mutableStateOf(true)
|
||||
private var showMapping by mutableStateOf(false)
|
||||
private val showMapping get() = settingsHistory.current is SettingsDestination.Mapping
|
||||
private var saveBusy: String? = null
|
||||
/** What to do with the zip or folder the file picker hands back after a game page's Manage saves. */
|
||||
private var onSavePicked: ((File) -> Unit)? = null
|
||||
@@ -135,7 +135,7 @@ class MainActivity : ComponentActivity() {
|
||||
private var desktopInstalled by mutableStateOf(false)
|
||||
private var offlineAccount by mutableStateOf<String?>(null)
|
||||
private var offline by mutableStateOf(false)
|
||||
private var showPerformance by mutableStateOf(false)
|
||||
private val showPerformance get() = settingsHistory.current is SettingsDestination.Performance
|
||||
private var clientOverride by mutableStateOf(false)
|
||||
private var clientCores by mutableStateOf<Set<Int>>(emptySet())
|
||||
private var gameCores by mutableStateOf<Set<Int>>(emptySet())
|
||||
@@ -155,7 +155,7 @@ class MainActivity : ComponentActivity() {
|
||||
private var showPhantomGate by mutableStateOf(false)
|
||||
private var directAudio by mutableStateOf(false)
|
||||
private var clientDirectAudio by mutableStateOf(false)
|
||||
private var forceFullscreen by mutableStateOf(false)
|
||||
private var forceFullscreen by mutableStateOf(true)
|
||||
private var stretch16x9 by mutableStateOf(false)
|
||||
private var launcherFullscreen by mutableStateOf(true)
|
||||
private var animationsEnabled by mutableStateOf(true)
|
||||
@@ -308,13 +308,16 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
// The mode whose settings dialog is open, with what it shows; refreshed by openModeSettings().
|
||||
private var settingsMode by mutableStateOf<String?>(null)
|
||||
private var resolution by mutableStateOf(com.droiddeck.launcher.session.SessionDisplay.DEFAULT_RESOLUTION)
|
||||
private var settingsHistory by mutableStateOf(SettingsHistory())
|
||||
private val settingsMode get() = (settingsHistory.current as? SettingsDestination.Category)?.mode
|
||||
private var requestedRailTab by mutableStateOf<String?>(null)
|
||||
private var resolutionCap by mutableStateOf(1080)
|
||||
private var customResolution by mutableStateOf<Pair<Int, Int>?>(null)
|
||||
private var fexPreset by mutableStateOf("")
|
||||
private var steamChannel by mutableStateOf("steamdeck_publicbeta")
|
||||
private var runSteamAtStartup by mutableStateOf(false)
|
||||
private var theme by mutableStateOf("graphite")
|
||||
private var appScale by mutableStateOf(com.droiddeck.launcher.core.AppUiPrefs.DEFAULT_SCALE)
|
||||
private var shapeMode by mutableStateOf(SessionPrefs.SHAPE_AUTO)
|
||||
private var hdrOn by mutableStateOf(false)
|
||||
private var fpsLimit by mutableStateOf(0)
|
||||
private var upscaler by mutableStateOf(0)
|
||||
@@ -402,15 +405,10 @@ class MainActivity : ComponentActivity() {
|
||||
private fun pickGameExport(game: Library.SteamGame?) {
|
||||
onSavePicked = { folder ->
|
||||
saveAction(getString(R.string.game_frontend_files)) {
|
||||
val saved = if (game != null) GameFiles.export(folder, game)
|
||||
else {
|
||||
GameFileSync.enable(this, folder)
|
||||
folder
|
||||
}
|
||||
ui.post {
|
||||
gameSyncFolder = GameFileSync.folder(this)
|
||||
}
|
||||
getString(R.string.game_file_exported, saved.path)
|
||||
if (game != null) com.droiddeck.launcher.frontend.GameFiles.export(folder, game)
|
||||
else com.droiddeck.launcher.frontend.GameFileSync.enable(this, folder)
|
||||
ui.post { gameSyncFolder = com.droiddeck.launcher.frontend.GameFileSync.folder(this) }
|
||||
getString(R.string.game_file_exported, folder.path)
|
||||
}
|
||||
}
|
||||
pickSaveDir.launch(InAppFilePicker.buildDirIntent(this, getString(R.string.game_file_folder), gameSyncFolder))
|
||||
@@ -424,10 +422,10 @@ class MainActivity : ComponentActivity() {
|
||||
shortcutLibraryScanning = true
|
||||
} else shortcutLibraryScanning = false
|
||||
pendingGameLink = null
|
||||
if (GameLaunchIntent.accepts(request.action)) {
|
||||
if (request.action == Intent.ACTION_VIEW) {
|
||||
val copy = Intent(request)
|
||||
Thread({
|
||||
val id = GameLaunchIntent.read(this, copy)
|
||||
val id = com.droiddeck.launcher.frontend.GameFiles.readIntent(this, copy)
|
||||
ui.post {
|
||||
if (intent === request && !isDestroyed) {
|
||||
pendingGameLink = id
|
||||
@@ -440,7 +438,7 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun launchGame(game: Library.SteamGame, returnHome: Boolean = false): Boolean {
|
||||
private fun launchGame(game: Library.SteamGame): Boolean {
|
||||
if (protons.protonBusyId != null || ProtonExtras.installInProgress || pkgStage != null) {
|
||||
android.widget.Toast.makeText(this, "Wait for the install to finish before launching a game", android.widget.Toast.LENGTH_SHORT).show()
|
||||
return false
|
||||
@@ -455,12 +453,10 @@ class MainActivity : ComponentActivity() {
|
||||
return false
|
||||
}
|
||||
startActivity(Intent(this, SessionActivity::class.java).setAction(SessionService.ACTION_RESUME)
|
||||
.putExtra(SessionActivity.EXTRA_RETURN_HOME, returnHome)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP))
|
||||
return true
|
||||
}
|
||||
return startSession(Intent(this, SessionActivity::class.java)
|
||||
.putExtra(SessionActivity.EXTRA_RETURN_HOME, returnHome)
|
||||
.putExtra(SessionService.EXTRA_STEAM_URL,
|
||||
com.droiddeck.launcher.frontend.GameLaunchLink.steamUrl(game.gameIdString)), steamSession = true)
|
||||
}
|
||||
@@ -472,14 +468,10 @@ class MainActivity : ComponentActivity() {
|
||||
if (game == null) {
|
||||
pendingGameLink = null
|
||||
intent.data = null
|
||||
intent.action = Intent.ACTION_MAIN
|
||||
intent.removeExtra(GameLaunchIntent.EXTRA_APP_ID)
|
||||
android.widget.Toast.makeText(this, R.string.game_link_missing, android.widget.Toast.LENGTH_LONG).show()
|
||||
} else if (launchGame(game, returnHome = true)) {
|
||||
} else if (launchGame(game)) {
|
||||
pendingGameLink = null
|
||||
intent.data = null
|
||||
intent.action = Intent.ACTION_MAIN
|
||||
intent.removeExtra(GameLaunchIntent.EXTRA_APP_ID)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,11 +483,10 @@ class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
readGameIntent(intent)
|
||||
gameSyncFolder = GameFileSync.folder(this)
|
||||
gameSyncFolder = com.droiddeck.launcher.frontend.GameFileSync.folder(this)
|
||||
displayManager = getSystemService(DISPLAY_SERVICE) as DisplayManager
|
||||
refreshPhantomStatus()
|
||||
theme = SessionPrefs.theme(this)
|
||||
appScale = com.droiddeck.launcher.core.AppUiPrefs.scale(this)
|
||||
// Last start's game list, so the Steam wall is up on the first frame; refresh() replaces it.
|
||||
steamGames = if (shortcutPicker) emptyList() else com.droiddeck.launcher.frontend.LibraryCache.load(this)
|
||||
backActionsInverted = SessionPrefs.backActionsInverted(this)
|
||||
@@ -505,11 +496,11 @@ class MainActivity : ComponentActivity() {
|
||||
applyLauncherFullscreen()
|
||||
updates.start()
|
||||
setContent {
|
||||
DroidDeckTheme(theme, appScale = appScale) {
|
||||
DroidDeckTheme(theme) {
|
||||
com.droiddeck.launcher.ui.FocusGlideHost(androidx.compose.ui.Modifier.fillMaxSize()) {
|
||||
val sm = settingsMode
|
||||
val page: (@Composable () -> Unit)? = when {
|
||||
sm != null -> { { ModeSettingsHost(sm) } }
|
||||
sm != null -> null
|
||||
showPerformance -> { { PerformanceHost() } }
|
||||
showProtons -> { { ProtonHost() } }
|
||||
showComponents -> { { ComponentsHost() } }
|
||||
@@ -530,9 +521,14 @@ class MainActivity : ComponentActivity() {
|
||||
steamGames = steamGames, emulators = emulatorList, running = runningLabel,
|
||||
frameGen = FrameGen.mode(this),
|
||||
lossless = lossless,
|
||||
pageKey = sm?.let { "settings:$it" } ?: if (showPerformance) "performance" else if (showProtons) "protons" else if (showComponents) "components" else if (showMapping) "controller-mapping" else null,
|
||||
pageKey = settingsHistory.current?.key,
|
||||
settingsCategory = (settingsHistory.current as? SettingsDestination.Category)?.category,
|
||||
settingsMode = sm ?: SessionService.MODE_STEAM,
|
||||
settingsTarget = (settingsHistory.current as? SettingsDestination.Category)?.target
|
||||
?: (settingsHistory.current as? SettingsDestination.Performance)?.target
|
||||
?: (settingsHistory.current as? SettingsDestination.Components)?.target,
|
||||
requestedRailTab = requestedRailTab,
|
||||
theme = theme,
|
||||
appScale = appScale,
|
||||
isHomeApp = homeAppSelected,
|
||||
homeScreenEnabled = homeScreenEnabled,
|
||||
defaultHomeLabel = defaultHomeLabel,
|
||||
@@ -570,7 +566,7 @@ class MainActivity : ComponentActivity() {
|
||||
onSyncGameFiles = { pickGameExport(null) },
|
||||
onStopGameFileSync = {
|
||||
Thread({
|
||||
GameFileSync.disable(this)
|
||||
com.droiddeck.launcher.frontend.GameFileSync.disable(this)
|
||||
ui.post { gameSyncFolder = null }
|
||||
}, "game-file-stop-sync").start()
|
||||
},
|
||||
@@ -626,7 +622,7 @@ class MainActivity : ComponentActivity() {
|
||||
// A game page's Manage saves: the game's Proton and saves are read when the work runs, off the main thread.
|
||||
onSaveImport = { sg -> importSaves(sg.name) { GameSaves.game(sg) } },
|
||||
onSaveExport = { sg, layout -> exportSaves(sg.name, layout) { GameSaves.game(sg) } },
|
||||
onPerformance = { refreshCores(); showProtons = false; showComponents = false; showMapping = false; showPerformance = true },
|
||||
onPerformance = { refreshCores(); settingsHistory = settingsHistory.open(SettingsDestination.Performance()) },
|
||||
onRoms = { showRoms = true },
|
||||
onFiles = { startActivity(Intent(this, com.droiddeck.launcher.files.FileManagerActivity::class.java)) },
|
||||
onBrowseFiles = { dir ->
|
||||
@@ -660,12 +656,19 @@ class MainActivity : ComponentActivity() {
|
||||
OfflineMode.setEnabled(this, !OfflineMode.enabled(this))
|
||||
offline = OfflineMode.enabled(this)
|
||||
},
|
||||
onPageBack = { settingsMode = null; showPerformance = false; showProtons = false; showComponents = false; showMapping = false },
|
||||
onTheme = { id -> SessionPrefs.setTheme(this, id); theme = id },
|
||||
onAppScale = { percent ->
|
||||
com.droiddeck.launcher.core.AppUiPrefs.setScale(this, percent)
|
||||
appScale = com.droiddeck.launcher.core.AppUiPrefs.scale(this)
|
||||
onPageBack = { settingsBack() },
|
||||
onCloseSettings = { settingsHistory = SettingsHistory() },
|
||||
onSettingsCategory = { category, target -> openSettingsCategory(category, target) },
|
||||
onSettingsMode = { mode ->
|
||||
val destination = settingsHistory.current as? SettingsDestination.Category
|
||||
if (destination != null) {
|
||||
refreshModeSettings(mode)
|
||||
settingsHistory = settingsHistory.replace(destination.copy(mode = mode, target = null))
|
||||
}
|
||||
},
|
||||
onOpenUpdates = { settingsHistory = SettingsHistory(); requestedRailTab = "updates" },
|
||||
onRailTabHandled = { requestedRailTab = null },
|
||||
onTheme = { id -> SessionPrefs.setTheme(this, id); theme = id },
|
||||
onLauncherFullscreen = { on ->
|
||||
SessionPrefs.setLauncherFullscreen(this, on)
|
||||
launcherFullscreen = on
|
||||
@@ -751,11 +754,18 @@ class MainActivity : ComponentActivity() {
|
||||
onKeyboardButton = { on -> ControllerPrefs.setKeyboardButton(this, on); refreshController() },
|
||||
onEditLayout = { startActivity(Intent(this, ControllerEditorActivity::class.java)) },
|
||||
onResetLayout = { ControllerPrefs.resetAllLayouts(this); refreshController() },
|
||||
onMapping = { settingsMode = null; showPerformance = false; showProtons = false; showComponents = false; showMapping = true },
|
||||
onMapping = { settingsHistory = settingsHistory.open(SettingsDestination.Mapping) },
|
||||
onResetAll = { ControllerPrefs.resetAll(this); refreshController() },
|
||||
),
|
||||
),
|
||||
page = page,
|
||||
settingsContent = { s, a, openDeveloperOptions, requestWirelessAdb ->
|
||||
s.settingsCategory?.let { category ->
|
||||
SettingsCategoryPage(s, a, category, s.settingsMode, s.settingsTarget, openDeveloperOptions, requestWirelessAdb) { host ->
|
||||
ModeSettingsHost(s.settingsMode, category, host)
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
if (showRoms) RomsDialog(
|
||||
@@ -990,11 +1000,7 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
|
||||
private fun openProtons() {
|
||||
settingsMode = null
|
||||
showPerformance = false
|
||||
showComponents = false
|
||||
showMapping = false
|
||||
showProtons = true
|
||||
settingsHistory = settingsHistory.open(SettingsDestination.Protons)
|
||||
protons.refreshProtons()
|
||||
}
|
||||
|
||||
@@ -1009,18 +1015,14 @@ class MainActivity : ComponentActivity() {
|
||||
mapping = settings.mapping,
|
||||
onPick = { id, target -> ControllerPrefs.setTarget(this, id, target); refreshController() },
|
||||
onReset = { ControllerPrefs.resetMapping(this); refreshController() },
|
||||
onBack = { showMapping = false },
|
||||
onBack = { settingsBack() },
|
||||
)
|
||||
}
|
||||
|
||||
private fun openComponents(focusContent: Boolean = true, tab: String? = null) {
|
||||
private fun openComponents(focusContent: Boolean = true, tab: String? = null, target: String? = null) {
|
||||
focusComponentsContent = focusContent
|
||||
if (tab != null) components.compComp = tab
|
||||
settingsMode = null
|
||||
showPerformance = false
|
||||
showProtons = false
|
||||
showMapping = false
|
||||
showComponents = true
|
||||
settingsHistory = settingsHistory.open(SettingsDestination.Components(tab ?: components.compComp, target))
|
||||
components.refreshComponents(snapshotFirst = true)
|
||||
drivers.refreshDrivers()
|
||||
}
|
||||
@@ -1046,8 +1048,15 @@ class MainActivity : ComponentActivity() {
|
||||
busy = if (busy) stage else components.compBusy,
|
||||
downloads = components.compDownloads,
|
||||
requestInitialFocus = focusComponentsContent,
|
||||
onProton = { components.chooseProton(it) },
|
||||
onComp = { components.compComp = it },
|
||||
onProton = { components.compProton = it },
|
||||
defaultProtonId = components.defaultProtonId,
|
||||
onDefaultProton = { components.chooseProton(it) },
|
||||
onComp = { tab ->
|
||||
components.compComp = tab
|
||||
if (settingsHistory.current is SettingsDestination.Components) {
|
||||
settingsHistory = settingsHistory.replace(SettingsDestination.Components(tab))
|
||||
}
|
||||
},
|
||||
onSwap = { file -> components.compProton?.let { pid -> components.componentAction("Swapping") { ComponentsManager.swap(this, pid, file) } } },
|
||||
onRestore = { version -> components.compProton?.let { pid -> components.componentAction("Restoring") { ComponentsManager.restore(this, pid, components.compComp, version) } } },
|
||||
onCancelQueued = { components.compProton?.let { pid -> components.componentAction("Cancelling") { ComponentsManager.cancelQueued(this, pid, components.compComp); "The waiting swap was cancelled." } } },
|
||||
@@ -1056,7 +1065,7 @@ class MainActivity : ComponentActivity() {
|
||||
onDownload = { components.downloadComponent(it) },
|
||||
onRefresh = { components.refreshComponentCatalog() },
|
||||
onImport = { pickComponent.launch(InAppFilePicker.buildIntent(this, WCP_EXT, "Choose a component package (-linux .wcp)")) },
|
||||
onBack = { showComponents = false },
|
||||
onBack = { settingsBack() },
|
||||
gpu = drivers.state(),
|
||||
gpuActions = com.droiddeck.launcher.ui.GpuDriversActions(
|
||||
onAuto = { on -> drivers.setMode(on) },
|
||||
@@ -1088,7 +1097,7 @@ class MainActivity : ComponentActivity() {
|
||||
onInstall = { id -> protons.installProton(id) },
|
||||
onCancel = { id -> ProtonExtras.tools.firstOrNull { it.id == id }?.let { ProtonExtras.unqueue(this, it) }; protons.refreshProtons() },
|
||||
onRemove = { id -> protons.removeProton(id) },
|
||||
onBack = { showProtons = false },
|
||||
onBack = { settingsBack() },
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1135,11 +1144,10 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ModeSettingsHost(mode: String) {
|
||||
ModeSettingsPage(
|
||||
private fun ModeSettingsHost(mode: String, category: SettingsCategory, host: MenuHost) {
|
||||
ModeSettingsContent(
|
||||
ModeSettings(
|
||||
mode = mode, resolution = resolution,
|
||||
panelSize = com.droiddeck.launcher.session.SessionDisplay.panelSize(this),
|
||||
mode = mode, resolutionCap = resolutionCap, customResolution = customResolution, shapeMode = shapeMode,
|
||||
hdr = hdrOn, hdrReason = hdrReason, fpsLimit = fpsLimit,
|
||||
upscaler = upscaler, upscaleSharpness = upscaleSharpness,
|
||||
gpuDrivers = drivers.summary(),
|
||||
@@ -1162,7 +1170,6 @@ class MainActivity : ComponentActivity() {
|
||||
syncBackend = if (mode == SessionService.MODE_STEAM) SessionPrefs.syncBackendOf(fastSync, fsyncFirst, syncFallback) else null,
|
||||
steamChannel = if (mode == SessionService.MODE_STEAM) steamChannel else null,
|
||||
steamDeckMode = mode == SessionService.MODE_STEAM && steamDeckMode,
|
||||
steamRepairQueued = steamRepairQueued,
|
||||
mangoapp = mangoapp,
|
||||
steamController = if (mode == SessionService.MODE_STEAM) steamController else null,
|
||||
runSteamAtStartup = mode == SessionService.MODE_STEAM && runSteamAtStartup,
|
||||
@@ -1195,7 +1202,9 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
},
|
||||
onWifiDiscoverySettings = { openWifiDiscoverySettings() },
|
||||
onResolution = { value -> SessionPrefs.setResolutionChoice(this, mode, value); resolution = value },
|
||||
onResolution = { cap -> SessionPrefs.setResolutionCap(this, mode, cap); resolutionCap = cap },
|
||||
onCustomResolution = { size -> SessionPrefs.setCustomResolution(this, mode, size); customResolution = size },
|
||||
onShape = { shape -> SessionPrefs.setShapeMode(this, shape); shapeMode = shape },
|
||||
onHdr = { on -> SessionPrefs.setHdr(this, mode, on); hdrOn = on },
|
||||
onGpuDrivers = { openComponents(focusContent = true, tab = com.droiddeck.launcher.ui.GPU_TAB) },
|
||||
onFpsLimit = { fps -> SessionPrefs.setFpsLimit(this, mode, fps); fpsLimit = fps },
|
||||
@@ -1239,7 +1248,6 @@ class MainActivity : ComponentActivity() {
|
||||
syncFallback = SessionPrefs.syncFallback(this)
|
||||
},
|
||||
onSteamChannel = { id -> SessionPrefs.setSteamChannel(this, id); steamChannel = id },
|
||||
onSteamRepair = { steamRepairQueued = SteamRepair.queue(this) },
|
||||
onSteamDeckMode = { on ->
|
||||
SessionPrefs.setSteamDeckMode(this, on)
|
||||
steamDeckMode = on
|
||||
@@ -1270,8 +1278,13 @@ class MainActivity : ComponentActivity() {
|
||||
onPickDeckyPluginZip = {
|
||||
pickDeckyPluginZip.launch(InAppFilePicker.buildIntent(this, ZIP_EXT, "Choose a Decky plugin ZIP"))
|
||||
},
|
||||
onDismiss = { settingsMode = null },
|
||||
onDismiss = { settingsBack() },
|
||||
),
|
||||
category = category,
|
||||
host = host,
|
||||
)
|
||||
if (category == SettingsCategory.DISPLAY) com.droiddeck.launcher.ui.GraphicsSettingsContent(
|
||||
host, upscaler, { value -> SessionPrefs.setUpscaler(this, value); upscaler = value },
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1300,7 +1313,7 @@ class MainActivity : ComponentActivity() {
|
||||
onGpuClockPin = { on -> SessionPrefs.setGpuClockPin(this, on); gpuClockPin = on },
|
||||
onProotNoSeccomp = { on -> SessionPrefs.setProotNoSeccomp(this, on); prootNoSeccomp = on },
|
||||
onProotFastPath = { on -> SessionPrefs.setProotFastPath(this, on); prootFastPath = on },
|
||||
onGuestHostname = { name -> SessionPrefs.setGuestHostname(this, name) },
|
||||
onGuestHostname = { name -> SessionPrefs.setGuestHostname(this, name); guestHostname = SessionPrefs.guestHostname(this) },
|
||||
onClientCore = { core, on ->
|
||||
clientCores = if (on) clientCores + core else clientCores - core
|
||||
SessionPrefs.setClientCpus(this, CpuCores.format(clientCores))
|
||||
@@ -1309,7 +1322,7 @@ class MainActivity : ComponentActivity() {
|
||||
gameCores = if (on) gameCores + core else gameCores - core
|
||||
SessionPrefs.setGameCpus(this, CpuCores.format(gameCores))
|
||||
},
|
||||
onDismiss = { showPerformance = false },
|
||||
onDismiss = { settingsBack() },
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1346,23 +1359,57 @@ class MainActivity : ComponentActivity() {
|
||||
private var pipAutoEnter by mutableStateOf(false)
|
||||
|
||||
private fun openModeSettings(mode: String) {
|
||||
refreshModeSettings(mode)
|
||||
settingsHistory = settingsHistory.open(SettingsDestination.Category(SettingsCategory.SESSIONS, mode))
|
||||
}
|
||||
|
||||
private fun openSettingsCategory(category: SettingsCategory, target: String?) {
|
||||
val entry = com.droiddeck.launcher.ui.SettingsCatalog.entries.firstOrNull { it.target == target }
|
||||
val mode = entry?.mode ?: SessionService.MODE_STEAM
|
||||
refreshModeSettings(mode)
|
||||
val categoryTarget = com.droiddeck.launcher.ui.settingsCategoryTarget(target)
|
||||
settingsHistory = settingsHistory.open(SettingsDestination.Category(category, mode, categoryTarget))
|
||||
when {
|
||||
target == "components" -> openComponents(true, "fex")
|
||||
target == "default-proton" || target == "editing-proton" -> openComponents(true, "fex", target)
|
||||
target == "gpu-drivers" -> openComponents(true, com.droiddeck.launcher.ui.GPU_TAB)
|
||||
target == "protons" -> openProtons()
|
||||
target == "controller-mapping" -> settingsHistory = settingsHistory.open(SettingsDestination.Mapping)
|
||||
target == "performance" || target?.startsWith("performance:") == true -> {
|
||||
refreshCores()
|
||||
settingsHistory = settingsHistory.open(SettingsDestination.Performance(target?.substringAfter("performance:", "")?.ifEmpty { null }))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun settingsBack() {
|
||||
settingsHistory = settingsHistory.back()
|
||||
when (val destination = settingsHistory.current) {
|
||||
is SettingsDestination.Category -> refreshModeSettings(destination.mode)
|
||||
is SettingsDestination.Components -> {
|
||||
destination.tab?.let { components.compComp = it }
|
||||
components.refreshComponents(snapshotFirst = true)
|
||||
drivers.refreshDrivers()
|
||||
}
|
||||
else -> Unit
|
||||
}
|
||||
}
|
||||
|
||||
private fun refreshModeSettings(mode: String) {
|
||||
pipAutoEnter = SessionPrefs.pipAutoEnter(this)
|
||||
showPerformance = false
|
||||
showProtons = false
|
||||
showComponents = false
|
||||
showMapping = false
|
||||
resolution = SessionPrefs.resolutionChoice(this, mode, com.droiddeck.launcher.session.SessionDisplay.panelSize(this))
|
||||
resolutionCap = SessionPrefs.resolutionCap(this, mode)
|
||||
customResolution = SessionPrefs.customResolution(this, mode)
|
||||
fexPreset = SessionPrefs.fexPreset(this)
|
||||
fastSync = SessionPrefs.fastSync(this)
|
||||
fsyncFirst = SessionPrefs.fsyncFirst(this)
|
||||
syncFallback = SessionPrefs.syncFallback(this)
|
||||
steamChannel = SessionPrefs.steamChannel(this)
|
||||
steamDeckMode = SessionPrefs.steamDeckMode(this)
|
||||
steamRepairQueued = SteamRepair.queued(this)
|
||||
mangoapp = SessionPrefs.mangoapp(this)
|
||||
steamController = SessionPrefs.steamController(this)
|
||||
runSteamAtStartup = SessionPrefs.runSteamAtStartup(this)
|
||||
addedGamesDirs = SessionPrefs.addedGamesDirs(this)
|
||||
shapeMode = SessionPrefs.shapeMode(this)
|
||||
hdrOn = SessionPrefs.hdr(this, mode)
|
||||
fpsLimit = SessionPrefs.fpsLimit(this, mode)
|
||||
upscaler = SessionPrefs.upscaler(this)
|
||||
@@ -1381,7 +1428,6 @@ class MainActivity : ComponentActivity() {
|
||||
renderer = SessionPrefs.desktopRenderer(this)
|
||||
gameStorage = SessionPrefs.gameStorage(this)
|
||||
storageDiagnostics = SessionPrefs.storageDiagnosticsEnabled(this)
|
||||
settingsMode = mode
|
||||
// The page opens at once, on what was last read; the slow part (driver files, a walk of the
|
||||
// added-games folders, the storage volumes) lands while it animates in.
|
||||
Thread({
|
||||
|
||||
@@ -59,7 +59,6 @@ import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.session.LoadingState
|
||||
import com.droiddeck.launcher.session.PerfHud
|
||||
import com.droiddeck.launcher.session.PerfMode
|
||||
import com.droiddeck.launcher.session.SteamRepair
|
||||
import com.droiddeck.launcher.session.GameEnvironmentStore
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.session.SessionEvents
|
||||
@@ -83,9 +82,7 @@ import com.droiddeck.launcher.wayland.CompositorHost
|
||||
import com.droiddeck.launcher.wayland.WaylandCompositor
|
||||
import java.io.File
|
||||
import com.droiddeck.launcher.session.ComponentsManager
|
||||
import com.droiddeck.launcher.ui.SessionDrawerPage
|
||||
import com.droiddeck.launcher.ui.sessionDrawerPages
|
||||
import com.droiddeck.launcher.ui.step
|
||||
import com.droiddeck.launcher.ui.DRAWER_PAGES
|
||||
import kotlin.math.abs
|
||||
|
||||
/**
|
||||
@@ -161,21 +158,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
private val cursorBuf = IntArray(WaylandCompositor.CURSOR_BUF_INTS)
|
||||
private var cursorSerial = 0
|
||||
private var clientHidesCursor = false
|
||||
/**
|
||||
* A program holds a pointer lock (zwp_locked_pointer_v1: a mouse-look game, through gamescope).
|
||||
* While it does, a physical mouse is captured and its raw deltas go to the program as relative
|
||||
* motion. Without capture the deltas are worked out from Android's pointer position, which stops
|
||||
* at the screen edge, and so did the camera (#153).
|
||||
*/
|
||||
private var pointerLocked = false
|
||||
private val pointerLockListener = WaylandCompositor.PointerLockListener { locked, _, _ ->
|
||||
uiHandler.post {
|
||||
if (pointerLocked == locked) return@post
|
||||
pointerLocked = locked
|
||||
Log.i(TAG, "pointer lock " + if (locked) "taken by a program" else "released")
|
||||
updatePointerCapture()
|
||||
}
|
||||
}
|
||||
private var cursorImage by mutableStateOf<androidx.compose.ui.graphics.ImageBitmap?>(null)
|
||||
private var cursorHotX by mutableStateOf(0)
|
||||
private var cursorHotY by mutableStateOf(0)
|
||||
@@ -223,7 +205,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
private var closeAtOnce = false
|
||||
/** The drawer's Components tab: the Protons as last read (ComponentsManager). */
|
||||
private var drawerComponents by mutableStateOf<ComponentsManager.Snapshot?>(null)
|
||||
private var drawerPage by mutableStateOf(SessionDrawerPage.CONTROLLER)
|
||||
private var drawerPage by mutableIntStateOf(0)
|
||||
private var drawerControllerActive by mutableStateOf(false)
|
||||
private var backActionsInverted by mutableStateOf(false)
|
||||
/** The on-screen PC keyboard (ui/PcKeyboard): real key presses, Esc and F1 included. */
|
||||
@@ -243,7 +225,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
private var fexPreset by mutableStateOf("")
|
||||
private var suspendPolicy by mutableStateOf(SessionPrefs.SUSPEND_MANUAL)
|
||||
private var oscMode by mutableStateOf(SessionPrefs.OSC_AUTO)
|
||||
private var onScreenButtonsVisible by mutableStateOf(false)
|
||||
private var shapeMode by mutableStateOf(SessionPrefs.SHAPE_AUTO)
|
||||
private var secondScreenMode by mutableStateOf(SessionState.secondScreenMode)
|
||||
private var secondScreenDisplays by mutableStateOf<List<SecondScreenDisplay>>(emptyList())
|
||||
private var selectedSecondScreenDisplay by mutableStateOf(SessionState.secondScreenDisplay)
|
||||
@@ -285,12 +267,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
override fun onInputDeviceAdded(deviceId: Int) {
|
||||
logInputDevice("connected", deviceId)
|
||||
updateOnScreenControls()
|
||||
updatePointerCapture()
|
||||
}
|
||||
override fun onInputDeviceRemoved(deviceId: Int) {
|
||||
Log.i(TAG, "input device $deviceId disconnected")
|
||||
updateOnScreenControls()
|
||||
updatePointerCapture()
|
||||
}
|
||||
override fun onInputDeviceChanged(deviceId: Int) = updateOnScreenControls()
|
||||
}
|
||||
@@ -341,16 +321,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
// below) and the session starts when it is in.
|
||||
if (!LinuxRuntime.isInstalled(this)) Log.i(TAG, "the Linux runtime is not installed; the loading screen installs it")
|
||||
|
||||
// Captured mouse events go down the focus chain, and focus sits somewhere in the overlay:
|
||||
// the root sees every one of them whichever view that is.
|
||||
val root = object : FrameLayout(this) {
|
||||
override fun dispatchCapturedPointerEvent(event: MotionEvent): Boolean =
|
||||
onCapturedPointer(event) || super.dispatchCapturedPointerEvent(event)
|
||||
override fun dispatchPointerCaptureChanged(hasCapture: Boolean) {
|
||||
super.dispatchPointerCaptureChanged(hasCapture)
|
||||
Log.i(TAG, "pointer capture " + if (hasCapture) "on" else "off")
|
||||
}
|
||||
}
|
||||
val root = FrameLayout(this)
|
||||
surfaceView = SurfaceView(this)
|
||||
surfaceView.holder.addCallback(this)
|
||||
root.addView(surfaceView)
|
||||
@@ -413,7 +384,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
|
||||
updateOnScreenControls()
|
||||
WaylandCompositor.setFirstFrameListener(firstFrameListener)
|
||||
WaylandCompositor.setPointerLockListener(pointerLockListener)
|
||||
SessionEvents.markReadyIfPossible()
|
||||
SessionState.endListener = endListener
|
||||
// A single Back opens the session menu; two quick presses/swipes send the Steam QAM chord.
|
||||
@@ -444,8 +414,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
// this full-screen host and remain as a white veil after the drawer closes.
|
||||
defaultFocusHighlightEnabled = false
|
||||
setContent {
|
||||
// The drawer, the PC keyboard and picture in picture take the mouse back.
|
||||
androidx.compose.runtime.LaunchedEffect(drawerOpen, pcKeyboardOpen, pipUi) { updatePointerCapture() }
|
||||
DroidDeckTheme {
|
||||
if (pipUi) {
|
||||
if (SessionState.suspended) androidx.compose.foundation.layout.Box(
|
||||
@@ -506,9 +474,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
effects = effects, textureAnisotropy = textureAnisotropy, textureLodBias = textureLodBias,
|
||||
frameGen = frameGen,
|
||||
lossless = lossless,
|
||||
oscMode = oscMode, onScreenButtonsVisible = onScreenButtonsVisible, suspendPolicy = suspendPolicy, touchMode = touchMode,
|
||||
oscMode = oscMode, suspendPolicy = suspendPolicy, touchMode = touchMode,
|
||||
touchAuto = if (usingTouchpad()) "touchpad" else "direct",
|
||||
fexPreset = fexPreset,
|
||||
shapeMode = shapeMode, fexPreset = fexPreset,
|
||||
secondScreenMode = secondScreenMode,
|
||||
secondScreenDisplays = secondScreenDisplays,
|
||||
selectedSecondScreenDisplay = selectedSecondScreenDisplay,
|
||||
@@ -560,6 +528,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
SessionService.suspendPolicyChanged(this@SessionActivity)
|
||||
},
|
||||
onTouch = { v -> SessionPrefs.setTouchMode(this@SessionActivity, v); readPrefs() },
|
||||
onShape = { v -> SessionPrefs.setShapeMode(this@SessionActivity, v); readPrefs() },
|
||||
onFexPreset = { v -> SessionPrefs.setFexPreset(this@SessionActivity, v); readPrefs() },
|
||||
onSecondScreenMode = ::selectSecondScreenMode,
|
||||
onSecondScreenDisplay = ::selectSecondScreenDisplay,
|
||||
@@ -787,6 +756,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
fexPreset = SessionPrefs.fexPreset(this)
|
||||
suspendPolicy = SessionPrefs.suspendPolicy(this, SessionState.mode)
|
||||
oscMode = SessionPrefs.oscMode(this)
|
||||
shapeMode = SessionPrefs.shapeMode(this)
|
||||
backActionsInverted = SessionPrefs.backActionsInverted(this)
|
||||
}
|
||||
|
||||
@@ -1042,15 +1012,38 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
}
|
||||
|
||||
private fun outputSize(): Pair<Int, Int> {
|
||||
val bounds = panelBounds()
|
||||
val panelW = maxOf(bounds.width(), bounds.height()).toFloat()
|
||||
val panelH = minOf(bounds.width(), bounds.height()).toFloat()
|
||||
// Never narrower than 16:9. A foldable's inner panel is nearly square, and a game handed a
|
||||
// square display draws for the frame it was made for and cuts the sides off itself.
|
||||
// Wider than 16:9 is fine - games and the client cope with a phone's 20:9 - so the
|
||||
// panel's aspect is kept above that, unless the user pinned 16:9 for a foldable, and the
|
||||
// compositor letterboxes onto a squarer panel.
|
||||
// "Match screen" drops that floor, for a 4:3 or 3:2 handheld whose games should
|
||||
// fill it.
|
||||
val aspect = when (SessionPrefs.shapeMode(this)) {
|
||||
SessionPrefs.SHAPE_WIDE -> 16f / 9f
|
||||
SessionPrefs.SHAPE_EXACT -> panelW / panelH
|
||||
else -> maxOf(panelW / panelH, 16f / 9f)
|
||||
}
|
||||
// 720 tall at most by default, client and desktop alike: the client's CEF is the heaviest
|
||||
// thing in the session, and pixels above that cost frames for nothing anyone can see on a
|
||||
// handheld panel. The mode's settings (the cog beside Play / Desktop) can change
|
||||
// the cap or lift it to the panel.
|
||||
val mode = SessionPrefs.prefMode(intent.getStringExtra(SessionService.EXTRA_MODE) ?: SessionService.MODE_STEAM)
|
||||
val panel = com.droiddeck.launcher.session.SessionDisplay.panelSize(this)
|
||||
// A custom resolution is taken as given; the compositor fits it to the panel.
|
||||
SessionPrefs.customResolution(this, mode)?.let { return it }
|
||||
// An emulator whose frames cost next to nothing (Library.drawsAtPanel) gets the panel,
|
||||
// unless the user chose a resolution for the mode.
|
||||
val program = intent.getStringExtra(SessionService.EXTRA_PROGRAM)
|
||||
// Lightweight emulators keep their panel-sized default until a resolution is chosen.
|
||||
val choice = if (intent.getStringExtra(SessionService.EXTRA_MODE) == SessionService.MODE_RUN &&
|
||||
Library.drawsAtPanel(program) && !SessionPrefs.resolutionChosen(this, mode))
|
||||
com.droiddeck.launcher.session.SessionDisplay.MATCH_SCREEN
|
||||
else SessionPrefs.resolutionChoice(this, mode, panel)
|
||||
return com.droiddeck.launcher.session.SessionDisplay.resolveChoice(panel, choice)
|
||||
val cap = if (intent.getStringExtra(SessionService.EXTRA_MODE) == SessionService.MODE_RUN &&
|
||||
Library.drawsAtPanel(program) && !SessionPrefs.resolutionChosen(this, mode)) 0
|
||||
else SessionPrefs.resolutionCap(this, mode)
|
||||
val height = (if (cap <= 0) panelH else minOf(panelH, cap.toFloat())).toInt()
|
||||
val width = (height * aspect).toInt()
|
||||
// Odd sizes upset the scaler; both dimensions even is what every mode here would be.
|
||||
return Pair(width and 1.inv(), height and 1.inv())
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1145,7 +1138,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
// the request landed in this instance's onNewIntent and went with its finish().
|
||||
SessionState.relaunch?.let { next ->
|
||||
SessionState.relaunch = null
|
||||
next.putExtra(EXTRA_RETURN_HOME, intent.getBooleanExtra(EXTRA_RETURN_HOME, false))
|
||||
setIntent(next)
|
||||
recreate()
|
||||
return@runOnUiThread
|
||||
@@ -1269,8 +1261,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
if (drawerOpen) {
|
||||
if (fromController && (event.keyCode == KeyEvent.KEYCODE_BUTTON_L1 || event.keyCode == KeyEvent.KEYCODE_BUTTON_R1)) {
|
||||
if (event.action == KeyEvent.ACTION_DOWN && event.repeatCount == 0) {
|
||||
drawerPage = sessionDrawerPages(SessionState.mode == SessionService.MODE_STEAM && secondScreenDisplays.isNotEmpty())
|
||||
.step(drawerPage, if (event.keyCode == KeyEvent.KEYCODE_BUTTON_R1) 1 else -1)
|
||||
drawerPage = (drawerPage + if (event.keyCode == KeyEvent.KEYCODE_BUTTON_R1) 1 else DRAWER_PAGES - 1) % DRAWER_PAGES
|
||||
releaseDrawerDirection()
|
||||
}
|
||||
return true
|
||||
@@ -1357,10 +1348,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
return super.dispatchGenericMotionEvent(event)
|
||||
}
|
||||
|
||||
/** With no view focused, captured mouse events skip the root and arrive here as trackball events. */
|
||||
override fun dispatchTrackballEvent(event: MotionEvent): Boolean =
|
||||
onCapturedPointer(event) || super.dispatchTrackballEvent(event)
|
||||
|
||||
override fun dispatchTouchEvent(event: MotionEvent): Boolean {
|
||||
if (pipUi) return true
|
||||
if (event.actionMasked == MotionEvent.ACTION_DOWN && event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN)) {
|
||||
@@ -1711,55 +1698,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
return true
|
||||
}
|
||||
|
||||
/** A physical mouse, not a touchscreen, stylus or the system's own virtual devices. */
|
||||
private fun mouseAttached(): Boolean = InputDevice.getDeviceIds().any { id ->
|
||||
val d = InputDevice.getDevice(id)
|
||||
d != null && !d.isVirtual && d.supportsSource(InputDevice.SOURCE_MOUSE)
|
||||
}
|
||||
|
||||
/** Capture the mouse exactly while a program holds a lock and the session has the mouse. */
|
||||
private fun updatePointerCapture() {
|
||||
if (!::surfaceView.isInitialized) return
|
||||
val view = window.decorView
|
||||
val want = pointerLocked && resumed && hasWindowFocus() && !drawerOpen && !pcKeyboardOpen && !pipUi && mouseAttached()
|
||||
if (want == view.hasPointerCapture()) return
|
||||
if (want) view.requestPointerCapture() else view.releasePointerCapture()
|
||||
}
|
||||
|
||||
/**
|
||||
* A captured mouse: raw motion as relative pointer deltas, buttons and the wheel as on the
|
||||
* uncaptured path. Anything else (a captured touchpad's absolute fingers) is left alone.
|
||||
*/
|
||||
private fun onCapturedPointer(event: MotionEvent): Boolean {
|
||||
if (!pointerLocked || !event.isFromSource(InputDevice.SOURCE_MOUSE_RELATIVE)) return false
|
||||
when (event.actionMasked) {
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
var dx = event.x
|
||||
var dy = event.y
|
||||
for (i in 0 until event.historySize) {
|
||||
dx += event.getHistoricalX(i)
|
||||
dy += event.getHistoricalY(i)
|
||||
}
|
||||
WaylandCompositor.sendPointerDelta(dx, dy)
|
||||
}
|
||||
MotionEvent.ACTION_BUTTON_PRESS, MotionEvent.ACTION_BUTTON_RELEASE -> {
|
||||
val button = when (event.actionButton) {
|
||||
MotionEvent.BUTTON_SECONDARY -> PointerGestures.BTN_RIGHT
|
||||
MotionEvent.BUTTON_TERTIARY -> PointerGestures.BTN_MIDDLE
|
||||
else -> PointerGestures.BTN_LEFT
|
||||
}
|
||||
WaylandCompositor.nativeSendSceneInput(3, button, if (event.actionMasked == MotionEvent.ACTION_BUTTON_PRESS) 1 else 0)
|
||||
}
|
||||
MotionEvent.ACTION_SCROLL -> {
|
||||
val v = event.getAxisValue(MotionEvent.AXIS_VSCROLL)
|
||||
if (v != 0f) WaylandCompositor.nativeSendSceneInput(4, -Math.round(v), 0)
|
||||
}
|
||||
MotionEvent.ACTION_DOWN, MotionEvent.ACTION_UP -> {} // the BUTTON_* events carry these
|
||||
else -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/** The mode decides which controls appear; `droiddeck-osc` in Downloads still overrides. */
|
||||
/** Which controller the session has, so a pad report says what was plugged in and when. */
|
||||
private fun logInputDevice(what: String, deviceId: Int) {
|
||||
@@ -1776,7 +1714,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
?: SessionPrefs.oscMode(this)
|
||||
val controls = onScreenControls ?: return
|
||||
if (pipUi) {
|
||||
onScreenButtonsVisible = false
|
||||
controls.releaseAll()
|
||||
controls.visibility = View.GONE
|
||||
return
|
||||
@@ -1792,7 +1729,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
// started from the rail, or Steam, gets it; the drawer turns it on anywhere.
|
||||
else -> !PadBridge.anyControllerConnected() && SessionState.mode != SessionService.MODE_DESKTOP
|
||||
}
|
||||
onScreenButtonsVisible = show
|
||||
if (show == (controls.visibility == View.VISIBLE)) return
|
||||
if (!show) controls.releaseAll()
|
||||
controls.visibility = if (show) View.VISIBLE else View.GONE
|
||||
@@ -1907,8 +1843,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
recreate()
|
||||
return
|
||||
}
|
||||
// Home/notification resumes must retain the external frontend's return destination.
|
||||
if (this.intent.getBooleanExtra(EXTRA_RETURN_HOME, false)) intent.putExtra(EXTRA_RETURN_HOME, true)
|
||||
setIntent(intent)
|
||||
if (intent.action == SessionService.ACTION_HOME_GUIDE) {
|
||||
handleHomeGuideIntent(intent)
|
||||
@@ -1933,7 +1867,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
controllerSettings = ControllerPrefs.read(this)
|
||||
updateOnScreenControls()
|
||||
resumed = true
|
||||
updatePointerCapture()
|
||||
if (!pipUi) sessionClipboard.start()
|
||||
updatePadMotion()
|
||||
readPrefs()
|
||||
@@ -1953,7 +1886,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
// A button held when the app goes away would stay held in the ring for the whole session.
|
||||
onScreenControls?.releaseAll()
|
||||
resumed = false
|
||||
updatePointerCapture()
|
||||
updatePadMotion()
|
||||
keyboard?.takeIf { it.shown }?.hide()
|
||||
super.onPause()
|
||||
@@ -1974,8 +1906,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
goFullscreen()
|
||||
refreshClipboard()
|
||||
}
|
||||
// Android drops a capture with the focus; a lock still held takes it again on return.
|
||||
updatePointerCapture()
|
||||
}
|
||||
|
||||
/** The keyboard/trackpad presentation can own focus instead of the main display. */
|
||||
@@ -2003,7 +1933,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
private val endListener: (Int) -> Unit = { status -> onSessionEnded(status) }
|
||||
private val firstFrameListener = Runnable {
|
||||
SessionEvents.firstFrame()
|
||||
if (SessionState.mode == SessionService.MODE_STEAM) SteamRepair.clientShown(this)
|
||||
runOnUiThread {
|
||||
loading.visible = false
|
||||
hud.start()
|
||||
@@ -2026,7 +1955,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
if (SessionState.deckPadListener === deckPadListener) SessionState.deckPadListener = null
|
||||
if (SessionState.endListener === endListener) SessionState.endListener = null
|
||||
WaylandCompositor.clearFirstFrameListener(firstFrameListener)
|
||||
WaylandCompositor.clearPointerLockListener(pointerLockListener)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
@@ -2049,7 +1977,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
* off, it just closes.
|
||||
*/
|
||||
override fun finish() {
|
||||
if (isFinishing) return
|
||||
if (!quitFlooded && !closeAtOnce && com.droiddeck.launcher.ui.Motion.scale != 0f &&
|
||||
lifecycle.currentState.isAtLeast(androidx.lifecycle.Lifecycle.State.RESUMED)) {
|
||||
if (!leaving) {
|
||||
@@ -2060,12 +1987,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
return
|
||||
}
|
||||
super.finish()
|
||||
if (!closeAtOnce && intent.getBooleanExtra(EXTRA_RETURN_HOME, false)) {
|
||||
com.droiddeck.launcher.ui.QuitFlood.take()
|
||||
com.droiddeck.launcher.ui.LaunchOrigin.flooding = null
|
||||
startActivity(Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
||||
}
|
||||
if (quitFlooded) overridePendingTransition(0, 0)
|
||||
else overridePendingTransition(R.anim.session_hold, R.anim.session_sink)
|
||||
}
|
||||
@@ -2081,7 +2002,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val EXTRA_RETURN_HOME = "returnHome"
|
||||
/** How long the leaving flood may take before the session closes without it. */
|
||||
private const val LEAVE_TIMEOUT_MS = 1_500L
|
||||
private const val TAG = "SessionActivity"
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.droiddeck.launcher.core
|
||||
|
||||
import android.content.Context
|
||||
|
||||
object AppUiPrefs {
|
||||
const val DEFAULT_SCALE = 100
|
||||
val scales = listOf(75, 85, 100, 115, 125, 150)
|
||||
|
||||
internal fun normalizeScale(percent: Int): Int = percent.takeIf { it in scales } ?: DEFAULT_SCALE
|
||||
|
||||
fun scale(context: Context): Int = normalizeScale(
|
||||
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).getInt("scale", DEFAULT_SCALE),
|
||||
)
|
||||
|
||||
fun setScale(context: Context, percent: Int) {
|
||||
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit()
|
||||
.putInt("scale", normalizeScale(percent)).apply()
|
||||
}
|
||||
}
|
||||
@@ -108,9 +108,9 @@ object DeviceReport {
|
||||
h("Display")
|
||||
k("Session output", SessionState.outputSize?.let { "${it.first}x${it.second}" })
|
||||
k("Session refresh", String.format(Locale.US, "%.2f Hz", SessionState.refreshHz))
|
||||
val panelSize = com.droiddeck.launcher.session.SessionDisplay.panelSize(context)
|
||||
k("Resolution (Steam)", SessionPrefs.resolutionChoice(context, SessionService.MODE_STEAM, panelSize))
|
||||
k("Resolution (Desktop)", SessionPrefs.resolutionChoice(context, SessionService.MODE_DESKTOP, panelSize))
|
||||
k("Shape setting", SessionPrefs.shapeMode(context))
|
||||
k("Custom resolution (Steam)", SessionPrefs.customResolution(context, SessionService.MODE_STEAM)?.let { "${it.first}x${it.second}" } ?: "off")
|
||||
k("Custom resolution (Desktop)", SessionPrefs.customResolution(context, SessionService.MODE_DESKTOP)?.let { "${it.first}x${it.second}" } ?: "off")
|
||||
k("Foldable", context.packageManager.hasSystemFeature("android.hardware.sensor.hinge_angle"))
|
||||
|
||||
h("Drivers")
|
||||
|
||||
@@ -22,7 +22,7 @@ class FileManagerActivity : ComponentActivity() {
|
||||
}
|
||||
val initialDir = intent.getStringExtra(EXTRA_START_DIR)?.let(::File)
|
||||
setContent {
|
||||
DroidDeckTheme(appScale = com.droiddeck.launcher.core.AppUiPrefs.scale(this)) {
|
||||
DroidDeckTheme {
|
||||
Surface(modifier = Modifier.fillMaxSize().systemBarsPadding(), color = MaterialTheme.colorScheme.background) {
|
||||
FileManagerScreen(initialDir = initialDir)
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class FilePickerActivity : ComponentActivity() {
|
||||
?.let { File(it) }?.takeIf { it.isDirectory }
|
||||
|
||||
setContent {
|
||||
DroidDeckTheme(appScale = com.droiddeck.launcher.core.AppUiPrefs.scale(this)) {
|
||||
DroidDeckTheme {
|
||||
Surface(modifier = Modifier.fillMaxSize().systemBarsPadding(), color = MaterialTheme.colorScheme.background) {
|
||||
FileManagerScreen(
|
||||
pickMode = true,
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.io.InputStream
|
||||
|
||||
/** Small, portable launch files for frontends that scan ROM folders. No guest paths or commands. */
|
||||
object GameFiles {
|
||||
const val EXTENSION = "steam"
|
||||
const val EXTENSION = "droiddeck"
|
||||
private const val MAX_BYTES = 128
|
||||
private const val INVENTORY = ".droiddeck-sync.json"
|
||||
private const val FORMAT = "droiddeck-game-files-v1"
|
||||
@@ -46,49 +46,35 @@ object GameFiles {
|
||||
}
|
||||
if (count > MAX_BYTES) return null
|
||||
val text = String(bytes, 0, count, Charsets.UTF_8).trim()
|
||||
return text.takeIf(GameLaunchLink::validId)
|
||||
return GameLaunchLink.parse(text) ?: text.takeIf(GameLaunchLink::validId)
|
||||
}
|
||||
|
||||
fun filename(game: Library.SteamGame, disambiguate: Boolean = false): String {
|
||||
fun filename(game: Library.SteamGame): String {
|
||||
val sanitized = game.name.replace(Regex("[\\p{Cntrl}\\\\/:*?\"<>|]"), "_")
|
||||
.trim().trim('.').ifBlank { "Game" }
|
||||
val points = sanitized.codePoints().limit(40).toArray()
|
||||
val title = String(points, 0, points.size)
|
||||
val suffix = if (disambiguate) " (${game.gameIdString})" else ""
|
||||
return "$title$suffix.$EXTENSION"
|
||||
return "$title (${game.gameIdString}).$EXTENSION"
|
||||
}
|
||||
|
||||
private fun contents(id: String): String {
|
||||
require(GameLaunchLink.validId(id))
|
||||
return id
|
||||
}
|
||||
private fun contents(id: String) = GameLaunchLink.uri(id) + "\n"
|
||||
|
||||
@Synchronized fun export(folder: File, game: Library.SteamGame): File =
|
||||
exportNamed(folder, game, filename(game))
|
||||
|
||||
private fun exportNamed(folder: File, game: Library.SteamGame, name: String): File {
|
||||
@Synchronized fun export(folder: File, game: Library.SteamGame): File {
|
||||
require(folder.isDirectory) { "Folder is unavailable" }
|
||||
val target = child(folder, filename(game))
|
||||
val text = contents(game.gameIdString)
|
||||
val target = exportTarget(folder, game, name)
|
||||
require(!target.exists() || matches(target, text)) { "A different file already uses ${target.name}" }
|
||||
if (!target.exists()) write(target, text)
|
||||
exportArt(folder, game)
|
||||
return target
|
||||
}
|
||||
|
||||
private fun exportTarget(folder: File, game: Library.SteamGame, name: String): File {
|
||||
val target = child(folder, name)
|
||||
return if (target.exists() && !matches(target, contents(game.gameIdString))) {
|
||||
child(folder, filename(game, disambiguate = true))
|
||||
} else target
|
||||
}
|
||||
|
||||
/** Cocoon matches icons in its data folder's images directory. Never replace custom art. */
|
||||
private fun exportArt(folder: File, game: Library.SteamGame) {
|
||||
val art = listOfNotNull(game.icon, game.art).firstOrNull {
|
||||
it.isFile && it.extension.lowercase() in listOf("jpg", "jpeg", "png", "webp")
|
||||
} ?: return
|
||||
val title = filename(game).substringBeforeLast(".")
|
||||
val title = filename(game).substringBeforeLast(" (${game.gameIdString})")
|
||||
.replace(Regex("\\[[^]]*]|\\([^)]*\\)"), "")
|
||||
.replace(Regex("[^a-zA-Z0-9\\s]"), "").trim()
|
||||
.replace(Regex("\\s+"), "-").lowercase(java.util.Locale.ROOT).take(50).trimEnd('-')
|
||||
@@ -109,20 +95,12 @@ object GameFiles {
|
||||
record.getJSONObject("games")
|
||||
} else JSONObject()
|
||||
val next = JSONObject()
|
||||
val unique = games.distinctBy { it.gameId }
|
||||
val names = unique.groupingBy { filename(it).lowercase(java.util.Locale.ROOT) }.eachCount()
|
||||
val exports = unique.map { game ->
|
||||
val name = filename(game, disambiguate = names.getValue(filename(game).lowercase(java.util.Locale.ROOT)) > 1)
|
||||
val preferred = child(folder, name)
|
||||
val target = if (inventoryOwns(folder, previous, preferred, game.gameIdString)) preferred
|
||||
else exportTarget(folder, game, name)
|
||||
val text = contents(game.gameIdString)
|
||||
val existed = target.exists()
|
||||
val exports = games.distinctBy { it.gameId }.map { game ->
|
||||
val target = child(folder, filename(game))
|
||||
// Keep an edited export without letting it block the rest of the library sync.
|
||||
val owned = inventoryOwns(folder, previous, target, game.gameIdString)
|
||||
val file = if (owned && target.exists() &&
|
||||
!matches(target, text)) target else exportNamed(folder, game, target.name)
|
||||
if (!existed || owned) next.put(file.name, game.gameIdString)
|
||||
val file = if (previous.optString(target.name) == game.gameIdString && target.exists() &&
|
||||
!matches(target, contents(game.gameIdString))) target else export(folder, game)
|
||||
next.put(file.name, game.gameIdString)
|
||||
file
|
||||
}
|
||||
// Write new exports before pruning; a failed write must not remove old launch files.
|
||||
@@ -141,16 +119,6 @@ object GameFiles {
|
||||
if (previous.toString() != next.toString()) write(inventory, JSONObject().put("format", FORMAT).put("games", next).toString())
|
||||
}
|
||||
|
||||
private fun inventoryOwns(folder: File, record: JSONObject, file: File, id: String): Boolean {
|
||||
if (record.optString(file.name) == id) return true
|
||||
if (!file.exists()) return false
|
||||
return record.keys().asSequence().any { name ->
|
||||
record.optString(name) == id && child(folder, name).let { old ->
|
||||
old.exists() && java.nio.file.Files.isSameFile(old.toPath(), file.toPath())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun child(folder: File, name: String): File {
|
||||
require(name.isNotEmpty() && '/' !in name && '\\' !in name && name != "." && name != "..")
|
||||
val file = File(folder, name)
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.droiddeck.launcher.frontend
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
|
||||
object GameLaunchIntent {
|
||||
const val ACTION = "com.droiddeck.launcher.LAUNCH_GAME"
|
||||
const val EXTRA_APP_ID = "app_id"
|
||||
const val EXTRA_GAME_SOURCE = "game_source"
|
||||
private const val GAMENATIVE_ACTION = "app.gamenative.LAUNCH_GAME"
|
||||
|
||||
fun accepts(action: String?): Boolean = action == Intent.ACTION_VIEW || action == ACTION || action == GAMENATIVE_ACTION
|
||||
|
||||
fun read(context: Context, intent: Intent): String? = when (intent.action) {
|
||||
Intent.ACTION_VIEW -> GameFiles.readIntent(context, intent)
|
||||
ACTION, GAMENATIVE_ACTION -> readId(intent)
|
||||
else -> null
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
internal fun readId(intent: Intent): String? = runCatching {
|
||||
if (intent.action != ACTION && intent.action != GAMENATIVE_ACTION) return null
|
||||
val source = intent.extras?.get(EXTRA_GAME_SOURCE)
|
||||
if (source != null && (source !is String || !source.equals("STEAM", ignoreCase = true))) return null
|
||||
val id = when (val value = intent.extras?.get(EXTRA_APP_ID)) {
|
||||
is Int -> value.takeIf { it > 0 }?.toString()
|
||||
is String -> value.takeIf(GameLaunchLink::validId)
|
||||
else -> null
|
||||
}
|
||||
id
|
||||
}.getOrNull()
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
package com.droiddeck.launcher.gpu
|
||||
|
||||
import android.app.ActivityManager
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import com.droiddeck.launcher.core.FileUtils
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import java.io.File
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* Everything the device info window shows about the phone's chip: SoC, GPU, CPU, memory, system,
|
||||
* the phone's own Vulkan driver and the drivers DroidDeck uses. Reads files and asks Vulkan once
|
||||
* ([VulkanInfo]), so [collect] belongs off the main thread. Values the phone does not give are
|
||||
* left out rather than guessed.
|
||||
*/
|
||||
object DeviceInfo {
|
||||
class Section(val title: String, val rows: List<Pair<String, String>>)
|
||||
|
||||
fun collect(context: Context): List<Section> {
|
||||
val vk = VulkanInfo.query()
|
||||
// After Vulkan has been asked, detection can use its name too.
|
||||
val gpu = GpuInfo.detect()
|
||||
return listOf(
|
||||
chip(), gpu(gpu), cpu(), memory(context), system(), vulkan(context, vk), drivers(context, gpu),
|
||||
).filter { it.rows.isNotEmpty() }
|
||||
}
|
||||
|
||||
/** The whole window as plain text, for a bug report. */
|
||||
fun text(sections: List<Section>): String = buildString {
|
||||
append("DroidDeck device info\n")
|
||||
for (s in sections) {
|
||||
append('\n').append(s.title).append('\n')
|
||||
for ((k, v) in s.rows) append(" ").append(k).append(": ").append(v).append('\n')
|
||||
}
|
||||
}
|
||||
|
||||
private fun MutableList<Pair<String, String>>.add(key: String, value: String?) {
|
||||
if (!value.isNullOrBlank() && value != Build.UNKNOWN) add(key to value.trim())
|
||||
}
|
||||
|
||||
private fun read(path: String): String? = FileUtils.readString(File(path))?.trim()?.ifEmpty { null }
|
||||
|
||||
private fun prop(name: String): String = GpuInfo.systemProperty(name)
|
||||
|
||||
private fun chip() = Section("Chip (SoC)", buildList<Pair<String, String>> {
|
||||
val model = SocNames.model()
|
||||
val platform = prop("ro.board.platform")
|
||||
add("Name", SocNames.name(model, platform))
|
||||
add("Model", model)
|
||||
if (Build.VERSION.SDK_INT >= 31) add("Maker", Build.SOC_MANUFACTURER)
|
||||
add("Platform", platform)
|
||||
add("Hardware", Build.HARDWARE)
|
||||
add("Board", Build.BOARD)
|
||||
val id = read("/sys/devices/soc0/soc_id")
|
||||
val machine = read("/sys/devices/soc0/machine")
|
||||
add("SoC id", listOfNotNull(id, machine).joinToString(" · "))
|
||||
add("Family", read("/sys/devices/soc0/family"))
|
||||
})
|
||||
|
||||
private fun gpu(gpu: GpuInfo) = Section("GPU", buildList<Pair<String, String>> {
|
||||
add("GPU", gpu.name)
|
||||
add("Family", gpu.family.label)
|
||||
add("Model found from", when (gpu.modelSource) {
|
||||
"kernel" -> "the kernel's GPU name"
|
||||
"vulkan" -> "the Vulkan driver (the kernel's name has no model)"
|
||||
"platform" -> "the platform (the kernel's name has no model)"
|
||||
else -> "unknown"
|
||||
})
|
||||
add("Kernel name", gpu.kgslName)
|
||||
val kgsl = "/sys/class/kgsl/kgsl-3d0"
|
||||
add("Clock range", gpuRange())
|
||||
add("Load", read("$kgsl/gpu_busy_percentage")?.let { if (it.endsWith("%")) it else "$it %" })
|
||||
add("Temperature", read("$kgsl/temp")?.toLongOrNull()?.let { if (it > 1000) "${it / 1000} °C" else "$it °C" })
|
||||
add("Support", gpu.supportText)
|
||||
})
|
||||
|
||||
private fun cpu() = Section("CPU", buildList<Pair<String, String>> {
|
||||
add("Cores", Runtime.getRuntime().availableProcessors().toString())
|
||||
// Each cpufreq policy is one cluster: the cores it covers and their speed range.
|
||||
val policies = File("/sys/devices/system/cpu/cpufreq").listFiles { f -> f.name.matches(Regex("policy\\d+")) }
|
||||
?.sortedBy { it.name.removePrefix("policy").toInt() }.orEmpty()
|
||||
for (p in policies) {
|
||||
val cpus = (read("${p.path}/related_cpus") ?: read("${p.path}/affected_cpus"))?.split(Regex("\\s+"))?.filter { it.isNotEmpty() }.orEmpty()
|
||||
val min = read("${p.path}/cpuinfo_min_freq")?.toLongOrNull()
|
||||
val max = read("${p.path}/cpuinfo_max_freq")?.toLongOrNull() ?: continue
|
||||
val cores = if (cpus.size > 1) "cores ${cpus.first()}-${cpus.last()}" else "core ${cpus.firstOrNull() ?: p.name.removePrefix("policy")}"
|
||||
add("Cluster ${p.name.removePrefix("policy")}", "${cpus.size.coerceAtLeast(1)} × $cores · " +
|
||||
(if (min != null) ghz(min) + "–" else "") + ghz(max))
|
||||
}
|
||||
add("ABI", Build.SUPPORTED_ABIS.joinToString(", "))
|
||||
})
|
||||
|
||||
private fun ghz(khz: Long) = String.format(Locale.US, "%.2f GHz", khz / 1e6)
|
||||
|
||||
/** The GPU's slowest and fastest step: KGSL's list, else a devfreq GPU node (Mali and others). */
|
||||
private fun gpuRange(): String? {
|
||||
fun mhz(hz: Long) = "${hz / 1_000_000} MHz"
|
||||
val kgsl = read("/sys/class/kgsl/kgsl-3d0/gpu_available_frequencies")
|
||||
?.split(Regex("\\s+"))?.mapNotNull { it.toLongOrNull() }?.filter { it > 0 }.orEmpty()
|
||||
if (kgsl.isNotEmpty()) return "${mhz(kgsl.min())}–${mhz(kgsl.max())} (${kgsl.size} steps)"
|
||||
read("/sys/class/kgsl/kgsl-3d0/max_gpuclk")?.toLongOrNull()?.let { return "up to ${mhz(it)}" }
|
||||
val node = File("/sys/class/devfreq").listFiles()?.firstOrNull { f ->
|
||||
val n = f.name.lowercase()
|
||||
(n.contains("gpu") || n.contains("mali") || n.contains("kgsl-3d")) && listOf("bus", "bw", "memlat").none { n.contains(it) }
|
||||
} ?: return null
|
||||
val steps = read("${node.path}/available_frequencies")?.split(Regex("\\s+"))?.mapNotNull { it.toLongOrNull() }?.filter { it > 0 }.orEmpty()
|
||||
if (steps.isNotEmpty()) return "${mhz(steps.min())}–${mhz(steps.max())} (${steps.size} steps)"
|
||||
val min = read("${node.path}/min_freq")?.toLongOrNull()
|
||||
val max = read("${node.path}/max_freq")?.toLongOrNull() ?: return null
|
||||
return (if (min != null) "${mhz(min)}–" else "up to ") + mhz(max)
|
||||
}
|
||||
|
||||
private fun memory(context: Context) = Section("Memory", buildList<Pair<String, String>> {
|
||||
val am = context.getSystemService(ActivityManager::class.java) ?: return@buildList
|
||||
val mi = ActivityManager.MemoryInfo().also(am::getMemoryInfo)
|
||||
add("Total", FileUtils.sizeToString(mi.totalMem))
|
||||
add("Available now", FileUtils.sizeToString(mi.availMem))
|
||||
})
|
||||
|
||||
private fun system() = Section("System", buildList<Pair<String, String>> {
|
||||
add("Device", "${Build.MANUFACTURER} ${Build.MODEL}")
|
||||
add("Android", "${Build.VERSION.RELEASE} (API ${Build.VERSION.SDK_INT})")
|
||||
add("Security patch", Build.VERSION.SECURITY_PATCH)
|
||||
add("Kernel", System.getProperty("os.version"))
|
||||
add("Build", Build.DISPLAY)
|
||||
})
|
||||
|
||||
private fun vulkan(context: Context, vk: Map<String, String>) = Section("Vulkan (the phone's own driver)", buildList<Pair<String, String>> {
|
||||
vk["error"]?.let { add("Error", it) }
|
||||
add("Device", vk["device"])
|
||||
add("Type", vk["type"])
|
||||
add("API version", vk["api"])
|
||||
add("Loader version", vk["loader"])
|
||||
add("Driver", listOfNotNull(vk["driver_name"], vk["driver_version"]).joinToString(" "))
|
||||
// Qualcomm's build string starts with its own label ("Driver Build: 43c70540de, ...").
|
||||
add("Driver build", vk["driver_info"]?.replace(Regex("(?i)^driver build:\\s*"), ""))
|
||||
add("Conformance", vk["conformance"])
|
||||
add("Vendor / device id", listOfNotNull(vk["vendor_id"], vk["device_id"]).joinToString(" / "))
|
||||
add("Max texture size", vk["max_image_2d"])
|
||||
add("GPU memory heap", vk["device_heap_mb"]?.let { "$it MB" })
|
||||
add("Extensions", vk["extension_count"])
|
||||
val features = listOf("geometry_shader" to "Geometry shaders", "tessellation_shader" to "Tessellation", "texture_bc" to "BC textures")
|
||||
for ((key, label) in features) add(label, vk[key])
|
||||
for ((key, value) in vk) if (key.startsWith("ext.")) add(key.removePrefix("ext."), value)
|
||||
// What Android certifies the phone for.
|
||||
val pm = context.packageManager
|
||||
val hw = pm.systemAvailableFeatures.associate { it.name to it.version }
|
||||
hw[PackageManager.FEATURE_VULKAN_HARDWARE_VERSION]?.let {
|
||||
add("Android-certified version", "${it shr 22}.${(it shr 12) and 0x3ff}.${it and 0xfff}")
|
||||
}
|
||||
hw[PackageManager.FEATURE_VULKAN_HARDWARE_LEVEL]?.let { add("Android hardware level", it.toString()) }
|
||||
})
|
||||
|
||||
private fun drivers(context: Context, gpu: GpuInfo) = Section("Drivers DroidDeck uses", buildList<Pair<String, String>> {
|
||||
add("Driver mode", SessionPrefs.gpuDriverMode(context))
|
||||
val turnip = TurnipDriver(context)
|
||||
val choice = SessionPrefs.androidDriver(context).ifEmpty { turnip.autoId() }
|
||||
add("Display driver", "${turnip.displayName(choice)} ${turnip.driverVersion(choice)}".trim())
|
||||
val linux = LinuxVulkanDriverManager(context)
|
||||
val id = SessionPrefs.linuxDriver(context)
|
||||
add("Game driver", if (id.isEmpty()) "the runtime's own Turnip" else "${linux.getDriverName(id)} ${linux.getDriverVersion(id)}".trim())
|
||||
if (gpu.oneUi8Gen2) add("Note", "One UI on an 8 Gen 2: needs the OneUI Turnip build")
|
||||
})
|
||||
}
|
||||
@@ -16,14 +16,10 @@ data class GpuInfo(
|
||||
/** The three-digit Adreno model (740, 825), or 0 when KGSL does not say. */
|
||||
val model: Int,
|
||||
val family: Family,
|
||||
/** The SoC as a person would say it ("Snapdragon 8 Gen 2 (QCS8550)"), or "" when the phone does not say. */
|
||||
/** The SoC as the device reports it ("SM8550", "QCS8550"), or "" when it does not. */
|
||||
val soc: String,
|
||||
/** Samsung's One UI on an 8 Gen 2: its Turnip needs the OneUI build, or frames tear and flicker. */
|
||||
val oneUi8Gen2: Boolean,
|
||||
/** KGSL's own name for the GPU, as the kernel spells it ("Adreno740v2", "Adreno33v2"). */
|
||||
val kgslName: String = "",
|
||||
/** Where [model] came from: "kernel", "vulkan" or "platform", "" when unknown. */
|
||||
val modelSource: String = "",
|
||||
) {
|
||||
enum class Family(val label: String) {
|
||||
A8XX("Adreno 8xx"),
|
||||
@@ -60,49 +56,17 @@ data class GpuInfo(
|
||||
val adreno = File("/sys/class/kgsl/kgsl-3d0").exists() || File("/vendor/lib64/hw/vulkan.adreno.so").exists()
|
||||
val raw = listOf("/sys/class/kgsl/kgsl-3d0/gpu_model", "/sys/class/kgsl/kgsl-3d0/gpu_chipid")
|
||||
.firstNotNullOfOrNull { FileUtils.readString(File(it))?.trim()?.takeIf(String::isNotEmpty) }
|
||||
// Where vendors put the chip's model, named when it is known: "Snapdragon 8 Gen 2 (QCS8550)".
|
||||
val soc = if (adreno) SocNames.label() else ""
|
||||
val fromKernel = raw?.let { threeDigits(it) } ?: 0
|
||||
// Some kernels name the GPU without its model (AYANEO's Pocket FIT: "Adreno33v2"). The
|
||||
// Vulkan driver's own name, when this process has asked it, then the platform's code
|
||||
// name stand in - the GPU is the same on every phone of a platform.
|
||||
val fromVulkan = if (fromKernel > 0 || !adreno) 0 else VulkanInfo.cachedOrNull()?.get("device")?.let { threeDigits(it) } ?: 0
|
||||
val fromPlatform = if (fromKernel > 0 || fromVulkan > 0 || !adreno) 0 else platformModel()
|
||||
val model = maxOf(fromKernel, fromVulkan, fromPlatform)
|
||||
val source = when {
|
||||
fromKernel > 0 -> "kernel"
|
||||
fromVulkan > 0 -> "vulkan"
|
||||
fromPlatform > 0 -> "platform"
|
||||
else -> ""
|
||||
}
|
||||
val soc = if (Build.VERSION.SDK_INT >= 31) Build.SOC_MODEL.takeIf { it.isNotBlank() && it != Build.UNKNOWN }.orEmpty() else ""
|
||||
val model = raw?.let { Regex("""(\d{3})""").find(it)?.groupValues?.get(1)?.toIntOrNull() } ?: 0
|
||||
val family = familyOf(adreno, model)
|
||||
val samsung = Build.MANUFACTURER.equals("samsung", ignoreCase = true)
|
||||
return GpuInfo(
|
||||
name = if (!adreno) Build.HARDWARE.ifBlank { "this GPU" } else if (model > 0) "Adreno $model" else "Adreno",
|
||||
model = model, family = family, soc = soc,
|
||||
oneUi8Gen2 = samsung && model == 740,
|
||||
kgslName = raw.orEmpty(), modelSource = source,
|
||||
)
|
||||
}
|
||||
|
||||
private fun threeDigits(text: String): Int = Regex("""(\d{3})""").find(text)?.groupValues?.get(1)?.toIntOrNull() ?: 0
|
||||
|
||||
/** Qualcomm platform code names whose GPU is known for certain. */
|
||||
private val PLATFORMS = mapOf(
|
||||
"msmnile" to 640, "kona" to 650, "lahaina" to 660, "taro" to 730, "cape" to 730,
|
||||
"kalama" to 740, "pineapple" to 750, "sun" to 830,
|
||||
)
|
||||
|
||||
internal fun platformModel(platform: String = systemProperty("ro.board.platform")): Int =
|
||||
PLATFORMS[platform.lowercase()] ?: PLATFORMS[systemProperty("ro.vendor.qti.soc_name").lowercase()] ?: 0
|
||||
|
||||
/** android.os.SystemProperties.get, which apps may read but not call directly. */
|
||||
fun systemProperty(name: String): String = try {
|
||||
Class.forName("android.os.SystemProperties").getMethod("get", String::class.java).invoke(null, name) as? String ?: ""
|
||||
} catch (_: Exception) {
|
||||
""
|
||||
}
|
||||
|
||||
internal fun familyOf(adreno: Boolean, model: Int): Family = when {
|
||||
!adreno -> Family.NOT_ADRENO
|
||||
model == 0 -> Family.ADRENO_UNKNOWN
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.droiddeck.launcher.gpu
|
||||
|
||||
import android.os.Build
|
||||
|
||||
/**
|
||||
* Which chip this is, as a person would say it. Handhelds often leave Android's SoC model blank
|
||||
* (the AYANEO Pocket FIT does), so the model is looked for where vendors put it, the same order
|
||||
* ClusterTune uses; then it is named from a table of models we are sure of, or from the platform
|
||||
* code name as a family ("Snapdragon 8 Gen 3 family") when the model itself is a vendor variant.
|
||||
*/
|
||||
object SocNames {
|
||||
/** Model codes whose product name is certain. */
|
||||
private val MODELS = mapOf(
|
||||
"SM8150" to "Snapdragon 855", "SM8250" to "Snapdragon 865", "SM8250-AC" to "Snapdragon 870",
|
||||
"SM8350" to "Snapdragon 888", "SM8450" to "Snapdragon 8 Gen 1", "SM8475" to "Snapdragon 8+ Gen 1",
|
||||
"SM8550" to "Snapdragon 8 Gen 2", "QCS8550" to "Snapdragon 8 Gen 2", "SM8650" to "Snapdragon 8 Gen 3",
|
||||
"SM8750" to "Snapdragon 8 Elite", "SM8850" to "Snapdragon 8 Elite Gen 5",
|
||||
"SM7325" to "Snapdragon 778G", "SM7450" to "Snapdragon 7 Gen 1", "SM7550" to "Snapdragon 7 Gen 3",
|
||||
"SM6375" to "Snapdragon 695",
|
||||
)
|
||||
|
||||
/** Platform code names: every chip of one platform shares its CPU and GPU design. */
|
||||
private val PLATFORMS = mapOf(
|
||||
"msmnile" to "Snapdragon 855/860", "kona" to "Snapdragon 865/870", "lahaina" to "Snapdragon 888",
|
||||
"taro" to "Snapdragon 8 Gen 1", "cape" to "Snapdragon 8+ Gen 1", "kalama" to "Snapdragon 8 Gen 2",
|
||||
"pineapple" to "Snapdragon 8 Gen 3", "sun" to "Snapdragon 8 Elite",
|
||||
)
|
||||
|
||||
/** The chip's model code ("QCS8550", "SG8350P"), or "" when the phone does not say. */
|
||||
fun model(prop: (String) -> String = GpuInfo::systemProperty): String {
|
||||
val sdk = if (Build.VERSION.SDK_INT >= 31) Build.SOC_MODEL.takeIf { it != Build.UNKNOWN }.orEmpty() else ""
|
||||
return listOf(prop("ro.soc.model"), prop("ro.vendor.qti.soc_model"), sdk, prop("ro.fota.platform"))
|
||||
.map { it.trim() }
|
||||
// ro.fota.platform is often a branch name ("MSM_13.0"), not a chip.
|
||||
.firstOrNull { it.isNotEmpty() && !Regex("(?i)^msm_\\d").containsMatchIn(it) }.orEmpty()
|
||||
}
|
||||
|
||||
/** "Snapdragon 8 Gen 2", "Snapdragon 8 Gen 3 family", or null when neither the model nor the platform is known. */
|
||||
fun name(model: String, platform: String = GpuInfo.systemProperty("ro.board.platform")): String? =
|
||||
MODELS[model.uppercase()] ?: PLATFORMS[platform.lowercase()]?.let { "$it family" }
|
||||
|
||||
/** For the GPU card: "Snapdragon 8 Gen 2 (QCS8550)", the bare model, or "". */
|
||||
fun label(model: String = model(), platform: String = GpuInfo.systemProperty("ro.board.platform")): String {
|
||||
val name = name(model, platform)
|
||||
return when {
|
||||
name != null && model.isNotEmpty() -> "$name ($model)"
|
||||
name != null -> name
|
||||
else -> model
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.droiddeck.launcher.gpu
|
||||
|
||||
import android.util.Log
|
||||
|
||||
/**
|
||||
* The phone's own Vulkan driver, as it describes itself (native/deviceinfo): device name, API and
|
||||
* driver versions, a few limits and the extensions DXVK/VKD3D lean on. Asked once per process and
|
||||
* kept; the first [query] creates a Vulkan instance, so it belongs off the main thread.
|
||||
*/
|
||||
object VulkanInfo {
|
||||
@Volatile private var cached: Map<String, String>? = null
|
||||
|
||||
@JvmStatic private external fun nativeQuery(): String
|
||||
|
||||
/** Blocking on first use. Empty-ish map with an "error" key when Vulkan cannot be asked. */
|
||||
@Synchronized
|
||||
fun query(): Map<String, String> {
|
||||
cached?.let { return it }
|
||||
val text = try {
|
||||
System.loadLibrary("deviceinfo")
|
||||
nativeQuery()
|
||||
} catch (t: Throwable) {
|
||||
Log.w("VulkanInfo", "query failed", t)
|
||||
"error=" + (t.message ?: t.javaClass.simpleName)
|
||||
}
|
||||
val map = text.lineSequence().mapNotNull { line ->
|
||||
val eq = line.indexOf('=')
|
||||
if (eq <= 0) null else line.substring(0, eq) to line.substring(eq + 1)
|
||||
}.toMap(LinkedHashMap())
|
||||
cached = map
|
||||
return map
|
||||
}
|
||||
|
||||
/** What [query] found, if it has run in this process; never blocks. */
|
||||
fun cachedOrNull(): Map<String, String>? = cached
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.droiddeck.launcher.input;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Where the fake input rings live and how the guest is told about them. Kept apart from
|
||||
* {@link FakeInputWriter}, which loads native code, so it can be tested on the JVM.
|
||||
*/
|
||||
final class FakeInputRingPaths {
|
||||
static final String RING_DIR_NAME = "fakeinput-rings";
|
||||
|
||||
private FakeInputRingPaths() {}
|
||||
|
||||
/** The rings sit beside the fake evdev nodes: session/dev/input -> session/dev/fakeinput-rings. */
|
||||
static File ringDir(File fakeInputDir) {
|
||||
if (fakeInputDir == null) {
|
||||
return null;
|
||||
}
|
||||
File inputDir = fakeInputDir.getAbsoluteFile();
|
||||
File parent = inputDir.getParentFile();
|
||||
return new File(parent != null ? parent : inputDir, RING_DIR_NAME);
|
||||
}
|
||||
|
||||
static File ringFile(File fakeInputDir, int slot) {
|
||||
File ringDir = ringDir(fakeInputDir);
|
||||
return ringDir != null ? new File(ringDir, "ring" + slot) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ring's path as the guest opens it. The session tree is bound into the guest at its own
|
||||
* host path, spelled the way {@code Context.getFilesDir()} spells it (LinuxRuntime.binds), so
|
||||
* the export has to use that same spelling. A canonical path is not that: where
|
||||
* /data/user/0 is a link, or a separate mount, onto /data/data (ColorOS 16, #166) it resolves
|
||||
* to a prefix nothing is bound at, and every pad, physical and on-screen, goes dead.
|
||||
*/
|
||||
static String exportPath(File ringFile) {
|
||||
return ringFile.getAbsolutePath();
|
||||
}
|
||||
}
|
||||
@@ -94,6 +94,7 @@ public class FakeInputWriter {
|
||||
private static final int RING_SNAPSHOT_SEQ_OFFSET = 32;
|
||||
private static final int RING_SNAPSHOT_BUTTONS_OFFSET = 40;
|
||||
private static final int RING_SNAPSHOT_AXES_OFFSET = 44; // short[8]
|
||||
private static final String RING_DIR_NAME = "fakeinput-rings";
|
||||
// After the events - MUST match the block in fakeinput_steam.cpp (DeckImu): what a Deck has and
|
||||
// an Xbox pad does not - motion, back grips, trackpads - in the Steam Deck controller's axes and
|
||||
// units, under a seqlock like the snapshot's. Only libfakeinput's Deck controller reads it.
|
||||
@@ -197,8 +198,26 @@ public class FakeInputWriter {
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private static File getRingDir(File fakeInputDir) {
|
||||
if (fakeInputDir == null) {
|
||||
return null;
|
||||
}
|
||||
File inputDir = fakeInputDir.getAbsoluteFile();
|
||||
File parent = inputDir.getParentFile();
|
||||
return new File(parent != null ? parent : inputDir, RING_DIR_NAME);
|
||||
}
|
||||
|
||||
private static File getRingFile(File fakeInputDir, int slot) {
|
||||
return FakeInputRingPaths.ringFile(fakeInputDir, slot);
|
||||
File ringDir = getRingDir(fakeInputDir);
|
||||
return ringDir != null ? new File(ringDir, "ring" + slot) : null;
|
||||
}
|
||||
|
||||
private static String getCanonicalOrAbsolutePath(File file) {
|
||||
try {
|
||||
return file.getCanonicalPath();
|
||||
} catch (IOException e) {
|
||||
return file.getAbsolutePath();
|
||||
}
|
||||
}
|
||||
|
||||
private static void initializeRingHeader(ByteBuffer data) {
|
||||
@@ -306,7 +325,7 @@ public class FakeInputWriter {
|
||||
ringSlot.ringFile = ringFile.getAbsoluteFile();
|
||||
ringSlot.ringRaf = raf;
|
||||
ringSlot.ringChannel = channel;
|
||||
ringSlot.exportPath = FakeInputRingPaths.exportPath(ringFile);
|
||||
ringSlot.exportPath = getCanonicalOrAbsolutePath(ringFile);
|
||||
Log.i(TAG, "Created fake input file ring for slot " + slot + ": " + ringSlot.exportPath);
|
||||
return ringSlot;
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -76,17 +76,6 @@ public final class PadBridge {
|
||||
private final java.util.Set<Integer> seenDevices = new java.util.HashSet<>();
|
||||
private int lastDeviceId = Integer.MIN_VALUE;
|
||||
|
||||
/** No physical controller is driving the pad: nothing yet, or the on-screen controls were last. */
|
||||
public static final int NO_CONTROLLER = -1;
|
||||
/**
|
||||
* The Android input device id of the physical controller that last drove the pad, or
|
||||
* {@link #NO_CONTROLLER}. Every pad feeds the one exported slot, so this is how a game's rumble
|
||||
* on that slot finds the motors in the player's hands (RumbleComponent).
|
||||
*/
|
||||
private static volatile int activeControllerId = NO_CONTROLLER;
|
||||
|
||||
public static int activeControllerId() { return activeControllerId; }
|
||||
|
||||
public PadBridge(File fakeInputDir) {
|
||||
writer = new FakeInputWriter(fakeInputDir.getAbsolutePath(), SLOT);
|
||||
}
|
||||
@@ -101,7 +90,6 @@ public final class PadBridge {
|
||||
}
|
||||
|
||||
public synchronized void stop() {
|
||||
activeControllerId = NO_CONTROLLER;
|
||||
systemGuidePressed = false;
|
||||
systemQamPressed = false;
|
||||
qamChordActive = false;
|
||||
@@ -230,7 +218,6 @@ public final class PadBridge {
|
||||
*/
|
||||
public synchronized void applyTouch(java.util.function.Consumer<PadState> mutation) {
|
||||
mutation.accept(state);
|
||||
activeControllerId = NO_CONTROLLER;
|
||||
notePlayerInput();
|
||||
statOnScreen++;
|
||||
scheduleStats();
|
||||
@@ -312,7 +299,6 @@ public final class PadBridge {
|
||||
|
||||
/** Per event, so the common case - the same pad as last time - is a single compare. */
|
||||
private void noteDevice(InputDevice device) {
|
||||
activeControllerId = device.getId();
|
||||
if (device.getId() == lastDeviceId) return;
|
||||
lastDeviceId = device.getId();
|
||||
statDevice = device.getName();
|
||||
|
||||
@@ -300,10 +300,7 @@ object BwrapSpawner {
|
||||
// session has Xwayland) it stays on X11, which works. GTK and Qt go by their own settings.
|
||||
if (env.containsKey("DISPLAY")) env["XDG_SESSION_TYPE"] = "x11"
|
||||
for (name in listOf("MOZ_DISABLE_CONTENT_SANDBOX", "MOZ_DISABLE_GMP_SANDBOX", "MOZ_DISABLE_RDD_SANDBOX",
|
||||
"MOZ_DISABLE_SOCKET_PROCESS_SANDBOX", "MOZ_DISABLE_UTILITY_SANDBOX",
|
||||
// Android 16 refuses the size seal Firefox puts on a tab's shared
|
||||
// memory, and the tab then dies on every page (droiddeck-desktop).
|
||||
"MOZ_SHM_NO_SEALS")) {
|
||||
"MOZ_DISABLE_SOCKET_PROCESS_SANDBOX", "MOZ_DISABLE_UTILITY_SANDBOX")) {
|
||||
env.putIfAbsent(name, "1")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import kotlin.math.abs
|
||||
* The client reads `/sys/class/power_supply/BAT<n>/...` - a laptop's or a Deck's naming and files
|
||||
* (`energy_now`, `power_now`, `time_to_empty_now`, a `uevent` of `POWER_SUPPLY_*` lines). Android
|
||||
* names its supply `battery` and lays it out differently, and on many phones an app may not read
|
||||
* it at all, so the client showed no battery. This writes one `BAT1` (the Deck's name)
|
||||
* it at all, so the client showed no battery. This writes a `BAT0` (and a `BAT1`, the Deck's name)
|
||||
* from Android's own battery API - the same on every device - into a directory the session binds
|
||||
* over `/sys/class/power_supply`, refreshed every few seconds while the session runs.
|
||||
*
|
||||
@@ -31,8 +31,6 @@ class BatteryComponent(val dir: File, private val vpowerDir: File) : SessionPart
|
||||
private var thread: Thread? = null
|
||||
|
||||
override fun start() {
|
||||
// Older builds exported the same aggregate battery twice; MangoHud counts both supplies.
|
||||
File(dir, "BAT0").deleteRecursively()
|
||||
running = true
|
||||
write()
|
||||
thread = Thread({
|
||||
@@ -41,7 +39,7 @@ class BatteryComponent(val dir: File, private val vpowerDir: File) : SessionPart
|
||||
if (running) write()
|
||||
}
|
||||
}, "battery-sysfs").apply { isDaemon = true; start() }
|
||||
Log.i(TAG, "battery: BAT1 written to ${dir.path} every ${PERIOD_MS / 1000} s")
|
||||
Log.i(TAG, "battery: BAT0/BAT1 written to ${dir.path} every ${PERIOD_MS / 1000} s")
|
||||
}
|
||||
|
||||
override fun stop() {
|
||||
@@ -89,7 +87,7 @@ class BatteryComponent(val dir: File, private val vpowerDir: File) : SessionPart
|
||||
pct <= 15 -> "Low"
|
||||
else -> "Normal"
|
||||
}
|
||||
for (name in listOf("BAT1")) {
|
||||
for (name in listOf("BAT0", "BAT1")) {
|
||||
val bat = File(dir, name).apply { mkdirs() }
|
||||
val attrs = linkedMapOf(
|
||||
"type" to "Battery",
|
||||
|
||||
@@ -3,58 +3,43 @@ package com.droiddeck.launcher.session
|
||||
import android.net.LocalServerSocket
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Build
|
||||
import android.os.CombinedVibration
|
||||
import android.os.VibrationEffect
|
||||
import android.os.Vibrator
|
||||
import android.os.VibratorManager
|
||||
import android.util.Log
|
||||
import android.view.InputDevice
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.droiddeck.launcher.core.SessionPart
|
||||
import com.droiddeck.launcher.input.ControllerPrefs
|
||||
import com.droiddeck.launcher.input.PadBridge
|
||||
import java.io.DataInputStream
|
||||
import kotlin.math.max
|
||||
|
||||
/**
|
||||
* Rumble for the pad, on the motors in the player's hands.
|
||||
* Rumble for the on-screen pad, on the phone itself.
|
||||
*
|
||||
* When a game plays a force-feedback effect on the fake pad (or Steam Input sends the Deck's
|
||||
* rumble report), the fake evdev layer inside the guest connects to the abstract socket [NAME]
|
||||
* and sends one packet: strong, weak, duration in ms and the pad slot, four little-endian 16-bit
|
||||
* values. This listens for those and plays the effect on the physical controller that last drove
|
||||
* the pad (PadBridge.activeControllerId) when Android exposes its motors - strong and weak
|
||||
* separately where it has two - and otherwise on the device's own vibrator, with the stronger
|
||||
* motor's strength: the on-screen pad, or a controller without rumble. Best effort both ways: a
|
||||
* missing listener costs the guest nothing, and a bad packet is dropped.
|
||||
* When a game plays a force-feedback effect on the fake pad, the fake evdev layer inside the guest
|
||||
* connects to the abstract socket [NAME] and sends one packet: strong, weak, duration in ms and
|
||||
* the pad slot, four little-endian 16-bit values. This listens for those and drives the device's
|
||||
* vibrator with the stronger motor's strength for the effect's duration. Best effort both ways:
|
||||
* a missing listener costs the guest nothing, and a bad packet is dropped.
|
||||
*/
|
||||
class RumbleComponent : SessionPart() {
|
||||
@Volatile private var server: LocalServerSocket? = null
|
||||
private var phone: Motors? = null
|
||||
/** Where the last effect went, so the next one (or a stop) can end it there. */
|
||||
private var playing: Motors? = null
|
||||
private var controllerId = PadBridge.NO_CONTROLLER
|
||||
private var controller: Motors? = null
|
||||
private var vibrator: Vibrator? = null
|
||||
private var preferences: SharedPreferences? = null
|
||||
private var enabled = false
|
||||
private val preferenceListener = SharedPreferences.OnSharedPreferenceChangeListener { _, key ->
|
||||
if (key == null || key == "rumble") refreshEnabled()
|
||||
}
|
||||
|
||||
/** The motors of the controller with this input device id, or null when it has none. Tests swap it. */
|
||||
internal var controllerMotors: (Int) -> Motors? = ::lookupController
|
||||
|
||||
@Synchronized private fun refreshEnabled() {
|
||||
enabled = app()?.let { ControllerPrefs.rumbleEnabled(it) } == true
|
||||
if (!enabled) { playing?.cancel(); playing = null }
|
||||
if (!enabled) vibrator?.cancel()
|
||||
}
|
||||
|
||||
override fun start() {
|
||||
val ctx = app() ?: return
|
||||
val s = try { LocalServerSocket(NAME) } catch (e: Exception) { Log.w(TAG, "rumble: no listener ($e)"); return }
|
||||
val vibrator = if (Build.VERSION.SDK_INT >= 31) ctx.getSystemService(VibratorManager::class.java)?.defaultVibrator
|
||||
vibrator = if (Build.VERSION.SDK_INT >= 31) ctx.getSystemService(VibratorManager::class.java)?.defaultVibrator
|
||||
else @Suppress("DEPRECATION") ctx.getSystemService(Vibrator::class.java)
|
||||
phone = vibrator?.takeIf { it.hasVibrator() }?.let { PhoneMotors(it) }
|
||||
preferences = ControllerPrefs.prefs(ctx).also { it.registerOnSharedPreferenceChangeListener(preferenceListener) }
|
||||
refreshEnabled()
|
||||
server = s
|
||||
@@ -64,7 +49,8 @@ class RumbleComponent : SessionPart() {
|
||||
try {
|
||||
val bytes = ByteArray(8)
|
||||
DataInputStream(client.inputStream).readFully(bytes)
|
||||
buzz(u16(bytes, 0), u16(bytes, 2), u16(bytes, 4))
|
||||
val strong = u16(bytes, 0); val weak = u16(bytes, 2); val ms = u16(bytes, 4)
|
||||
buzz(max(strong, weak), ms)
|
||||
} catch (e: Exception) {
|
||||
// A partial packet or a closed peer: nothing to play.
|
||||
} finally {
|
||||
@@ -79,11 +65,8 @@ class RumbleComponent : SessionPart() {
|
||||
preferences?.unregisterOnSharedPreferenceChangeListener(preferenceListener)
|
||||
preferences = null
|
||||
enabled = false
|
||||
playing?.cancel()
|
||||
playing = null
|
||||
phone = null
|
||||
controller = null
|
||||
controllerId = PadBridge.NO_CONTROLLER
|
||||
vibrator?.cancel()
|
||||
vibrator = null
|
||||
val s = server
|
||||
server = null
|
||||
try { s?.close() } catch (e: Exception) { /* the accept loop ends on the next wake */ }
|
||||
@@ -91,91 +74,24 @@ class RumbleComponent : SessionPart() {
|
||||
|
||||
private fun u16(b: ByteArray, at: Int): Int = (b[at].toInt() and 0xFF) or ((b[at + 1].toInt() and 0xFF) shl 8)
|
||||
|
||||
@Synchronized private fun buzz(strong: Int, weak: Int, ms: Int) {
|
||||
@Synchronized private fun buzz(strength: Int, ms: Int) {
|
||||
if (!enabled) return
|
||||
val target = target()
|
||||
if (target !== playing) {
|
||||
playing?.cancel()
|
||||
playing = target
|
||||
target?.let { Log.i(TAG, "rumble: playing on ${it.name}") }
|
||||
}
|
||||
if (target == null) return
|
||||
if ((strong == 0 && weak == 0) || ms == 0) { target.cancel(); return }
|
||||
val vibrator = vibrator ?: return
|
||||
if (!vibrator.hasVibrator()) return
|
||||
if (strength == 0 || ms == 0) { vibrator.cancel(); return }
|
||||
val amplitude = (strength * 255L / 65535L).toInt().coerceIn(1, 255)
|
||||
val duration = ms.toLong().coerceIn(1L, 5000L)
|
||||
try {
|
||||
target.play(strong, weak, ms.toLong().coerceIn(1L, 5000L))
|
||||
if (vibrator.hasAmplitudeControl()) vibrator.vibrate(VibrationEffect.createOneShot(duration, amplitude))
|
||||
else vibrator.vibrate(VibrationEffect.createOneShot(duration, VibrationEffect.DEFAULT_AMPLITUDE))
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "rumble: ${target.name}: $e")
|
||||
Log.w(TAG, "rumble: $e")
|
||||
}
|
||||
}
|
||||
|
||||
/** The active controller's motors when it has any, else the phone's. */
|
||||
private fun target(): Motors? {
|
||||
val id = PadBridge.activeControllerId()
|
||||
if (id != controllerId) {
|
||||
controllerId = id
|
||||
controller = if (id == PadBridge.NO_CONTROLLER) null else try { controllerMotors(id) } catch (e: Exception) { null }
|
||||
}
|
||||
return controller ?: phone
|
||||
}
|
||||
|
||||
/** One place an effect can play. Strengths are the evdev 0..65535 magnitudes. */
|
||||
internal interface Motors {
|
||||
val name: String
|
||||
fun play(strong: Int, weak: Int, ms: Long)
|
||||
fun cancel()
|
||||
}
|
||||
|
||||
private class PhoneMotors(private val vibrator: Vibrator) : Motors {
|
||||
override val name = "the device's vibrator"
|
||||
override fun play(strong: Int, weak: Int, ms: Long) = vibrator.vibrate(oneShot(vibrator, max(strong, weak), ms))
|
||||
override fun cancel() = vibrator.cancel()
|
||||
}
|
||||
|
||||
/** Android 12+: each of the pad's motors on its own, the lower id being the strong one. */
|
||||
@RequiresApi(31)
|
||||
private class PadMotors(override val name: String, private val manager: VibratorManager, private val ids: IntArray) : Motors {
|
||||
override fun play(strong: Int, weak: Int, ms: Long) {
|
||||
val combined = CombinedVibration.startParallel()
|
||||
var any = false
|
||||
fun add(id: Int, strength: Int) {
|
||||
if (strength == 0) return
|
||||
combined.addVibrator(id, oneShot(manager.getVibrator(id), strength, ms))
|
||||
any = true
|
||||
}
|
||||
if (ids.size >= 2) { add(ids[0], strong); add(ids[1], weak) } else add(ids[0], max(strong, weak))
|
||||
if (any) manager.vibrate(combined.combine()) else manager.cancel()
|
||||
}
|
||||
override fun cancel() = manager.cancel()
|
||||
}
|
||||
|
||||
/** Before Android 12 a pad has one vibrator. */
|
||||
private class LegacyPadMotors(override val name: String, private val vibrator: Vibrator) : Motors {
|
||||
override fun play(strong: Int, weak: Int, ms: Long) = vibrator.vibrate(oneShot(vibrator, max(strong, weak), ms))
|
||||
override fun cancel() = vibrator.cancel()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SessionService"
|
||||
/** Must match the fake evdev layer (fakeinput_steam.cpp). */
|
||||
const val NAME = "droiddeck-rumble"
|
||||
|
||||
private fun oneShot(vibrator: Vibrator, strength: Int, ms: Long): VibrationEffect {
|
||||
val amplitude = if (vibrator.hasAmplitudeControl()) (strength * 255L / 65535L).toInt().coerceIn(1, 255)
|
||||
else VibrationEffect.DEFAULT_AMPLITUDE
|
||||
return VibrationEffect.createOneShot(ms, amplitude)
|
||||
}
|
||||
|
||||
private fun lookupController(id: Int): Motors? {
|
||||
val device = InputDevice.getDevice(id) ?: return null
|
||||
val name = "\"${device.name}\""
|
||||
if (Build.VERSION.SDK_INT >= 31) {
|
||||
val manager = device.vibratorManager
|
||||
val ids = manager.vibratorIds.sortedArray()
|
||||
return if (ids.isEmpty()) null else PadMotors(name, manager, ids)
|
||||
}
|
||||
@Suppress("DEPRECATION")
|
||||
val vibrator = device.vibrator
|
||||
return if (vibrator.hasVibrator()) LegacyPadMotors(name, vibrator) else null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import android.content.Context
|
||||
import android.view.WindowManager
|
||||
|
||||
/** The virtual display advertised to the guest, before it is fitted onto the Android panel. */
|
||||
object SessionDisplay {
|
||||
const val MATCH_SCREEN = "screen"
|
||||
const val DEFAULT_RESOLUTION = "1280x720"
|
||||
|
||||
fun screenSize(panel: Pair<Int, Int>): Pair<Int, Int> =
|
||||
(maxOf(panel.first, panel.second) and 1.inv()) to (minOf(panel.first, panel.second) and 1.inv())
|
||||
|
||||
fun resolveChoice(panel: Pair<Int, Int>, choice: String): Pair<Int, Int> =
|
||||
if (choice == MATCH_SCREEN) screenSize(panel) else {
|
||||
// Legacy displays may exceed the custom dialog's size limit. Keep their exact size.
|
||||
val parts = choice.split('x').map { it.toIntOrNull() }
|
||||
if (parts.size == 2 && parts.all { it != null && it > 0 }) parts[0]!! to parts[1]!!
|
||||
else 1280 to 720
|
||||
}
|
||||
|
||||
/** Fixed dimensions and the current panel, with no duplicate panel-size preset. */
|
||||
fun resolutionOptions(panel: Pair<Int, Int>): List<String> =
|
||||
listOf(DEFAULT_RESOLUTION, "1600x900", "1920x1080")
|
||||
.filter { resolveChoice(panel, it) != screenSize(panel) } + MATCH_SCREEN
|
||||
|
||||
fun panelSize(context: Context): Pair<Int, Int> {
|
||||
val manager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
|
||||
@Suppress("DEPRECATION")
|
||||
val mode = manager.defaultDisplay.mode
|
||||
return maxOf(mode.physicalWidth, mode.physicalHeight) to minOf(mode.physicalWidth, mode.physicalHeight)
|
||||
}
|
||||
|
||||
/** Interpret an older cap/aspect combination without altering the saved picture size. */
|
||||
fun resolve(panel: Pair<Int, Int>, cap: Int, shape: String, custom: Pair<Int, Int>? = null): Pair<Int, Int> {
|
||||
custom?.let { return it }
|
||||
val panelW = maxOf(panel.first, panel.second).toFloat()
|
||||
val panelH = minOf(panel.first, panel.second).toFloat().coerceAtLeast(1f)
|
||||
// Auto retains wide panels but floors squarer ones at 16:9 for game compatibility.
|
||||
// Match screen removes that floor; fixed 16:9 also keeps foldable sessions stable.
|
||||
val aspect = when (shape) {
|
||||
SessionPrefs.SHAPE_WIDE -> 16f / 9f
|
||||
SessionPrefs.SHAPE_EXACT -> panelW / panelH
|
||||
else -> maxOf(panelW / panelH, 16f / 9f)
|
||||
}
|
||||
val height = (if (cap <= 0) panelH else minOf(panelH, cap.toFloat())).toInt()
|
||||
return ((height * aspect).toInt() and 1.inv()) to (height and 1.inv())
|
||||
}
|
||||
|
||||
/** Mirrors gamescope's even-width 16:9 calculation, including near-16:9 rounding. */
|
||||
fun canStretch16x9(size: Pair<Int, Int>): Boolean =
|
||||
(size.second * 16 + 4) / 9 / 2 * 2 > size.first
|
||||
}
|
||||
@@ -88,16 +88,27 @@ object SessionPrefs {
|
||||
const val SHAPE_WIDE = "16:9"
|
||||
const val SHAPE_EXACT = "exact"
|
||||
|
||||
/** The choices the settings offer, in order. */
|
||||
val shapeChoices = listOf(
|
||||
SHAPE_AUTO to "Auto (16:9+)",
|
||||
SHAPE_EXACT to "Match screen",
|
||||
SHAPE_WIDE to "Always 16:9",
|
||||
)
|
||||
|
||||
/**
|
||||
* The shape of the display the session presents: the panel's own (never narrower than 16:9),
|
||||
* exactly the panel's (a 4:3 or 3:2 handheld, drawn edge to edge), or a fixed 16:9. A foldable defaults to 16:9, which sits with modest bars on either of its
|
||||
* panels; the panel's own shape would fit one and leave a strip on the other, and gamescope's
|
||||
* display cannot change size once the session is up.
|
||||
*/
|
||||
private fun shapeMode(context: Context): String =
|
||||
fun shapeMode(context: Context): String =
|
||||
prefs(context).getString("shape", null)
|
||||
?: if (context.packageManager.hasSystemFeature("android.hardware.sensor.hinge_angle")) SHAPE_WIDE else SHAPE_AUTO
|
||||
|
||||
fun setShapeMode(context: Context, mode: String) {
|
||||
prefs(context).edit().putString("shape", mode).apply()
|
||||
}
|
||||
|
||||
fun oscMode(context: Context): String = prefs(context).getString("osc", OSC_AUTO) ?: OSC_AUTO
|
||||
|
||||
fun setOscMode(context: Context, mode: String) {
|
||||
@@ -168,12 +179,9 @@ object SessionPrefs {
|
||||
* Steam only: gamescope makes every game window the size of the screen. A game that resizes
|
||||
* its own window when it loses focus (FlatOut) otherwise comes back smaller, drawn in a
|
||||
* corner; a game that sets its own resolution and never looks at its window again (Quake 3)
|
||||
* instead draws small in the bottom-left of the stretched one. A game whose resolution differs
|
||||
* from the screen's (DiRT 3 at 1280x720) fights it: it rebuilds its swapchain on every forced
|
||||
* resize and the picture flickers between its own size and the screen's, often from the first
|
||||
* menu, before the player can reach its resolution setting. Off unless turned on.
|
||||
* instead draws small in the bottom-left of the stretched one. On unless turned off.
|
||||
*/
|
||||
fun forceFullscreen(context: Context): Boolean = prefs(context).getBoolean("forceFullscreen", false)
|
||||
fun forceFullscreen(context: Context): Boolean = prefs(context).getBoolean("forceFullscreen", true)
|
||||
|
||||
fun setForceFullscreen(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("forceFullscreen", on).apply()
|
||||
@@ -504,33 +512,11 @@ object SessionPrefs {
|
||||
* and the emulators under it get the same GPU headroom. Read once, when the session's display
|
||||
* is sized; a cap the user chose wins over the default.
|
||||
*/
|
||||
private fun resolutionCap(context: Context, mode: String): Int = prefs(context).getInt("resolutionCap.$mode", 720)
|
||||
fun resolutionCap(context: Context, mode: String): Int = prefs(context).getInt("resolutionCap.$mode", defaultResolutionCap(mode))
|
||||
|
||||
/** Whether the user chose the mode's resolution (a cap or a custom size) rather than the default. */
|
||||
fun resolutionChosen(context: Context, mode: String): Boolean =
|
||||
prefs(context).contains("displayResolution.$mode") ||
|
||||
prefs(context).contains("resolutionCap.$mode") || customResolution(context, mode) != null
|
||||
|
||||
/** One per-mode choice now owns both dimensions; old caps/shapes are read only for migration. */
|
||||
fun resolutionChoice(context: Context, mode: String, panel: Pair<Int, Int>): String {
|
||||
val saved = prefs(context)
|
||||
saved.getString("displayResolution.$mode", null)?.let { value ->
|
||||
if (value == SessionDisplay.MATCH_SCREEN) return value
|
||||
parseResolution(value)?.let { return "${it.first}x${it.second}" }
|
||||
}
|
||||
if (!resolutionChosen(context, mode) && !saved.contains("shape")) return SessionDisplay.DEFAULT_RESOLUTION
|
||||
val legacy = SessionDisplay.resolve(panel, resolutionCap(context, mode), shapeMode(context), customResolution(context, mode))
|
||||
return if (legacy == SessionDisplay.screenSize(panel)) SessionDisplay.MATCH_SCREEN
|
||||
else "${legacy.first}x${legacy.second}"
|
||||
}
|
||||
|
||||
fun setResolutionChoice(context: Context, mode: String, choice: String) {
|
||||
val value = if (choice == SessionDisplay.MATCH_SCREEN) choice else {
|
||||
val size = requireNotNull(parseResolution(choice)) { "Invalid resolution" }
|
||||
"${size.first}x${size.second}"
|
||||
}
|
||||
prefs(context).edit().putString("displayResolution.$mode", value).apply()
|
||||
}
|
||||
prefs(context).contains("resolutionCap.$mode") || customResolution(context, mode) != null
|
||||
|
||||
/**
|
||||
* The FEXCore preset for the games the client launches (core/FexPreset ids); "" = FEX's defaults.
|
||||
@@ -610,13 +596,25 @@ object SessionPrefs {
|
||||
prefs(context).edit().putString("theme", id).apply()
|
||||
}
|
||||
|
||||
/** What a mode gets when nothing was chosen. */
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
fun defaultResolutionCap(mode: String): Int = 720
|
||||
|
||||
fun setResolutionCap(context: Context, mode: String, cap: Int) {
|
||||
prefs(context).edit().putInt("resolutionCap.$mode", cap).apply()
|
||||
}
|
||||
|
||||
/**
|
||||
* A fixed size for the session's display, per mode, or null. When set it replaces both the
|
||||
* cap and the shape: the compositor fits it to the panel with bars where the shapes differ.
|
||||
*/
|
||||
private fun customResolution(context: Context, mode: String): Pair<Int, Int>? =
|
||||
fun customResolution(context: Context, mode: String): Pair<Int, Int>? =
|
||||
parseResolution(prefs(context).getString("customRes.$mode", null))
|
||||
|
||||
fun setCustomResolution(context: Context, mode: String, size: Pair<Int, Int>?) {
|
||||
prefs(context).edit().putString("customRes.$mode", size?.let { "${it.first}x${it.second}" }).apply()
|
||||
}
|
||||
|
||||
/** "1024x768" (or ×, or *) to an even size inside 320x240..3840x2160; anything else is null. */
|
||||
fun parseResolution(text: String?): Pair<Int, Int>? {
|
||||
val parts = text?.trim()?.split('x', 'X', '×', '*')?.map { it.trim() } ?: return null
|
||||
@@ -671,27 +669,20 @@ object SessionPrefs {
|
||||
|
||||
/**
|
||||
* How the compositor resizes the session onto the panel (WaylandCompositor.nativeSetUpscaler's
|
||||
* modes). Linear is the default; Nearest preserves hard pixel edges. Spatial filters work
|
||||
* when enlarged; Sharpen only works at any size. The old Off/Linear and FSR/FSR Fit pairs
|
||||
* are equivalent on Wayland, so saved aliases resolve to one choice.
|
||||
* modes): Off and Linear both filter bilinearly, Nearest keeps pixels square for 2D and old
|
||||
* titles, the rest sharpen where the picture is enlarged; FSR (fit) rounds the picture to
|
||||
* FSR's preferred size first. Sharpen only works at any size.
|
||||
*/
|
||||
val upscalerChoices = listOf(
|
||||
0 to "Linear", 2 to "Nearest", 4 to "AMD FSR 1", 3 to "Snapdragon GSR",
|
||||
0 to "Off", 1 to "Linear", 2 to "Nearest", 4 to "AMD FSR 1", 5 to "AMD FSR 1 (fit)", 3 to "Snapdragon GSR",
|
||||
8 to "Snapdragon GSR (quality)", 7 to "NVIDIA NIS", 6 to "Sharpen only",
|
||||
)
|
||||
|
||||
fun canonicalUpscaler(mode: Int): Int = when (mode) {
|
||||
1 -> 0
|
||||
5 -> 4
|
||||
else -> mode.takeIf { m -> upscalerChoices.any { it.first == m } } ?: 0
|
||||
}
|
||||
|
||||
fun upscalerHasSharpness(mode: Int): Boolean = canonicalUpscaler(mode) in 3..8
|
||||
|
||||
fun upscaler(context: Context): Int = canonicalUpscaler(prefs(context).getInt("upscaler", 0))
|
||||
fun upscaler(context: Context): Int =
|
||||
prefs(context).getInt("upscaler", 0).takeIf { m -> upscalerChoices.any { it.first == m } } ?: 0
|
||||
|
||||
fun setUpscaler(context: Context, mode: Int) {
|
||||
prefs(context).edit().putInt("upscaler", canonicalUpscaler(mode)).apply()
|
||||
prefs(context).edit().putInt("upscaler", mode).apply()
|
||||
}
|
||||
|
||||
fun upscaleSharpness(context: Context): Int = prefs(context).getInt("upscaleSharpness", 75).coerceIn(0, 100)
|
||||
|
||||
@@ -992,7 +992,6 @@ class SessionService : Service() {
|
||||
activityVisible = true
|
||||
screenOn = (getSystemService(Context.POWER_SERVICE) as? PowerManager)?.isInteractive ?: screenOn
|
||||
manualPauseRequested = false
|
||||
if (steamSleepToken == null) requestSteamWake()
|
||||
completeSteamSleep()
|
||||
suspendAttemptFailed = false
|
||||
updateSuspendPolicy()
|
||||
@@ -1071,7 +1070,7 @@ class SessionService : Service() {
|
||||
|
||||
private fun watchLaunchRequests(dir: File) {
|
||||
launchWatcher?.stopWatching()
|
||||
listOf("steam-sleep", "steam-sleep-state", "steam-sleep-ready", "steam-wake", "steam-wake.tmp").forEach { File(dir, it).delete() }
|
||||
listOf("steam-sleep", "steam-sleep-state", "steam-sleep-ready").forEach { File(dir, it).delete() }
|
||||
val gen = sessionGen
|
||||
@Suppress("DEPRECATION")
|
||||
val watcher = object : android.os.FileObserver(dir.path, CLOSE_WRITE or MOVED_TO) {
|
||||
@@ -1212,21 +1211,7 @@ class SessionService : Service() {
|
||||
}
|
||||
|
||||
private fun resumeSteamSleepOnReturn() {
|
||||
if (suspendPolicy == SessionPrefs.SUSPEND_AUTO && activityVisible && screenOn) {
|
||||
if (steamSleepToken == null) requestSteamWake()
|
||||
completeSteamSleep()
|
||||
}
|
||||
}
|
||||
|
||||
/** Resume must also recover a Steam sleep whose request never reached Android. */
|
||||
private fun requestSteamWake() {
|
||||
if (!SessionState.running || SessionState.mode != MODE_STEAM) return
|
||||
val dir = LinuxRuntime.sessionRoot(this)
|
||||
runCatching {
|
||||
val staged = File(dir, "steam-wake.tmp")
|
||||
staged.writeText("wake\n")
|
||||
check(staged.renameTo(File(dir, "steam-wake")))
|
||||
}.onFailure { Log.w(TAG, "could not request Steam wake", it) }
|
||||
if (suspendPolicy == SessionPrefs.SUSPEND_AUTO && activityVisible && screenOn) completeSteamSleep()
|
||||
}
|
||||
|
||||
private fun finishSessionStop(status: Int, stoppedGen: Int) {
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import android.content.Context
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import java.io.File
|
||||
|
||||
object SteamRepair {
|
||||
private fun home(context: Context) = File(LinuxRuntime.rootDir(context), "root")
|
||||
private fun request(context: Context) = File(home(context), ".bl-steam-repair")
|
||||
private fun unconfirmed(context: Context) = File(home(context), ".local/share/Steam/package/droiddeck-unconfirmed")
|
||||
|
||||
fun queued(context: Context): Boolean = request(context).exists()
|
||||
|
||||
fun queue(context: Context): Boolean = runCatching {
|
||||
request(context).apply { parentFile?.mkdirs() }.writeText("1\n")
|
||||
}.isSuccess
|
||||
|
||||
fun clientShown(context: Context) {
|
||||
unconfirmed(context).delete()
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.ui.unit.Density
|
||||
import com.droiddeck.launcher.core.AppUiPrefs
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
internal fun scaledAppDensity(base: Density, percent: Int): Density {
|
||||
val scale = AppUiPrefs.normalizeScale(percent) / 100f
|
||||
return if (scale == 1f) base else Density(base.density * scale, base.fontScale)
|
||||
}
|
||||
|
||||
/** Responsive layouts and popup height limits must see the same dp space as the scaled UI. */
|
||||
internal fun scaledAppConfiguration(base: Configuration, percent: Int): Configuration {
|
||||
val scale = AppUiPrefs.normalizeScale(percent) / 100f
|
||||
if (scale == 1f) return base
|
||||
return Configuration(base).apply {
|
||||
if (densityDpi > 0) densityDpi = (densityDpi * scale).roundToInt()
|
||||
if (screenWidthDp > 0) screenWidthDp = (screenWidthDp / scale).roundToInt()
|
||||
if (screenHeightDp > 0) screenHeightDp = (screenHeightDp / scale).roundToInt()
|
||||
if (smallestScreenWidthDp > 0) smallestScreenWidthDp = (smallestScreenWidthDp / scale).roundToInt()
|
||||
}
|
||||
}
|
||||
@@ -108,6 +108,8 @@ fun ComponentsPage(
|
||||
/** The GPU drivers tab ([GPU_TAB]): what it shows and does. */
|
||||
gpu: GpuDriversState = GpuDriversState(),
|
||||
gpuActions: GpuDriversActions = GpuDriversActions(),
|
||||
defaultProtonId: String? = null,
|
||||
onDefaultProton: (String) -> Unit = {},
|
||||
) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
@@ -117,11 +119,13 @@ fun ComponentsPage(
|
||||
var confirmTitle by remember { mutableStateOf("") }
|
||||
var about by remember { mutableStateOf(false) }
|
||||
var protonMenu by remember { mutableStateOf(false) }
|
||||
var defaultProtonMenu by remember { mutableStateOf(false) }
|
||||
var confirmVerb by remember { mutableStateOf(R.string.comp_swap) }
|
||||
val ctx = LocalContext.current
|
||||
fun ask(title: String, body: String, verb: Int, action: () -> Unit) { confirmTitle = title; confirmVerb = verb; confirm = body to action }
|
||||
// The GPU drivers tab's Advanced pages: one driver list on its own, full page.
|
||||
var driverPage by remember { mutableStateOf<String?>(null) }
|
||||
val gpuScroll = rememberScrollState()
|
||||
val gpuTab = comp == GPU_TAB
|
||||
when (driverPage) {
|
||||
"rt" -> {
|
||||
@@ -172,34 +176,54 @@ fun ComponentsPage(
|
||||
}
|
||||
if (narrow) Text(nightlies, fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
|
||||
// ---- which Proton, which component ------------------------------------------------------
|
||||
// ---- Steam default Proton and the component editing target -----------------------------
|
||||
val comps = ComponentsManager.COMPONENTS
|
||||
androidx.compose.foundation.layout.FlowRow(
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp), verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 12.dp),
|
||||
) {
|
||||
if (view != null && !gpuTab) Box {
|
||||
ValueChip(view.proton.name, protonMenu, modifier = Modifier.widthIn(max = 300.dp).heightIn(min = 44.dp)) { protonMenu = !protonMenu }
|
||||
AnchoredMenu(protonMenu, onDismiss = { protonMenu = false }, title = stringResource(R.string.comp_proton),
|
||||
note = stringResource(R.string.comp_proton_note)) { first ->
|
||||
views.forEachIndexed { i, v ->
|
||||
val swaps = v.components.values.count { it.activeFile != null }
|
||||
MenuItem(
|
||||
v.proton.name, checked = v.proton.id == view.proton.id,
|
||||
detail = (if (swaps > 0) stringResource(R.string.comp_swapped, v.proton.version, swaps) else stringResource(R.string.comp_all_original, v.proton.version))
|
||||
.let {
|
||||
when (v.sync?.state) {
|
||||
"pack" -> stringResource(R.string.comp_esync_pack, it)
|
||||
"wanted" -> stringResource(R.string.comp_esync_wanted, it)
|
||||
"builtin" -> stringResource(R.string.comp_esync_builtin, it)
|
||||
else -> it
|
||||
}
|
||||
}
|
||||
.let { if (v.inUseByGame) stringResource(R.string.comp_game_running_suffix, it) else it },
|
||||
focusRequester = if (i == 0) first else null,
|
||||
) { onProton(v.proton.id); protonMenu = false }
|
||||
if (view != null && !gpuTab) {
|
||||
SettingsAnchor("default-proton", Modifier.widthIn(max = 300.dp)) { Column {
|
||||
Text("Default Proton", fontSize = 12.sp, color = colors.onSurfaceVariant)
|
||||
Box {
|
||||
val defaultName = views.firstOrNull { it.proton.id == defaultProtonId }?.proton?.name ?: "Choose default"
|
||||
ValueChip(defaultName, defaultProtonMenu, modifier = Modifier.widthIn(max = 300.dp).heightIn(min = 44.dp)) { defaultProtonMenu = !defaultProtonMenu }
|
||||
AnchoredMenu(defaultProtonMenu, onDismiss = { defaultProtonMenu = false }, title = "Default Proton",
|
||||
note = stringResource(R.string.comp_proton_note)) { first ->
|
||||
views.forEachIndexed { i, v ->
|
||||
MenuItem(v.proton.name, checked = v.proton.id == defaultProtonId,
|
||||
focusRequester = if (i == 0) first else null,
|
||||
) { onDefaultProton(v.proton.id); defaultProtonMenu = false }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} }
|
||||
SettingsAnchor("editing-proton", Modifier.widthIn(max = 300.dp)) { Column {
|
||||
Text("Editing components for", fontSize = 12.sp, color = colors.onSurfaceVariant)
|
||||
Box {
|
||||
ValueChip(view.proton.name, protonMenu, modifier = Modifier.widthIn(max = 300.dp).heightIn(min = 44.dp)) { protonMenu = !protonMenu }
|
||||
AnchoredMenu(protonMenu, onDismiss = { protonMenu = false }, title = "Editing components for",
|
||||
note = "Component changes apply to this Proton. The default Proton is selected separately above.") { first ->
|
||||
views.forEachIndexed { i, v ->
|
||||
val swaps = v.components.values.count { it.activeFile != null }
|
||||
MenuItem(
|
||||
v.proton.name, checked = v.proton.id == view.proton.id,
|
||||
detail = (if (swaps > 0) stringResource(R.string.comp_swapped, v.proton.version, swaps) else stringResource(R.string.comp_all_original, v.proton.version))
|
||||
.let {
|
||||
when (v.sync?.state) {
|
||||
"pack" -> stringResource(R.string.comp_esync_pack, it)
|
||||
"wanted" -> stringResource(R.string.comp_esync_wanted, it)
|
||||
"builtin" -> stringResource(R.string.comp_esync_builtin, it)
|
||||
else -> it
|
||||
}
|
||||
}
|
||||
.let { if (v.inUseByGame) stringResource(R.string.comp_game_running_suffix, it) else it },
|
||||
focusRequester = if (i == 0) first else null,
|
||||
) { onProton(v.proton.id); protonMenu = false }
|
||||
}
|
||||
}
|
||||
}
|
||||
} }
|
||||
}
|
||||
val tabs = listOf(GPU_TAB) + comps
|
||||
TabStrip(tabs.map { ComponentsManager.LABEL[it] ?: stringResource(R.string.comp_gpu_drivers) }, tabs.indexOf(comp).coerceAtLeast(0), { onComp(tabs[it]) })
|
||||
@@ -230,7 +254,7 @@ fun ComponentsPage(
|
||||
|
||||
// ---- the lists ------------------------------------------------------------------------------
|
||||
when {
|
||||
gpuTab -> Column(Modifier.weight(1f).fillMaxWidth().verticalScroll(rememberScrollState()).padding(bottom = 16.dp)) {
|
||||
gpuTab -> Column(Modifier.weight(1f).fillMaxWidth().verticalScroll(gpuScroll).padding(bottom = 16.dp)) {
|
||||
GpuDriversPanel(gpu, gpuActions) { driverPage = it }
|
||||
Row(modifier = Modifier.padding(top = 14.dp)) {
|
||||
SmallButton(stringResource(R.string.comp_import_zip), onClick = gpuActions.onImportZip)
|
||||
|
||||
@@ -42,12 +42,12 @@ private fun Swatch(color: Int) {
|
||||
@Composable
|
||||
fun ColumnScope.ControllerRows(host: MenuHost, oscMode: String, c: ControllerPrefs.Settings, a: ControllerActions) {
|
||||
ChoiceRow(
|
||||
host, "controller-osc", stringResource(R.string.mode_osc), stringResource(R.string.ctrl_osc_hint),
|
||||
host, "controller-osc", stringResource(R.string.mode_osc), null,
|
||||
listOf(SessionPrefs.OSC_AUTO to stringResource(R.string.common_auto), SessionPrefs.OSC_ALWAYS to stringResource(R.string.common_always), SessionPrefs.OSC_STEAM_QAM to stringResource(R.string.mode_osc_qam), SessionPrefs.OSC_NEVER to stringResource(R.string.common_never)),
|
||||
oscMode, note = stringResource(R.string.mode_osc_note), onPick = a.onOsc,
|
||||
)
|
||||
val tintOpen = host.open == "controller-tint"
|
||||
SettingsRow(stringResource(R.string.ctrl_color), stringResource(R.string.ctrl_color_hint), highlighted = tintOpen) {
|
||||
SettingsAnchor("controller-tint") { SettingsRow(stringResource(R.string.ctrl_color), null, highlighted = tintOpen) {
|
||||
Box {
|
||||
ValueChip(ControllerPrefs.tints.firstOrNull { it.first == c.tint }?.second ?: stringResource(R.string.ctrl_custom), tintOpen) {
|
||||
host.open = if (tintOpen) null else "controller-tint"
|
||||
@@ -61,24 +61,24 @@ fun ColumnScope.ControllerRows(host: MenuHost, oscMode: String, c: ControllerPre
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} }
|
||||
ChoiceRow(host, "controller-opacity", stringResource(R.string.ctrl_opacity), null, ControllerPrefs.opacities.map { it to stringResource(R.string.ctrl_percent, it) }, c.opacity, onPick = a.onOpacity)
|
||||
ChoiceRow(host, "controller-size", stringResource(R.string.ctrl_size), stringResource(R.string.ctrl_size_hint), ControllerPrefs.sizes.map { it to stringResource(R.string.ctrl_percent, it) }, c.size, onPick = a.onSize)
|
||||
ChoiceRow(host, "controller-size", stringResource(R.string.ctrl_size), null, ControllerPrefs.sizes.map { it to stringResource(R.string.ctrl_percent, it) }, c.size, onPick = a.onSize)
|
||||
ToggleRow(host, "controller-stick-click", stringResource(R.string.ctrl_stick_click), stringResource(R.string.ctrl_stick_click_hint), c.stickClick, onChange = a.onStickClick)
|
||||
ToggleRow(host, "controller-adaptive", stringResource(R.string.ctrl_adaptive), stringResource(R.string.ctrl_adaptive_hint), c.adaptiveSticks, onChange = a.onAdaptiveSticks)
|
||||
ToggleRow(host, "controller-rumble", stringResource(R.string.ctrl_rumble), null, c.rumble, onChange = a.onRumble)
|
||||
ToggleRow(host, "controller-steam", stringResource(R.string.ctrl_steam_button), null, c.steamButton, onChange = a.onSteamButton)
|
||||
ToggleRow(host, "controller-qam", stringResource(R.string.ctrl_qam_button), null, c.qamButton, onChange = a.onQamButton)
|
||||
ToggleRow(host, "controller-keyboard", stringResource(R.string.ctrl_keyboard_button), null, c.keyboardButton, onChange = a.onKeyboardButton)
|
||||
SettingsRow(stringResource(R.string.ctrl_layout), if (c.customLayout) stringResource(R.string.ctrl_layout_custom) else stringResource(R.string.ctrl_layout_default)) {
|
||||
SettingsAnchor("controller-layout") { SettingsRow(stringResource(R.string.ctrl_layout), if (c.customLayout) stringResource(R.string.ctrl_layout_custom) else stringResource(R.string.ctrl_layout_default)) {
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
SecondaryButton(stringResource(R.string.ctrl_edit)) { a.onEditLayout() }
|
||||
SecondaryButton(stringResource(R.string.ctrl_reset), enabled = c.customLayout) { a.onResetLayout() }
|
||||
}
|
||||
}
|
||||
} }
|
||||
val remapped = c.mapping.count { (id, target) -> id != target }
|
||||
ActionRow(stringResource(R.string.ctrl_mapping), if (remapped == 0) stringResource(R.string.ctrl_mapping_default) else stringResource(R.string.ctrl_mapping_count, remapped, c.mapping.size), stringResource(R.string.ctrl_configure), a.onMapping)
|
||||
ActionRow(stringResource(R.string.ctrl_reset_all), stringResource(R.string.ctrl_reset_all_hint), stringResource(R.string.ctrl_reset), a.onResetAll)
|
||||
SettingsAnchor("controller-mapping") { ActionRow(stringResource(R.string.ctrl_mapping), if (remapped == 0) stringResource(R.string.ctrl_mapping_default) else stringResource(R.string.ctrl_mapping_count, remapped, c.mapping.size), stringResource(R.string.ctrl_configure), a.onMapping) }
|
||||
SettingsAnchor("controller-reset") { ActionRow(stringResource(R.string.ctrl_reset_all), stringResource(R.string.ctrl_reset_all_hint), stringResource(R.string.ctrl_reset), a.onResetAll) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -119,6 +119,7 @@ internal fun Pane(
|
||||
val pal = LocalPalette.current
|
||||
// Pages keep drawing while they leave, so one can fold away instead of blinking out.
|
||||
val pages = remember { HashMap<String, @Composable () -> Unit>() }
|
||||
val savedPages = androidx.compose.runtime.saveable.rememberSaveableStateHolder()
|
||||
// Pages opened from a control (the cog), with where that control sat, in this pane's coordinates.
|
||||
val origins = remember { HashMap<String, Origin>() }
|
||||
val paneAt = remember { arrayOf(Offset.Zero) }
|
||||
@@ -154,6 +155,7 @@ internal fun Pane(
|
||||
label = "pane",
|
||||
) { key ->
|
||||
val shown = if (page != null && key == s.pageKey) page else pages[key]
|
||||
savedPages.SaveableStateProvider(key) {
|
||||
if (shown != null) {
|
||||
DisposableEffect(key) { onDispose { if (key != livePage) { pages.remove(key); origins.remove(key) } } }
|
||||
val from = origins[key]
|
||||
@@ -168,6 +170,7 @@ internal fun Pane(
|
||||
}
|
||||
}
|
||||
else Content(s, if (key == "games") gameShown[0] else key, a, Modifier.fillMaxSize(), onSelect, onAndroidAppClick, onOpenDeveloperOptions, onRequestWirelessAdb)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,10 +212,10 @@ private fun Content(
|
||||
val narrow = LocalNarrowPane.current
|
||||
val padH = if (narrow) 16.dp else 22.dp
|
||||
val padV = if (narrow) 12.dp else 18.dp
|
||||
// Setup scrolls inside itself, under its tabs.
|
||||
if (selected == "setup") {
|
||||
// Settings has its own search and scrolling.
|
||||
if (selected == "settings") {
|
||||
Column(modifier = modifier.padding(horizontal = padH, vertical = padV)) {
|
||||
SetupPanel(s, a, onOpenDeveloperOptions, onRequestWirelessAdb)
|
||||
SettingsHub(s, a)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ private fun GameRow(g: Library.SteamGame, selected: Boolean, onSelect: () -> Uni
|
||||
}
|
||||
}
|
||||
|
||||
/** A page's title, with room at its right for controls or status. */
|
||||
/** A page's title, with room at its right for a status chip. */
|
||||
@Composable
|
||||
internal fun PageHeader(title: String, trailing: @Composable RowScope.() -> Unit = {}) {
|
||||
Row(
|
||||
|
||||
@@ -93,14 +93,14 @@ internal fun SideRail(
|
||||
val compact = LocalConfiguration.current.screenHeightDp < 420
|
||||
// Under 600dp wide (4:3 and square screens) the labels would cost a fifth of the width.
|
||||
val iconOnly = isNarrowScreen()
|
||||
val setupNeedsAttention = !s.ready || (s.available != null && s.available != s.installed) ||
|
||||
val settingsNeedsAttention = !s.ready || (s.available != null && s.available != s.installed) ||
|
||||
PhantomProcessLimit.blocksSteam(s.phantomProcessStatus)
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = modifier.width(if (iconOnly) 64.dp else 92.dp).background(colors.surface).padding(vertical = if (compact) 8.dp else 12.dp),
|
||||
) {
|
||||
// Every section on screen at once: items shrink (to 44dp, still a touch target) before the rail scrolls.
|
||||
val count = 6 + (if (s.storeEnabled) 1 else 0) + (if (s.isHomeApp) 1 else 0)
|
||||
val count = 5 + (if (s.storeEnabled) 1 else 0) + (if (s.isHomeApp) 1 else 0)
|
||||
BoxWithConstraints(Modifier.weight(1f).fillMaxWidth()) {
|
||||
val fit = (maxHeight / count - 4.dp).coerceIn(44.dp, if (iconOnly) 48.dp else if (compact) 52.dp else 60.dp)
|
||||
Column(
|
||||
@@ -113,10 +113,9 @@ internal fun SideRail(
|
||||
RailItem(stringResource(R.string.rail_games), Icons.Outlined.VideoLibrary, "games", selected == "games", compact, iconOnly, fit, onFocus = { onFocusSelect("games") }) { onSelect("games") }
|
||||
RailItem(stringResource(R.string.rail_desktop), Icons.Outlined.DesktopWindows, "desktop", selected == "desktop", compact, iconOnly, fit, onFocus = { onFocusSelect("desktop") }) { onSelect("desktop") }
|
||||
if (s.storeEnabled) RailItem(stringResource(R.string.rail_store), Icons.Outlined.Storefront, "store", selected == "store", compact, iconOnly, fit, onFocus = { onFocusSelect("store") }) { onSelect("store") }
|
||||
RailItem(stringResource(R.string.rail_components), Icons.Outlined.Layers, "components", selected == "components", compact, iconOnly, fit, onFocus = { onFocusSelect("components") }) { onSelect("components") }
|
||||
// Home mode's extra section goes last, so it shifts nothing above it.
|
||||
if (s.isHomeApp) RailItem(stringResource(R.string.rail_apps), Icons.Outlined.Apps, "android-apps", selected == "android-apps", compact, iconOnly, fit, onFocus = { onFocusSelect("android-apps") }) { onSelect("android-apps") }
|
||||
RailItem(stringResource(R.string.rail_setup), Icons.Outlined.Tune, "setup", selected == "setup", compact, iconOnly, fit, badge = setupNeedsAttention, onFocus = { onFocusSelect("setup") }) { onSelect("setup") }
|
||||
RailItem(stringResource(R.string.settings_title), Icons.Outlined.Tune, "settings", selected == "settings", compact, iconOnly, fit, badge = settingsNeedsAttention, onFocus = { onFocusSelect("settings") }) { onSelect("settings") }
|
||||
RailItem(stringResource(R.string.rail_updates), Icons.Outlined.SystemUpdate, "updates", selected == "updates", compact, iconOnly, fit, badge = s.updates.hasUpdate, onFocus = { onFocusSelect("updates") }) { onSelect("updates") }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,8 +100,11 @@ class FrontEndState(
|
||||
val shortcutLibraryScanning: Boolean = false,
|
||||
val gameSyncFolder: String? = null,
|
||||
val pageKey: String? = null,
|
||||
val settingsCategory: SettingsCategory? = null,
|
||||
val settingsMode: String = "steam",
|
||||
val settingsTarget: String? = null,
|
||||
val requestedRailTab: String? = null,
|
||||
val theme: String = Themes.GRAPHITE,
|
||||
val appScale: Int = com.droiddeck.launcher.core.AppUiPrefs.DEFAULT_SCALE,
|
||||
val isHomeApp: Boolean = false,
|
||||
val homeScreenEnabled: Boolean = false,
|
||||
val defaultHomeLabel: String? = null,
|
||||
@@ -123,7 +126,7 @@ class FrontEndState(
|
||||
val showPhantomGate: Boolean = false,
|
||||
val launcherFullscreen: Boolean = true,
|
||||
val animationsEnabled: Boolean = true,
|
||||
/** The Flathub Store, a beta the user turns on in Setup. */
|
||||
/** The Flathub Store, a beta the user turns on in Settings. */
|
||||
val storeEnabled: Boolean = false,
|
||||
/** The Updates page: DroidDeck's own builds and the channel followed. */
|
||||
val updates: UpdatesState = UpdatesState(),
|
||||
@@ -168,8 +171,12 @@ class FrontEndActions(
|
||||
val onClearLogs: () -> Unit = {},
|
||||
val onOffline: () -> Unit,
|
||||
val onPageBack: () -> Unit = {},
|
||||
val onCloseSettings: () -> Unit = {},
|
||||
val onSettingsCategory: (SettingsCategory, String?) -> Unit = { _, _ -> },
|
||||
val onSettingsMode: (String) -> Unit = {},
|
||||
val onOpenUpdates: () -> Unit = {},
|
||||
val onRailTabHandled: () -> Unit = {},
|
||||
val onTheme: (String) -> Unit = {},
|
||||
val onAppScale: (Int) -> Unit = {},
|
||||
val onLauncherFullscreen: (Boolean) -> Unit = {},
|
||||
val onAnimationsEnabled: (Boolean) -> Unit = {},
|
||||
val onStoreEnabled: (Boolean) -> Unit = {},
|
||||
@@ -340,14 +347,22 @@ internal suspend fun focusWithinFrames(done: () -> Boolean, target: () -> FocusR
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun FrontEndScreen(s: FrontEndState, a: FrontEndActions, page: (@Composable () -> Unit)? = null) {
|
||||
fun FrontEndScreen(
|
||||
s: FrontEndState,
|
||||
a: FrontEndActions,
|
||||
page: (@Composable () -> Unit)? = null,
|
||||
settingsContent: (@Composable (FrontEndState, FrontEndActions, () -> Unit, (Boolean) -> Unit) -> Unit)? = null,
|
||||
) {
|
||||
val frontFocus = remember { FrontFocus() }
|
||||
CompositionLocalProvider(LocalFrontFocus provides frontFocus) { FrontEndScreenBody(s, a, page, frontFocus) }
|
||||
CompositionLocalProvider(LocalFrontFocus provides frontFocus) { FrontEndScreenBody(s, a, page, frontFocus, settingsContent) }
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Composable () -> Unit)?, frontFocus: FrontFocus) {
|
||||
private fun FrontEndScreenBody(
|
||||
s: FrontEndState, a: FrontEndActions, externalPage: (@Composable () -> Unit)?, frontFocus: FrontFocus,
|
||||
settingsContent: (@Composable (FrontEndState, FrontEndActions, () -> Unit, (Boolean) -> Unit) -> Unit)?,
|
||||
) {
|
||||
var selected by rememberSaveable { mutableStateOf(if (s.shortcutPicker) "games" else "steam") }
|
||||
LaunchedEffect(s.shortcutPicker) { if (s.shortcutPicker) selected = "games" }
|
||||
var showWirelessAdbFix by rememberSaveable { mutableStateOf(false) }
|
||||
@@ -367,6 +382,14 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
wirelessAdbDesiredEnabled = enabled
|
||||
showWirelessAdbFix = true
|
||||
}
|
||||
val page: (@Composable () -> Unit)? = if (s.settingsCategory != null && settingsContent != null) {
|
||||
{ settingsContent(s, a, requestDeveloperOptions, requestWirelessAdbFix) }
|
||||
} else externalPage?.let { content ->
|
||||
{ CompositionLocalProvider(LocalSettingsTarget provides s.settingsTarget, LocalSettingsAnchorsEnabled provides true) { content() } }
|
||||
}
|
||||
LaunchedEffect(s.requestedRailTab) {
|
||||
s.requestedRailTab?.let { selected = it; a.onRailTabHandled() }
|
||||
}
|
||||
LaunchedEffect(s.showPhantomGate, s.phantomProcessStatus) {
|
||||
if (phantomGateVisible) {
|
||||
while (true) {
|
||||
@@ -385,7 +408,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
selected = if (selected.startsWith("rom:")) "emu:" + selected.removePrefix("rom:").substringBefore(':') else "desktop"
|
||||
}
|
||||
LaunchedEffect(s.isHomeApp) { if (!s.isHomeApp && selected == "android-apps") selected = "steam" }
|
||||
// The Store turned off in Setup takes its page with it.
|
||||
// The Store turned off in Settings takes its page with it.
|
||||
LaunchedEffect(s.storeEnabled) { if (!s.storeEnabled && selected == "store") selected = "steam" }
|
||||
// The last game uninstalled leaves the Games tab on its empty state.
|
||||
LaunchedEffect(s.steamGames.isEmpty()) {
|
||||
@@ -394,23 +417,15 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
remember { Motion.refresh(ctx); true }
|
||||
|
||||
val railSelection = when {
|
||||
s.pageKey == "performance" || s.pageKey == "protons" || s.pageKey == "controller-mapping" -> "setup"
|
||||
s.pageKey?.startsWith("settings:steam") == true -> "steam"
|
||||
s.pageKey?.startsWith("settings:") == true -> "desktop"
|
||||
s.pageKey != null -> "settings"
|
||||
selected.startsWith("app:") -> "games"
|
||||
selected.startsWith("emu:") || selected.startsWith("rom:") || selected.startsWith("user:") -> "desktop"
|
||||
else -> s.pageKey ?: selected
|
||||
else -> selected
|
||||
}
|
||||
// Bumped each time a rail item is picked, so a controller moves on into the new page.
|
||||
var railPicks by remember { mutableStateOf(0) }
|
||||
val showRailPage: (String, Boolean) -> Unit = { key, focusContent ->
|
||||
// Components is a full page like Protons or Performance, opened over the current rail
|
||||
// selection rather than replacing it.
|
||||
if (key == "components") a.onComponents(focusContent)
|
||||
else {
|
||||
if (s.pageKey != null) a.onPageBack()
|
||||
selected = key
|
||||
}
|
||||
val showRailPage: (String, Boolean) -> Unit = { key, _ ->
|
||||
if (s.pageKey != null) a.onCloseSettings()
|
||||
selected = key
|
||||
}
|
||||
val onRailFocus: (String) -> Unit = { key ->
|
||||
if (key != railSelection) showRailPage(key, false)
|
||||
|
||||
@@ -77,7 +77,7 @@ import com.droiddeck.launcher.core.PhantomProcessStatus
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.R
|
||||
|
||||
// The Setup page: runtime and device checks, tools, frame generation and launch settings.
|
||||
// Existing launcher preference owners, grouped into Settings categories.
|
||||
|
||||
private enum class CheckState { OK, WARN, BUSY }
|
||||
|
||||
@@ -122,30 +122,134 @@ private fun CheckRow(state: CheckState, title: String, detail: String?, divider:
|
||||
if (divider) Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
|
||||
}
|
||||
|
||||
/** Settings owned by Setup's existing state/actions, split into hub categories. */
|
||||
@Composable
|
||||
internal fun SetupPanel(
|
||||
internal fun SetupContent(
|
||||
s: FrontEndState,
|
||||
a: FrontEndActions,
|
||||
category: SettingsCategory,
|
||||
host: MenuHost,
|
||||
onOpenDeveloperOptions: () -> Unit,
|
||||
onRequestWirelessAdb: (Boolean) -> Unit,
|
||||
) {
|
||||
when (category) {
|
||||
SettingsCategory.GENERAL -> GeneralSettings(s, a, host)
|
||||
SettingsCategory.DISPLAY -> DisplaySettings(s, a, host)
|
||||
SettingsCategory.CONTROLS -> ControlsSettings(s, a, host)
|
||||
SettingsCategory.AUDIO -> Unit
|
||||
SettingsCategory.LIBRARY -> LibrarySettings(s, a)
|
||||
SettingsCategory.SESSIONS -> SessionSettings(s, a, host)
|
||||
SettingsCategory.COMPATIBILITY -> CompatibilitySettings(s, a)
|
||||
SettingsCategory.SUPPORT -> SupportSettings(s, a, onOpenDeveloperOptions, onRequestWirelessAdb)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun GeneralSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost) {
|
||||
SettingsGroup(stringResource(R.string.setup_launcher)) {
|
||||
SettingsAnchor("theme") { SettingsRow(stringResource(R.string.setup_theme), null) {
|
||||
Box {
|
||||
ValueChip(Themes.byId(s.theme).label, host.open == "theme") { host.open = if (host.open == "theme") null else "theme" }
|
||||
AnchoredMenu(host.open == "theme", onDismiss = { if (host.open == "theme") host.open = null }, title = stringResource(R.string.setup_theme)) { firstItemFocus ->
|
||||
Themes.all.forEachIndexed { index, theme ->
|
||||
MenuItem(theme.label, checked = s.theme == theme.id, focusRequester = if (index == 0) firstItemFocus else null) {
|
||||
a.onTheme(theme.id)
|
||||
host.open = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} }
|
||||
ToggleRow(host, "home-screen", stringResource(R.string.setup_home),
|
||||
if (s.homeScreenEnabled) stringResource(R.string.setup_home_on) else stringResource(R.string.setup_home_off),
|
||||
s.homeScreenEnabled) { a.onHomeScreen(it) }
|
||||
ToggleRow(host, "launcher-fullscreen", stringResource(R.string.setup_fullscreen),
|
||||
if (s.launcherFullscreen) stringResource(R.string.setup_fullscreen_on) else stringResource(R.string.setup_fullscreen_off),
|
||||
s.launcherFullscreen) { a.onLauncherFullscreen(it) }
|
||||
ToggleRow(host, "launcher-animations", stringResource(R.string.setup_animations), null,
|
||||
s.animationsEnabled, onChange = a.onAnimationsEnabled)
|
||||
SettingsAnchor("default-home") {
|
||||
if (s.homeScreenEnabled) ActionRow(stringResource(R.string.setup_default_home),
|
||||
s.defaultHomeLabel ?: stringResource(R.string.setup_choose_home), stringResource(R.string.setup_choose), a.onHomeApp)
|
||||
else SettingsRow(stringResource(R.string.setup_default_home), "Enable Home screen above to choose DroidDeck as the default Home app.") {}
|
||||
}
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.setup_linux_apps)) {
|
||||
ToggleRow(host, "store-enabled", stringResource(R.string.setup_store),
|
||||
if (s.storeEnabled) stringResource(R.string.setup_store_on) else stringResource(R.string.setup_store_off),
|
||||
s.storeEnabled, onChange = a.onStoreEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun DisplaySettings(s: FrontEndState, a: FrontEndActions, host: MenuHost) {
|
||||
SettingsGroup("Display and graphics") {
|
||||
SettingsAnchor("fg") { SettingsRow(stringResource(R.string.frame_gen_title), null) {
|
||||
Box {
|
||||
ValueChip(s.frameGenLabel, host.open == "fg") { host.open = if (host.open == "fg") null else "fg" }
|
||||
FrameGenMenu(s, a, host)
|
||||
}
|
||||
} }
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ControlsSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost) {
|
||||
val controller = s.controller
|
||||
if (controller != null && a.controller != null) SettingsAnchor("controller-actions") { SettingsGroup(stringResource(R.string.setup_controller)) {
|
||||
ControllerRows(host, s.oscMode, controller, a.controller)
|
||||
}
|
||||
} else Note(stringResource(R.string.setup_controller_unavailable))
|
||||
SettingsGroup(stringResource(R.string.setup_session)) {
|
||||
ChoiceRow(host, "back-actions", stringResource(R.string.mode_back), SessionPrefs.backActionsOrder(s.backActionsInverted),
|
||||
listOf(false to SessionPrefs.BACK_MENU_THEN_QAM, true to SessionPrefs.BACK_QAM_THEN_MENU),
|
||||
s.backActionsInverted, onPick = a.onBackActionsInverted)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun LibrarySettings(s: FrontEndState, a: FrontEndActions) {
|
||||
SettingsGroup("Library and files") {
|
||||
val roms = s.romsDir ?: stringResource(R.string.setup_tool_roms_hint)
|
||||
SettingsAnchor("files") { ActionRow(stringResource(R.string.setup_tool_files), null, "Open", a.onFiles) }
|
||||
SettingsAnchor("roms") { ActionRow(stringResource(R.string.setup_tool_roms), roms, "Open", a.onRoms) }
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun SessionSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost) {
|
||||
SettingsGroup(stringResource(R.string.setup_session)) {
|
||||
ToggleRow(host, "offline", stringResource(R.string.setup_offline),
|
||||
s.offlineAccount?.let { stringResource(R.string.setup_signed_in, it) } ?: stringResource(R.string.setup_sign_in_first),
|
||||
s.offline, enabled = s.offlineAccount != null, onChange = { a.onOffline() })
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun CompatibilitySettings(s: FrontEndState, a: FrontEndActions) {
|
||||
SettingsGroup("Compatibility tools") {
|
||||
SettingsAnchor("components") { ActionRow(stringResource(R.string.setup_card_components), stringResource(R.string.setup_card_components_hint), "Open") { a.onComponents(true) } }
|
||||
SettingsAnchor("protons") { ActionRow(stringResource(R.string.setup_tool_protons), stringResource(R.string.setup_tool_protons_hint), "Open", a.onProtons) }
|
||||
SettingsAnchor("performance") { ActionRow(stringResource(R.string.setup_tool_performance), null, "Open", a.onPerformance) }
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun SupportSettings(
|
||||
s: FrontEndState,
|
||||
a: FrontEndActions,
|
||||
onOpenDeveloperOptions: () -> Unit,
|
||||
onRequestWirelessAdb: (Boolean) -> Unit,
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val host = rememberMenuHost()
|
||||
val ctx = LocalContext.current
|
||||
var processLimitBusy by remember { mutableStateOf(false) }
|
||||
var processLimitMessage by remember { mutableStateOf<String?>(null) }
|
||||
val setProcessLimit: (Boolean) -> Unit = { enabled ->
|
||||
processLimitBusy = true
|
||||
processLimitMessage = null
|
||||
a.onSetPhantomProcessLimit(enabled) { error ->
|
||||
processLimitBusy = false
|
||||
if (error == null) {
|
||||
a.onRefreshPhantomStatus()
|
||||
} else {
|
||||
processLimitMessage = ctx.getString(R.string.setup_limit_adb_failed)
|
||||
onRequestWirelessAdb(enabled)
|
||||
}
|
||||
}
|
||||
}
|
||||
var showLimitDetails by rememberSaveable { mutableStateOf(false) }
|
||||
val limitBlocks = PhantomProcessLimit.blocksSteam(s.phantomProcessStatus)
|
||||
val gpu = remember { com.droiddeck.launcher.gpu.GpuInfo.detect() }
|
||||
val gpuOk = gpu.support == com.droiddeck.launcher.gpu.GpuInfo.Support.TESTED
|
||||
val gpuName = remember { DeviceSupport.gpuName() }
|
||||
val runtime = when {
|
||||
s.busy -> stringResource(R.string.common_working)
|
||||
s.removalPending -> stringResource(R.string.setup_retry_removal)
|
||||
@@ -153,237 +257,106 @@ internal fun SetupPanel(
|
||||
s.available != null && s.available != s.installed -> stringResource(R.string.common_update)
|
||||
else -> stringResource(R.string.setup_manage)
|
||||
}
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
// Tested hardware passes; an Adreno below it (a 610, say) warns rather than claiming support.
|
||||
val gpu = remember { com.droiddeck.launcher.gpu.GpuInfo.detect() }
|
||||
val gpuOk = gpu.support == com.droiddeck.launcher.gpu.GpuInfo.Support.TESTED
|
||||
val gpuName = remember { DeviceSupport.gpuName() }
|
||||
val limitBlocks = PhantomProcessLimit.blocksSteam(s.phantomProcessStatus)
|
||||
val signedIn = s.offlineAccount != null
|
||||
var showLimitDetails by rememberSaveable { mutableStateOf(false) }
|
||||
// Four tabs instead of one long scroll; LB and RB turn them from anywhere on the page. Build
|
||||
// and credits are on the Updates page.
|
||||
val tabs = listOf(stringResource(R.string.setup_tab_overview), stringResource(R.string.setup_tab_controller), stringResource(R.string.setup_tab_session), stringResource(R.string.setup_tab_launcher))
|
||||
var tab by rememberSaveable { mutableStateOf(0) }
|
||||
val tabFocus = remember { List(tabs.size) { FocusRequester() } }
|
||||
var tabTurned by remember { mutableStateOf(false) }
|
||||
val pick: (Int) -> Unit = { i -> tab = i; tabTurned = true }
|
||||
val inputModeManager = LocalInputModeManager.current
|
||||
// The control a controller was on went with the old tab: it lands on the new tab itself.
|
||||
LaunchedEffect(tab) {
|
||||
if (tabTurned && inputModeManager.inputMode == InputMode.Keyboard) {
|
||||
androidx.compose.runtime.withFrameNanos { }
|
||||
runCatching { tabFocus[tab].requestFocus() }
|
||||
val setProcessLimit: (Boolean) -> Unit = { enabled ->
|
||||
processLimitBusy = true
|
||||
processLimitMessage = null
|
||||
a.onSetPhantomProcessLimit(enabled) { error ->
|
||||
processLimitBusy = false
|
||||
if (error == null) a.onRefreshPhantomStatus()
|
||||
else {
|
||||
processLimitMessage = context.getString(R.string.setup_limit_adb_failed)
|
||||
onRequestWirelessAdb(enabled)
|
||||
}
|
||||
}
|
||||
}
|
||||
Rise(0, Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxSize().bumpers(
|
||||
onPrevious = { pick((tab + tabs.size - 1) % tabs.size) },
|
||||
onNext = { pick((tab + 1) % tabs.size) },
|
||||
),
|
||||
) {
|
||||
PageHeader(stringResource(R.string.setup_title)) {
|
||||
TabStrip(tabs, tab, pick, Modifier.weight(1f), tabFocus)
|
||||
}
|
||||
Column(modifier = Modifier.weight(1f).fillMaxWidth().verticalScroll(rememberScrollState()).padding(bottom = 24.dp)) {
|
||||
when (tab) {
|
||||
0 -> {
|
||||
SectionTitle(stringResource(R.string.setup_system_check), null)
|
||||
// What Steam needs, one row each: green when done, one button when not. The
|
||||
// process-limit controls only open under their row.
|
||||
Column(modifier = Modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14)) {
|
||||
CheckRow(
|
||||
if (gpuOk) CheckState.OK else CheckState.WARN,
|
||||
when (gpu.support) {
|
||||
com.droiddeck.launcher.gpu.GpuInfo.Support.TESTED -> stringResource(R.string.setup_gpu_supported)
|
||||
com.droiddeck.launcher.gpu.GpuInfo.Support.UNTESTED -> stringResource(R.string.setup_gpu_untested)
|
||||
else -> stringResource(R.string.setup_gpu_unsupported)
|
||||
},
|
||||
when (gpu.support) {
|
||||
com.droiddeck.launcher.gpu.GpuInfo.Support.TESTED -> stringResource(R.string.setup_gpu_detail, gpu.name, gpuName)
|
||||
com.droiddeck.launcher.gpu.GpuInfo.Support.UNTESTED -> stringResource(R.string.setup_gpu_untested_detail, gpu.name, gpu.supportText.replaceFirstChar { it.lowercase() })
|
||||
else -> stringResource(R.string.setup_gpu_unsupported_detail, gpuName)
|
||||
},
|
||||
)
|
||||
CheckRow(
|
||||
when { s.busy -> CheckState.BUSY; !s.ready -> CheckState.WARN; else -> CheckState.OK },
|
||||
stringResource(R.string.setup_runtime),
|
||||
when {
|
||||
s.busy -> null
|
||||
s.removalPending -> stringResource(R.string.runtime_removal_incomplete)
|
||||
!s.ready -> stringResource(R.string.setup_runtime_missing)
|
||||
s.available != null && s.available != s.installed -> stringResource(R.string.setup_runtime_update, s.installed ?: stringResource(R.string.setup_installed))
|
||||
else -> stringResource(R.string.setup_runtime_current, s.installed ?: stringResource(R.string.setup_installed))
|
||||
},
|
||||
divider = !s.busy,
|
||||
) { SecondaryButton(runtime, enabled = !s.busy && !s.runtimeActionsBlocked && !s.sessionRunning, compact = true, onClick = a.onRuntime) }
|
||||
if (s.busy) {
|
||||
Column(modifier = Modifier.fillMaxWidth().padding(start = 12.dp, end = 12.dp, bottom = 10.dp)) {
|
||||
Text(
|
||||
if (s.percent >= 0) stringResource(R.string.setup_runtime_progress, s.stage, s.percent) else s.stage,
|
||||
fontSize = 13.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(bottom = 5.dp),
|
||||
)
|
||||
if (s.percent >= 0) LinearProgressIndicator(progress = { s.percent / 100f }, modifier = Modifier.fillMaxWidth().height(4.dp))
|
||||
else LinearProgressIndicator(modifier = Modifier.fillMaxWidth().height(4.dp))
|
||||
}
|
||||
Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
|
||||
}
|
||||
CheckRow(
|
||||
if (limitBlocks) CheckState.WARN else CheckState.OK,
|
||||
stringResource(R.string.setup_limit),
|
||||
when (s.phantomProcessStatus) {
|
||||
PhantomProcessStatus.ENABLED -> stringResource(R.string.setup_limit_on)
|
||||
PhantomProcessStatus.UNSET -> stringResource(R.string.setup_limit_unset)
|
||||
PhantomProcessStatus.UNREADABLE -> stringResource(R.string.setup_limit_unknown)
|
||||
else -> PhantomProcessLimit.title(s.phantomProcessStatus)
|
||||
},
|
||||
) {
|
||||
if (limitBlocks) PrimaryButton(if (showLimitDetails) stringResource(R.string.common_hide) else stringResource(R.string.setup_fix_it), compact = true) { showLimitDetails = !showLimitDetails }
|
||||
else if (s.phantomProcessStatus != PhantomProcessStatus.NOT_APPLICABLE) {
|
||||
SecondaryButton(if (showLimitDetails) stringResource(R.string.common_hide) else stringResource(R.string.setup_details), compact = true) { showLimitDetails = !showLimitDetails }
|
||||
}
|
||||
}
|
||||
AnimatedVisibility(showLimitDetails, enter = expandVertically(Motion.sp(1f)) + fadeIn(Motion.sp(1f)), exit = shrinkVertically(Motion.sp(1f)) + fadeOut(Motion.sp(1f))) {
|
||||
// One sentence and at most three buttons. The computer route and its
|
||||
// raw command live on the full page Wireless debugging opens.
|
||||
Column(modifier = Modifier.fillMaxWidth().padding(start = 56.dp, end = 14.dp, top = 4.dp, bottom = 10.dp)) {
|
||||
Text(
|
||||
if (limitBlocks) PhantomProcessLimit.gateInstructions(s.phantomProcessStatus)
|
||||
else PhantomProcessLimit.instructions(s.phantomProcessStatus),
|
||||
fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp),
|
||||
)
|
||||
Actions {
|
||||
if (limitBlocks) {
|
||||
PrimaryButton(stringResource(R.string.setup_dev_options), compact = true, onClick = onOpenDeveloperOptions)
|
||||
SecondaryButton(stringResource(R.string.setup_use_wireless), compact = true, enabled = !processLimitBusy) { setProcessLimit(false) }
|
||||
SecondaryButton(stringResource(R.string.setup_check_again), compact = true, onClick = a.onRefreshPhantomStatus)
|
||||
} else if (s.phantomProcessStatus == PhantomProcessStatus.DISABLED) {
|
||||
SecondaryButton(stringResource(R.string.setup_limit_turn_on), compact = true, enabled = !processLimitBusy) { setProcessLimit(true) }
|
||||
}
|
||||
}
|
||||
if (processLimitBusy) LinearProgressIndicator(modifier = Modifier.fillMaxWidth().padding(vertical = 6.dp))
|
||||
processLimitMessage?.let { Text(it, fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp)) }
|
||||
}
|
||||
}
|
||||
CheckRow(
|
||||
if (signedIn) CheckState.OK else CheckState.WARN,
|
||||
stringResource(R.string.setup_account),
|
||||
s.offlineAccount?.let { if (s.offline) stringResource(R.string.setup_signed_in_offline, it) else stringResource(R.string.setup_signed_in, it) } ?: stringResource(R.string.setup_sign_in),
|
||||
divider = false,
|
||||
)
|
||||
}
|
||||
SectionTitle(stringResource(R.string.setup_tools), null)
|
||||
ToolGrid(s, a)
|
||||
}
|
||||
1 -> {
|
||||
val controller = s.controller
|
||||
if (controller != null && a.controller != null) SettingsGroup(stringResource(R.string.setup_controller)) {
|
||||
ControllerRows(host, s.oscMode, controller, a.controller)
|
||||
}
|
||||
if (s.controller == null || a.controller == null) Note(stringResource(R.string.setup_controller_unavailable))
|
||||
}
|
||||
2 -> {
|
||||
SettingsGroup(stringResource(R.string.setup_session)) {
|
||||
ChoiceRow(
|
||||
host, "back-actions", stringResource(R.string.mode_back), SessionPrefs.backActionsOrder(s.backActionsInverted),
|
||||
listOf(
|
||||
false to SessionPrefs.BACK_MENU_THEN_QAM,
|
||||
true to SessionPrefs.BACK_QAM_THEN_MENU,
|
||||
), s.backActionsInverted, onPick = a.onBackActionsInverted,
|
||||
)
|
||||
SettingsRow(stringResource(R.string.frame_gen_title), stringResource(R.string.frame_gen_hint)) {
|
||||
Box {
|
||||
ValueChip(s.frameGenLabel, host.open == "fg") { host.open = if (host.open == "fg") null else "fg" }
|
||||
FrameGenMenu(s, a, host)
|
||||
}
|
||||
}
|
||||
ToggleRow(host, "logs", stringResource(R.string.setup_logs), stringResource(R.string.setup_logs_hint), s.logsEnabled) { a.onLogs() }
|
||||
ActionRow(stringResource(R.string.setup_latest_logs), stringResource(R.string.drawer_logs_hint), stringResource(R.string.drawer_share_logs), a.onShareLogs)
|
||||
ActionRow(stringResource(R.string.setup_saved_logs), stringResource(R.string.setup_saved_logs_hint, com.droiddeck.launcher.session.SessionPaths.KEEP_SESSIONS), stringResource(R.string.setup_clear_logs), a.onClearLogs)
|
||||
ToggleRow(
|
||||
host, "offline", stringResource(R.string.setup_offline),
|
||||
s.offlineAccount?.let { stringResource(R.string.setup_signed_in, it) } ?: stringResource(R.string.setup_sign_in_first),
|
||||
s.offline, enabled = s.offlineAccount != null,
|
||||
) { a.onOffline() }
|
||||
}
|
||||
}
|
||||
3 -> {
|
||||
SettingsGroup(stringResource(R.string.setup_launcher)) {
|
||||
ChoiceRow(
|
||||
host, "app-scale", stringResource(R.string.setup_app_scale), stringResource(R.string.setup_app_scale_hint),
|
||||
com.droiddeck.launcher.core.AppUiPrefs.scales.map { percent ->
|
||||
percent to stringResource(
|
||||
if (percent == com.droiddeck.launcher.core.AppUiPrefs.DEFAULT_SCALE) R.string.setup_app_scale_default
|
||||
else R.string.ctrl_percent, percent,
|
||||
)
|
||||
}, s.appScale, onPick = a.onAppScale,
|
||||
)
|
||||
SettingsRow(stringResource(R.string.setup_theme), stringResource(R.string.setup_theme_hint)) {
|
||||
Box {
|
||||
ValueChip(Themes.byId(s.theme).label, host.open == "theme") { host.open = if (host.open == "theme") null else "theme" }
|
||||
AnchoredMenu(host.open == "theme", onDismiss = { if (host.open == "theme") host.open = null }, title = stringResource(R.string.setup_theme)) { firstItemFocus ->
|
||||
Themes.all.forEachIndexed { index, theme ->
|
||||
MenuItem(theme.label, checked = s.theme == theme.id, focusRequester = if (index == 0) firstItemFocus else null) {
|
||||
a.onTheme(theme.id)
|
||||
host.open = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ToggleRow(
|
||||
host, "home-screen", stringResource(R.string.setup_home),
|
||||
if (s.homeScreenEnabled) stringResource(R.string.setup_home_on) else stringResource(R.string.setup_home_off),
|
||||
s.homeScreenEnabled,
|
||||
) { a.onHomeScreen(it) }
|
||||
ToggleRow(
|
||||
host, "launcher-fullscreen", stringResource(R.string.setup_fullscreen),
|
||||
if (s.launcherFullscreen) stringResource(R.string.setup_fullscreen_on) else stringResource(R.string.setup_fullscreen_off),
|
||||
s.launcherFullscreen,
|
||||
) { a.onLauncherFullscreen(it) }
|
||||
ToggleRow(host, "launcher-animations", stringResource(R.string.setup_animations), null,
|
||||
s.animationsEnabled, onChange = a.onAnimationsEnabled)
|
||||
if (s.homeScreenEnabled) {
|
||||
ActionRow(stringResource(R.string.setup_default_home), s.defaultHomeLabel ?: stringResource(R.string.setup_choose_home), stringResource(R.string.setup_choose), a.onHomeApp)
|
||||
}
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.setup_linux_apps)) {
|
||||
ToggleRow(
|
||||
host, "store-enabled", stringResource(R.string.setup_store),
|
||||
if (s.storeEnabled) stringResource(R.string.setup_store_on)
|
||||
else stringResource(R.string.setup_store_off),
|
||||
s.storeEnabled,
|
||||
) { a.onStoreEnabled(it) }
|
||||
}
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.setup_system_check)) {
|
||||
Column(modifier = Modifier.fillMaxWidth().clip(Shape14).background(MaterialTheme.colorScheme.surface)
|
||||
.border(1.dp, LocalPalette.current.line, Shape14)) {
|
||||
CheckRow(
|
||||
if (gpuOk) CheckState.OK else CheckState.WARN,
|
||||
when (gpu.support) {
|
||||
com.droiddeck.launcher.gpu.GpuInfo.Support.TESTED -> stringResource(R.string.setup_gpu_supported)
|
||||
com.droiddeck.launcher.gpu.GpuInfo.Support.UNTESTED -> stringResource(R.string.setup_gpu_untested)
|
||||
else -> stringResource(R.string.setup_gpu_unsupported)
|
||||
},
|
||||
when (gpu.support) {
|
||||
com.droiddeck.launcher.gpu.GpuInfo.Support.TESTED -> stringResource(R.string.setup_gpu_detail, gpu.name, gpuName)
|
||||
com.droiddeck.launcher.gpu.GpuInfo.Support.UNTESTED -> stringResource(R.string.setup_gpu_untested_detail, gpu.name, gpu.supportText.replaceFirstChar { it.lowercase() })
|
||||
else -> stringResource(R.string.setup_gpu_unsupported_detail, gpuName)
|
||||
},
|
||||
)
|
||||
SettingsAnchor("runtime") { CheckRow(
|
||||
when { s.busy -> CheckState.BUSY; !s.ready -> CheckState.WARN; else -> CheckState.OK },
|
||||
stringResource(R.string.setup_runtime),
|
||||
when {
|
||||
s.busy -> null
|
||||
s.removalPending -> stringResource(R.string.runtime_removal_incomplete)
|
||||
!s.ready -> stringResource(R.string.setup_runtime_missing)
|
||||
s.available != null && s.available != s.installed -> stringResource(R.string.setup_runtime_update, s.installed ?: stringResource(R.string.setup_installed))
|
||||
else -> stringResource(R.string.setup_runtime_current, s.installed ?: stringResource(R.string.setup_installed))
|
||||
},
|
||||
divider = !s.busy,
|
||||
) { SecondaryButton(runtime, enabled = !s.busy && !s.runtimeActionsBlocked && !s.sessionRunning, compact = true, onClick = a.onRuntime) } }
|
||||
if (s.busy) {
|
||||
Column(modifier = Modifier.fillMaxWidth().padding(start = 12.dp, end = 12.dp, bottom = 10.dp)) {
|
||||
Text(if (s.percent >= 0) stringResource(R.string.setup_runtime_progress, s.stage, s.percent) else s.stage,
|
||||
fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(bottom = 5.dp))
|
||||
if (s.percent >= 0) LinearProgressIndicator(progress = { s.percent / 100f }, modifier = Modifier.fillMaxWidth().height(4.dp))
|
||||
else LinearProgressIndicator(modifier = Modifier.fillMaxWidth().height(4.dp))
|
||||
}
|
||||
}
|
||||
SettingsAnchor("phantom-process") { CheckRow(
|
||||
if (limitBlocks) CheckState.WARN else CheckState.OK,
|
||||
stringResource(R.string.setup_limit),
|
||||
when (s.phantomProcessStatus) {
|
||||
PhantomProcessStatus.ENABLED -> stringResource(R.string.setup_limit_on)
|
||||
PhantomProcessStatus.UNSET -> stringResource(R.string.setup_limit_unset)
|
||||
PhantomProcessStatus.UNREADABLE -> stringResource(R.string.setup_limit_unknown)
|
||||
else -> PhantomProcessLimit.title(s.phantomProcessStatus)
|
||||
},
|
||||
) {
|
||||
if (limitBlocks) PrimaryButton(if (showLimitDetails) stringResource(R.string.common_hide) else stringResource(R.string.setup_fix_it), compact = true) { showLimitDetails = !showLimitDetails }
|
||||
else if (s.phantomProcessStatus != PhantomProcessStatus.NOT_APPLICABLE) SecondaryButton(
|
||||
if (showLimitDetails) stringResource(R.string.common_hide) else stringResource(R.string.setup_details), compact = true,
|
||||
) { showLimitDetails = !showLimitDetails }
|
||||
} }
|
||||
AnimatedVisibility(showLimitDetails, enter = expandVertically(Motion.sp(1f)) + fadeIn(Motion.sp(1f)), exit = shrinkVertically(Motion.sp(1f)) + fadeOut(Motion.sp(1f))) {
|
||||
Column(modifier = Modifier.fillMaxWidth().padding(start = 56.dp, end = 14.dp, top = 4.dp, bottom = 10.dp)) {
|
||||
Text(if (limitBlocks) PhantomProcessLimit.gateInstructions(s.phantomProcessStatus) else PhantomProcessLimit.instructions(s.phantomProcessStatus),
|
||||
fontSize = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp))
|
||||
Actions {
|
||||
if (limitBlocks) {
|
||||
PrimaryButton(stringResource(R.string.setup_dev_options), compact = true, onClick = onOpenDeveloperOptions)
|
||||
SecondaryButton(stringResource(R.string.setup_use_wireless), compact = true, enabled = !processLimitBusy) { setProcessLimit(false) }
|
||||
SecondaryButton(stringResource(R.string.setup_check_again), compact = true, onClick = a.onRefreshPhantomStatus)
|
||||
} else if (s.phantomProcessStatus == PhantomProcessStatus.DISABLED) {
|
||||
SecondaryButton(stringResource(R.string.setup_limit_turn_on), compact = true, enabled = !processLimitBusy) { setProcessLimit(true) }
|
||||
}
|
||||
}
|
||||
if (processLimitBusy) LinearProgressIndicator(modifier = Modifier.fillMaxWidth().padding(vertical = 6.dp))
|
||||
processLimitMessage?.let { Text(it, fontSize = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp)) }
|
||||
}
|
||||
}
|
||||
CheckRow(
|
||||
if (s.offlineAccount != null) CheckState.OK else CheckState.WARN,
|
||||
stringResource(R.string.setup_account),
|
||||
s.offlineAccount?.let { if (s.offline) stringResource(R.string.setup_signed_in_offline, it) else stringResource(R.string.setup_signed_in, it) }
|
||||
?: stringResource(R.string.setup_sign_in),
|
||||
divider = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
SettingsAnchor("session-logs") { SettingsGroup(stringResource(R.string.setup_session)) {
|
||||
ToggleRow(host, "logs", stringResource(R.string.setup_logs), stringResource(R.string.setup_logs_hint), s.logsEnabled) { a.onLogs() }
|
||||
SettingsAnchor("latest-logs") { ActionRow(stringResource(R.string.setup_latest_logs), stringResource(R.string.drawer_logs_hint), stringResource(R.string.drawer_share_logs), a.onShareLogs) }
|
||||
SettingsAnchor("saved-logs") { ActionRow(stringResource(R.string.setup_saved_logs), stringResource(R.string.setup_saved_logs_hint, com.droiddeck.launcher.session.SessionPaths.KEEP_SESSIONS), stringResource(R.string.setup_clear_logs), a.onClearLogs) }
|
||||
} }
|
||||
SettingsGroup("More support") {
|
||||
SettingsAnchor("updates") { ActionRow("DroidDeck updates", "Build information and release channel", "Open", a.onOpenUpdates) }
|
||||
}
|
||||
}
|
||||
|
||||
/** The launcher's own tools as cards: four across, two by two on a narrow page. */
|
||||
@Composable
|
||||
private fun ToolGrid(s: FrontEndState, a: FrontEndActions) {
|
||||
val columns = if (LocalNarrowPane.current) 2 else 4
|
||||
val tools = listOf(
|
||||
ToolSpec(Icons.Outlined.Folder, stringResource(R.string.setup_tool_files), stringResource(R.string.setup_tool_files_hint), a.onFiles),
|
||||
ToolSpec(Icons.Outlined.Extension, stringResource(R.string.setup_tool_protons), stringResource(R.string.setup_tool_protons_hint), a.onProtons),
|
||||
ToolSpec(Icons.Outlined.Speed, stringResource(R.string.setup_tool_performance), stringResource(R.string.setup_tool_performance_hint), a.onPerformance),
|
||||
ToolSpec(Icons.Outlined.VideogameAsset, stringResource(R.string.setup_tool_roms), s.romsDir ?: stringResource(R.string.setup_tool_roms_hint), a.onRoms),
|
||||
)
|
||||
Column(verticalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.fillMaxWidth()) {
|
||||
for (row in tools.chunked(columns)) {
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.fillMaxWidth().height(IntrinsicSize.Min)) {
|
||||
for (t in row) ToolCard(t, Modifier.weight(1f).fillMaxHeight())
|
||||
repeat(columns - row.size) { Spacer(Modifier.weight(1f)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ToolSpec(val icon: ImageVector, val title: String, val detail: String, val onClick: () -> Unit)
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -217,7 +217,7 @@ internal fun SecondaryButton(text: String, enabled: Boolean = true, compact: Boo
|
||||
val fill by animateColorAsState(if (hot) pal.signal.copy(alpha = 0.14f) else Color.White.copy(alpha = 0.03f), Motion.tw(250), label = "secFill")
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = modifier.paneItem("btn:$text").downToFirstTile().heightIn(min = if (compact) 44.dp else 48.dp).graphicsLayer { scaleX = scale; scaleY = scale }.clip(Shape12).background(fill).glideBorder(hot, Shape12, pal.signal, pal.line2)
|
||||
modifier = modifier.paneItem(LocalSettingsAnchorId.current?.let { "setting:$it:$text" } ?: "btn:$text").downToFirstTile().heightIn(min = if (compact) 44.dp else 48.dp).graphicsLayer { scaleX = scale; scaleY = scale }.clip(Shape12).background(fill).glideBorder(hot, Shape12, pal.signal, pal.line2)
|
||||
.alpha(if (enabled) 1f else 0.5f)
|
||||
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, enabled = enabled, onClick = onClick)
|
||||
.controllerConfirm(enabled = enabled, onClick = onClick)
|
||||
|
||||
@@ -52,13 +52,13 @@ import kotlinx.coroutines.withContext
|
||||
// dialog, with each variable's actions in a menu off its value as everywhere else.
|
||||
|
||||
@Composable
|
||||
fun GameEnvironmentRow(modifier: Modifier = Modifier, showHint: Boolean = true) {
|
||||
fun GameEnvironmentRow(modifier: Modifier = Modifier) {
|
||||
var open by remember { mutableStateOf(false) }
|
||||
// Opened with a pad, the editor starts with focus in it; the dialog is a window of its own and
|
||||
// would otherwise give the pad nothing to move from.
|
||||
var byPad by remember { mutableStateOf(false) }
|
||||
val inputMode = LocalInputModeManager.current
|
||||
SettingsRow(stringResource(R.string.game_env_title), if (showHint) stringResource(R.string.game_env_hint) else null) {
|
||||
SettingsRow(stringResource(R.string.game_env_title), stringResource(R.string.game_env_hint)) {
|
||||
SecondaryButton(stringResource(R.string.game_env_edit), modifier = modifier) {
|
||||
byPad = inputMode.inputMode == InputMode.Keyboard
|
||||
open = true
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import com.droiddeck.launcher.R
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.foundation.focusable
|
||||
import androidx.compose.material.icons.outlined.ExpandLess
|
||||
import androidx.compose.material.icons.outlined.ExpandMore
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.ui.platform.LocalClipboardManager
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
import com.droiddeck.launcher.gpu.DeviceInfo
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
@@ -191,104 +180,29 @@ private fun DriverDropdown(rows: List<DriverRow>, selected: String, fallback: St
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This GPU and how far it is supported. A tap (or A) opens the card onto everything about the chip -
|
||||
* SoC, GPU, CPU, memory, system, the phone's own Vulkan driver, the drivers in use - gathered once,
|
||||
* off the main thread, with a button that copies it for a bug report.
|
||||
*/
|
||||
@Composable
|
||||
private fun DeviceCard(s: GpuDriversState) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val context = LocalContext.current
|
||||
val clipboard = LocalClipboardManager.current
|
||||
val tint = when {
|
||||
s.unsupported -> pal.error
|
||||
s.supported -> pal.good
|
||||
else -> AttentionAmber
|
||||
}
|
||||
var open by rememberSaveable { mutableStateOf(false) }
|
||||
var details by remember { mutableStateOf<List<DeviceInfo.Section>?>(null) }
|
||||
var copied by remember { mutableStateOf(false) }
|
||||
LaunchedEffect(open) {
|
||||
if (open && details == null) details = withContext(Dispatchers.IO) { DeviceInfo.collect(context) }
|
||||
}
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = rememberHot(src)
|
||||
val toggle = { open = !open; copied = false }
|
||||
Column(
|
||||
Modifier.fillMaxWidth().clip(Shape14).background(colors.surface)
|
||||
.background(if (hot) pal.signal.copy(alpha = 0.10f) else Color.Transparent)
|
||||
.glideBorder(hot, Shape14, pal.signal, pal.line),
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(14.dp),
|
||||
modifier = Modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14).padding(14.dp),
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(14.dp),
|
||||
modifier = Modifier.fillMaxWidth().paneItem("gpu-device")
|
||||
.hoverable(src).clickable(interactionSource = src, indication = null, role = Role.Button, onClick = toggle)
|
||||
.controllerConfirm(onClick = toggle)
|
||||
.padding(14.dp),
|
||||
) {
|
||||
Box(contentAlignment = Alignment.Center, modifier = Modifier.size(44.dp).clip(Shape12).background(tint.copy(alpha = 0.14f))) {
|
||||
Icon(Icons.Outlined.Memory, contentDescription = null, tint = tint, modifier = Modifier.size(24.dp))
|
||||
}
|
||||
Column(Modifier.weight(1f)) {
|
||||
Text(s.gpuName, fontSize = 18.sp, fontWeight = FontWeight.Bold, color = colors.onBackground)
|
||||
Text(listOf(s.soc, s.gpuFamily).filter { it.isNotEmpty() }.joinToString(" · "), fontSize = 13.sp, color = colors.onSurfaceVariant)
|
||||
}
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
Box(Modifier.size(7.dp).clip(CircleShape).background(tint))
|
||||
Text(s.supportText, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = tint, maxLines = 2)
|
||||
}
|
||||
Icon(
|
||||
if (open) Icons.Outlined.ExpandLess else Icons.Outlined.ExpandMore,
|
||||
contentDescription = stringResource(if (open) R.string.device_info_hide else R.string.device_info_show),
|
||||
tint = colors.onSurfaceVariant, modifier = Modifier.size(24.dp),
|
||||
)
|
||||
Box(contentAlignment = Alignment.Center, modifier = Modifier.size(44.dp).clip(Shape12).background(tint.copy(alpha = 0.14f))) {
|
||||
Icon(Icons.Outlined.Memory, contentDescription = null, tint = tint, modifier = Modifier.size(24.dp))
|
||||
}
|
||||
AnimatedVisibility(open) {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(12.dp), modifier = Modifier.fillMaxWidth().padding(start = 14.dp, end = 14.dp, bottom = 14.dp)) {
|
||||
HorizontalDivider(color = pal.line)
|
||||
val sections = details
|
||||
if (sections == null) {
|
||||
Text(stringResource(R.string.device_info_loading), fontSize = 13.sp, color = colors.onSurfaceVariant)
|
||||
LinearProgressIndicator(Modifier.fillMaxWidth())
|
||||
} else {
|
||||
for (section in sections) DeviceInfoSection(section)
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
stringResource(if (copied) R.string.device_info_copied else R.string.device_info_copy_hint),
|
||||
fontSize = 12.sp, color = colors.onSurfaceVariant, modifier = Modifier.weight(1f),
|
||||
)
|
||||
SecondaryButton(stringResource(R.string.device_info_copy), compact = true) {
|
||||
clipboard.setText(AnnotatedString(DeviceInfo.text(sections)))
|
||||
copied = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Column(Modifier.weight(1f)) {
|
||||
Text(s.gpuName, fontSize = 18.sp, fontWeight = FontWeight.Bold, color = colors.onBackground)
|
||||
Text(listOf(s.soc, s.gpuFamily).filter { it.isNotEmpty() }.joinToString(" · "), fontSize = 13.sp, color = colors.onSurfaceVariant)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** One part of the device details: its title, then label/value rows. Focusable, so the d-pad walks the list. */
|
||||
@Composable
|
||||
private fun DeviceInfoSection(section: DeviceInfo.Section) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = rememberHot(src)
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(3.dp),
|
||||
modifier = Modifier.fillMaxWidth().clip(Shape12)
|
||||
.glideBorder(hot, Shape12, pal.signal)
|
||||
.focusable(interactionSource = src).padding(horizontal = 8.dp, vertical = 6.dp),
|
||||
) {
|
||||
Text(section.title.uppercase(), fontSize = 11.5.sp, fontWeight = FontWeight.Bold, letterSpacing = 1.2.sp, color = colors.onSurfaceVariant)
|
||||
for ((label, value) in section.rows) {
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||
Text(label, fontSize = 13.sp, color = colors.onSurfaceVariant, modifier = Modifier.width(190.dp))
|
||||
Text(value, fontSize = 13.sp, fontWeight = FontWeight.Medium, color = colors.onBackground, modifier = Modifier.weight(1f))
|
||||
}
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
Box(Modifier.size(7.dp).clip(CircleShape).background(tint))
|
||||
Text(s.supportText, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = tint, maxLines = 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.gpu.ScreenEffectLooks
|
||||
import com.droiddeck.launcher.gpu.ScreenEffects
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import java.util.Locale
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/** Persistent graphics defaults shown in the launcher's settings page. */
|
||||
@Composable
|
||||
fun GraphicsSettingsContent(host: MenuHost, upscaler: Int, onUpscaler: (Int) -> Unit) {
|
||||
val context = LocalContext.current
|
||||
var effects by remember(context) { mutableStateOf(SessionPrefs.screenEffects(context)) }
|
||||
var anisotropy by remember(context) { mutableIntStateOf(SessionPrefs.textureAnisotropy(context)) }
|
||||
var lodBias by remember(context) { mutableStateOf(SessionPrefs.textureLodBias(context)) }
|
||||
|
||||
SettingsAdvanced("graphics-effects", stringResource(R.string.drawer_effects), targets = EFFECT_SETTING_IDS) {
|
||||
ScreenEffectsSettings(
|
||||
host = host,
|
||||
effects = effects,
|
||||
upscaler = upscaler,
|
||||
onEffects = { value -> SessionPrefs.setScreenEffects(context, value); effects = value },
|
||||
onUpscaler = onUpscaler,
|
||||
grouped = false,
|
||||
)
|
||||
}
|
||||
SettingsAdvanced("graphics-texture", stringResource(R.string.drawer_texture), targets = TEXTURE_SETTING_IDS) {
|
||||
TextureFilteringSettings(
|
||||
host = host,
|
||||
anisotropy = anisotropy,
|
||||
lodBias = lodBias,
|
||||
onAnisotropy = { value -> SessionPrefs.setTextureAnisotropy(context, value); anisotropy = value },
|
||||
onLodBias = { value -> SessionPrefs.setTextureLodBias(context, value); lodBias = value },
|
||||
grouped = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** Screen post-processing settings, shared by new sessions and applied live in the session drawer. */
|
||||
@Composable
|
||||
internal fun ScreenEffectsSettings(
|
||||
host: MenuHost,
|
||||
effects: ScreenEffects,
|
||||
upscaler: Int,
|
||||
onEffects: (ScreenEffects) -> Unit,
|
||||
onUpscaler: (Int) -> Unit,
|
||||
grouped: Boolean = true,
|
||||
track: (String) -> Modifier = { Modifier },
|
||||
) {
|
||||
val look = ScreenEffectLooks.match(effects, upscaler)
|
||||
val rows: @Composable androidx.compose.foundation.layout.ColumnScope.() -> Unit = {
|
||||
val looks = ScreenEffectLooks.LOOKS.map { it.name to it.name }
|
||||
ChoiceRow(host, "effects-look", stringResource(R.string.drawer_look),
|
||||
look?.desc ?: stringResource(R.string.drawer_effects_hint),
|
||||
if (look == null) listOf(LOOK_CUSTOM to stringResource(R.string.drawer_look_custom)) + looks else looks,
|
||||
look?.name ?: LOOK_CUSTOM, chipModifier = track("look"), hintLines = 2) { name ->
|
||||
ScreenEffectLooks.LOOKS.firstOrNull { it.name == name }?.let { picked ->
|
||||
picked.scalingMode?.let(onUpscaler)
|
||||
onEffects(picked.effects)
|
||||
}
|
||||
}
|
||||
ToggleRow(host, "effects-cas", stringResource(R.string.drawer_cas), null, effects.cas, chipModifier = track("cas")) { onEffects(effects.copy(cas = it)) }
|
||||
SettingsAnchor("effects-cas-level") {
|
||||
SliderRow(stringResource(R.string.drawer_cas_level), null, effects.casLevel, 0..100, step = 5, enabled = effects.cas,
|
||||
format = { "$it%" }, modifier = track("cas-level").settingsTarget("effects-cas-level")) { onEffects(effects.copy(casLevel = it)) }
|
||||
}
|
||||
ToggleRow(host, "effects-fake-hdr", stringResource(R.string.drawer_fake_hdr), null, effects.hdr, chipModifier = track("fake-hdr")) { onEffects(effects.copy(hdr = it)) }
|
||||
ToggleRow(host, "effects-deband", stringResource(R.string.drawer_deband), null, effects.deband, chipModifier = track("deband")) { onEffects(effects.copy(deband = it)) }
|
||||
SettingsAnchor("effects-deband-strength") {
|
||||
SliderRow(stringResource(R.string.drawer_deband_strength), null, effects.debandStrength, 0..200, step = 5, enabled = effects.deband,
|
||||
format = { "$it%" }, modifier = track("deband-strength").settingsTarget("effects-deband-strength")) { onEffects(effects.copy(debandStrength = it)) }
|
||||
}
|
||||
SettingsAnchor("effects-brightness") {
|
||||
SliderRow(stringResource(R.string.drawer_brightness), null, effects.brightness, -100..100, step = 2,
|
||||
format = ::signed, modifier = track("brightness").settingsTarget("effects-brightness")) { onEffects(effects.copy(brightness = it)) }
|
||||
}
|
||||
SettingsAnchor("effects-contrast") {
|
||||
SliderRow(stringResource(R.string.drawer_contrast), null, effects.contrast, -100..100, step = 2,
|
||||
format = ::signed, modifier = track("contrast").settingsTarget("effects-contrast")) { onEffects(effects.copy(contrast = it)) }
|
||||
}
|
||||
SettingsAnchor("effects-gamma") {
|
||||
SliderRow(stringResource(R.string.drawer_gamma), null, (effects.gamma * 100f).roundToInt(), 50..300, step = 5,
|
||||
format = { String.format(Locale.US, "%.2f", it / 100f) }, modifier = track("gamma").settingsTarget("effects-gamma")) { onEffects(effects.copy(gamma = it / 100f)) }
|
||||
}
|
||||
SettingsAnchor("effects-saturation") {
|
||||
SliderRow(stringResource(R.string.drawer_saturation), null, effects.saturation, 0..200, step = 5,
|
||||
format = { "$it%" }, modifier = track("saturation").settingsTarget("effects-saturation")) { onEffects(effects.copy(saturation = it)) }
|
||||
}
|
||||
ToggleRow(host, "effects-fxaa", stringResource(R.string.drawer_fxaa), null, effects.fxaa, chipModifier = track("fxaa")) { onEffects(effects.copy(fxaa = it)) }
|
||||
ToggleRow(host, "effects-toon", stringResource(R.string.drawer_toon), null, effects.toon, chipModifier = track("toon")) { onEffects(effects.copy(toon = it)) }
|
||||
ToggleRow(host, "effects-crt", stringResource(R.string.drawer_crt), null, effects.crt, chipModifier = track("crt")) { onEffects(effects.copy(crt = it)) }
|
||||
ToggleRow(host, "effects-ntsc", stringResource(R.string.drawer_ntsc), null, effects.ntsc, chipModifier = track("ntsc")) { onEffects(effects.copy(ntsc = it)) }
|
||||
}
|
||||
if (grouped) SettingsGroup(stringResource(R.string.drawer_effects), content = rows)
|
||||
else androidx.compose.foundation.layout.Column(Modifier.fillMaxWidth(), content = rows)
|
||||
}
|
||||
|
||||
/** DXVK filtering options saved as shared defaults and consumed by each game's next launch. */
|
||||
@Composable
|
||||
internal fun TextureFilteringSettings(
|
||||
host: MenuHost,
|
||||
anisotropy: Int,
|
||||
lodBias: String,
|
||||
onAnisotropy: (Int) -> Unit,
|
||||
onLodBias: (String) -> Unit,
|
||||
grouped: Boolean = true,
|
||||
track: (String) -> Modifier = { Modifier },
|
||||
) {
|
||||
val rows: @Composable androidx.compose.foundation.layout.ColumnScope.() -> Unit = {
|
||||
ChoiceRow(host, "textures-anisotropy", stringResource(R.string.drawer_anisotropy), stringResource(R.string.drawer_texture_hint),
|
||||
SessionPrefs.textureAnisotropyChoices, anisotropy, chipModifier = track("anisotropy"), onPick = onAnisotropy)
|
||||
ChoiceRow(host, "textures-sharpness", stringResource(R.string.drawer_texture_sharpness), stringResource(R.string.drawer_texture_hint),
|
||||
SessionPrefs.textureLodBiasChoices, lodBias, note = stringResource(R.string.drawer_texture_sharpness_note),
|
||||
chipModifier = track("texture-sharpness"), onPick = onLodBias)
|
||||
}
|
||||
if (grouped) SettingsGroup(stringResource(R.string.drawer_texture), content = rows)
|
||||
else androidx.compose.foundation.layout.Column(Modifier.fillMaxWidth(), content = rows)
|
||||
}
|
||||
|
||||
private const val LOOK_CUSTOM = "__custom__"
|
||||
|
||||
private val EFFECT_SETTING_IDS = setOf(
|
||||
"effects-look", "effects-cas", "effects-cas-level", "effects-fake-hdr", "effects-deband",
|
||||
"effects-deband-strength", "effects-brightness", "effects-contrast", "effects-gamma",
|
||||
"effects-saturation", "effects-fxaa", "effects-toon", "effects-crt", "effects-ntsc",
|
||||
)
|
||||
|
||||
private val TEXTURE_SETTING_IDS = setOf("textures-anisotropy", "textures-sharpness")
|
||||
|
||||
private fun signed(value: Int) = if (value > 0) "+$value" else value.toString()
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.ui.res.pluralStringResource
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.Row
|
||||
@@ -43,8 +42,10 @@ class DownloadRow(val key: String, val label: String, val detail: String, val pr
|
||||
|
||||
class ModeSettings(
|
||||
val mode: String,
|
||||
val resolution: String,
|
||||
val panelSize: Pair<Int, Int> = 1280 to 720,
|
||||
val resolutionCap: Int,
|
||||
/** A fixed session size, or null for the cap and shape. */
|
||||
val customResolution: Pair<Int, Int>? = null,
|
||||
val shapeMode: String,
|
||||
val hdr: Boolean,
|
||||
val hdrReason: String?,
|
||||
/** The GPU drivers in use, as the row that opens them on the Components page says it. */
|
||||
@@ -72,14 +73,13 @@ class ModeSettings(
|
||||
val fexPreset: String? = null,
|
||||
/** Steam only: SessionPrefs.SYNC_* chosen for Proton games; null outside Steam. */
|
||||
val syncBackend: String? = null,
|
||||
/** Steam only: forces game windows fullscreen (null = not a Steam page). */
|
||||
/** Steam only: games are stretched to fill the screen (null = not a Steam page). */
|
||||
val forceFullscreen: Boolean? = null,
|
||||
val stretch16x9: Boolean? = null,
|
||||
/** Steam only: the client branch forced on the command line. */
|
||||
val steamChannel: String? = null,
|
||||
/** Steam only: enable the SteamOS client interface and its performance controls. */
|
||||
val steamDeckMode: Boolean = false,
|
||||
val steamRepairQueued: Boolean = false,
|
||||
/** Steam, Deck mode: the QAM's performance overlay (mangoapp) is started. */
|
||||
val mangoapp: Boolean = true,
|
||||
/** Steam only: what the pad is to the client (SessionPrefs.CONTROLLER_*); null outside Steam. */
|
||||
@@ -111,7 +111,10 @@ class ModeSettings(
|
||||
class AddedGameRow(val folderPath: String, val folderName: String, val exePath: String, val exeName: String, val candidates: List<Pair<String, String>>)
|
||||
|
||||
class ModeSettingsActions(
|
||||
val onResolution: (String) -> Unit,
|
||||
val onResolution: (Int) -> Unit,
|
||||
/** Null clears it. */
|
||||
val onCustomResolution: (Pair<Int, Int>?) -> Unit = {},
|
||||
val onShape: (String) -> Unit,
|
||||
val onHdr: (Boolean) -> Unit,
|
||||
/** Opens the GPU drivers on the Components page: they are shared by every session. */
|
||||
val onGpuDrivers: () -> Unit = {},
|
||||
@@ -135,7 +138,6 @@ class ModeSettingsActions(
|
||||
val onForceFullscreen: (Boolean) -> Unit = {},
|
||||
val onStretch16x9: (Boolean) -> Unit = {},
|
||||
val onSteamChannel: (String) -> Unit = {},
|
||||
val onSteamRepair: () -> Unit = {},
|
||||
val onSteamDeckMode: (Boolean) -> Unit = {},
|
||||
val onMangoapp: (Boolean) -> Unit = {},
|
||||
val onSteamController: (String) -> Unit = {},
|
||||
@@ -155,158 +157,203 @@ class ModeSettingsActions(
|
||||
val onDismiss: () -> Unit,
|
||||
)
|
||||
|
||||
private enum class ModeSettingsTab(val label: Int) {
|
||||
DISPLAY(R.string.drawer_page_display),
|
||||
CONTROLS(R.string.drawer_page_controls),
|
||||
GAMES(R.string.game_settings_title),
|
||||
AUDIO(R.string.mode_audio),
|
||||
SESSION(R.string.mode_session),
|
||||
STEAM(R.string.mode_tab_steam),
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
|
||||
val steam = s.mode == SessionService.MODE_STEAM
|
||||
val host = rememberMenuHost()
|
||||
var confirmDeckyRemoval by remember { mutableStateOf(false) }
|
||||
var explainWifiDiscovery by remember { mutableStateOf(false) }
|
||||
var tabIndex by androidx.compose.runtime.saveable.rememberSaveable(s.mode) { mutableStateOf(0) }
|
||||
val tabs = if (steam) ModeSettingsTab.entries else listOf(
|
||||
ModeSettingsTab.DISPLAY, ModeSettingsTab.CONTROLS, ModeSettingsTab.SESSION,
|
||||
)
|
||||
val tab = tabs[tabIndex]
|
||||
val scrolls = tabs.map { androidx.compose.foundation.rememberScrollState() }
|
||||
val tabFocus = remember(s.mode) { tabs.map { androidx.compose.ui.focus.FocusRequester() } }
|
||||
val pageScroll = androidx.compose.foundation.rememberScrollState()
|
||||
val firstChip = remember { androidx.compose.ui.focus.FocusRequester() }
|
||||
fun selectTab(index: Int) { host.open = null; tabIndex = index }
|
||||
androidx.compose.runtime.LaunchedEffect(steam, tabIndex) {
|
||||
androidx.compose.runtime.LaunchedEffect(Unit) {
|
||||
// One frame first: the box has to be laid out before it can take focus. Opened from the
|
||||
// cog, focus starts on the first control (Resolution) so the d-pad works at once.
|
||||
androidx.compose.runtime.withFrameNanos { }
|
||||
runCatching {
|
||||
if (tab == ModeSettingsTab.DISPLAY) firstChip.requestFocus()
|
||||
else tabFocus[tabIndex].requestFocus()
|
||||
}
|
||||
runCatching { firstChip.requestFocus() }
|
||||
}
|
||||
SettingsPage(
|
||||
host,
|
||||
title = null,
|
||||
title = if (steam) stringResource(R.string.mode_steam_title) else stringResource(R.string.mode_desktop_title),
|
||||
onBack = a.onDismiss,
|
||||
scroll = scrolls[tabIndex],
|
||||
modifier = Modifier.bumpers(
|
||||
onPrevious = { selectTab((tabIndex + tabs.size - 1) % tabs.size) },
|
||||
onNext = { selectTab((tabIndex + 1) % tabs.size) },
|
||||
),
|
||||
header = {
|
||||
TabStrip(tabs.map { stringResource(it.label) }, tabIndex, ::selectTab,
|
||||
modifier = Modifier.fillMaxWidth(), focusRequesters = tabFocus)
|
||||
},
|
||||
scroll = pageScroll,
|
||||
) {
|
||||
if (tab == ModeSettingsTab.DISPLAY) {
|
||||
val displaySize = com.droiddeck.launcher.session.SessionDisplay.resolveChoice(s.panelSize, s.resolution)
|
||||
SettingsGroup(stringResource(R.string.display_session)) {
|
||||
ResolutionRow(host, s.resolution, s.panelSize, a.onResolution,
|
||||
chipModifier = Modifier.focusRequester(firstChip))
|
||||
if (s.stretch16x9 != null && (com.droiddeck.launcher.session.SessionDisplay.canStretch16x9(s.panelSize) ||
|
||||
com.droiddeck.launcher.session.SessionDisplay.canStretch16x9(displaySize))) {
|
||||
val canStretch = com.droiddeck.launcher.session.SessionDisplay.canStretch16x9(displaySize)
|
||||
ChoiceRow(host, "game-fit", stringResource(R.string.display_game_fit),
|
||||
stringResource(if (canStretch) R.string.display_game_fit_hint else R.string.display_game_fit_unavailable),
|
||||
listOf(false to stringResource(R.string.display_preserve), true to stringResource(R.string.display_stretch)),
|
||||
s.stretch16x9 && canStretch, enabled = canStretch, onPick = a.onStretch16x9)
|
||||
for (category in SettingsCategory.values()) {
|
||||
ModeSettingsContent(s, a, category, host, firstChip)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Renders only the mode-specific rows for one Settings hub category. */
|
||||
@Composable
|
||||
fun ModeSettingsContent(
|
||||
s: ModeSettings,
|
||||
a: ModeSettingsActions,
|
||||
category: SettingsCategory,
|
||||
host: MenuHost,
|
||||
firstChip: androidx.compose.ui.focus.FocusRequester? = null,
|
||||
) {
|
||||
val steam = s.mode == SessionService.MODE_STEAM
|
||||
var confirmDeckyRemoval by remember { mutableStateOf(false) }
|
||||
var explainWifiDiscovery by remember { mutableStateOf(false) }
|
||||
when (category) {
|
||||
SettingsCategory.DISPLAY -> {
|
||||
SettingsGroup(stringResource(R.string.mode_display)) {
|
||||
val default = SessionPrefs.defaultResolutionCap(s.mode)
|
||||
var editCustom by remember { mutableStateOf(false) }
|
||||
val custom = s.customResolution
|
||||
ChoiceRow(
|
||||
host, "res", stringResource(R.string.mode_resolution), stringResource(R.string.common_applies_next_session),
|
||||
listOf(720 to stringResource(R.string.mode_res_720), 900 to stringResource(R.string.mode_res_900), 1080 to stringResource(R.string.mode_res_1080), 0 to stringResource(R.string.mode_res_native))
|
||||
.map { (cap, label) -> cap to (if (cap == default) stringResource(R.string.mode_res_default, label) else label) } +
|
||||
(CUSTOM to (custom?.let { stringResource(R.string.mode_res_custom_value, it.first, it.second) } ?: stringResource(R.string.mode_res_custom))),
|
||||
if (custom != null) CUSTOM else s.resolutionCap, note = stringResource(R.string.mode_res_note),
|
||||
chipModifier = firstChip?.let { androidx.compose.ui.Modifier.focusRequester(it) } ?: androidx.compose.ui.Modifier,
|
||||
onPick = { v -> if (v == CUSTOM) editCustom = true else { a.onCustomResolution(null); a.onResolution(v) } },
|
||||
)
|
||||
ChoiceRow(
|
||||
host, "shape", stringResource(R.string.mode_ratio),
|
||||
"Shared · " + if (custom != null) stringResource(R.string.mode_ratio_custom) else stringResource(R.string.mode_ratio_auto),
|
||||
com.droiddeck.launcher.session.SessionPrefs.shapeChoices, s.shapeMode, enabled = custom == null, onPick = a.onShape,
|
||||
)
|
||||
ChoiceRow(
|
||||
host, "fps", stringResource(R.string.mode_fps), stringResource(R.string.common_applies_next_session),
|
||||
com.droiddeck.launcher.session.SessionPrefs.fpsLimitChoices, s.fpsLimit,
|
||||
note = stringResource(R.string.mode_fps_note),
|
||||
onPick = a.onFpsLimit,
|
||||
)
|
||||
ChoiceRow(
|
||||
host, "upscaler", stringResource(R.string.drawer_scaling), "Shared · Applies next session.",
|
||||
com.droiddeck.launcher.session.SessionPrefs.upscalerChoices, s.upscaler,
|
||||
note = "The sharpening modes work only when the session is smaller than the screen; Linear, Nearest and Sharpen only work at any size. Costs a little GPU time.",
|
||||
onPick = a.onUpscaler,
|
||||
)
|
||||
SettingsAnchor("upscale-sharpness") { SliderRow(
|
||||
stringResource(R.string.drawer_scaling_sharpness), "Shared · Applies next session.", s.upscaleSharpness, 0..100, step = 5,
|
||||
enabled = s.upscaler != 0, format = { "$it%" }, onChange = a.onUpscaleSharpness,
|
||||
) }
|
||||
if (editCustom) CustomResolutionDialog(
|
||||
initial = custom,
|
||||
onSave = { size -> editCustom = false; a.onCustomResolution(size) },
|
||||
onDismiss = { editCustom = false },
|
||||
)
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.mode_hdr)) {
|
||||
ToggleRow(
|
||||
host, "hdr", stringResource(R.string.mode_hdr10),
|
||||
s.hdrReason?.let { stringResource(R.string.mode_hdr_unavailable, it) }
|
||||
?: stringResource(R.string.mode_hdr_restart),
|
||||
checked = s.hdr && s.hdrReason == null, enabled = s.hdrReason == null, onChange = a.onHdr,
|
||||
)
|
||||
}
|
||||
if (s.forceFullscreen != null) SettingsGroup(stringResource(R.string.mode_display)) {
|
||||
ToggleRow(host, "fill", stringResource(R.string.mode_fill), stringResource(R.string.mode_fill_hint), s.forceFullscreen, onChange = a.onForceFullscreen)
|
||||
if (s.stretch16x9 != null) ToggleRow(host, "stretch169", stringResource(R.string.mode_stretch169), stringResource(R.string.mode_stretch169_hint), s.stretch16x9, onChange = a.onStretch16x9)
|
||||
}
|
||||
if (steam) SettingsGroup(stringResource(R.string.mode_client)) {
|
||||
ToggleRow(host, "mangoapp", stringResource(R.string.mode_mangoapp),
|
||||
if (s.steamDeckMode) stringResource(R.string.mode_mangoapp_hint) else "Enable Steam Deck mode in Sessions to use this overlay. Applies next session.",
|
||||
s.mangoapp, enabled = s.steamDeckMode, onChange = a.onMangoapp)
|
||||
}
|
||||
}
|
||||
SettingsCategory.CONTROLS -> {
|
||||
SettingsGroup(if (steam) stringResource(R.string.mode_touch_controls) else stringResource(R.string.mode_touch)) {
|
||||
ChoiceRow(
|
||||
host, "touch", stringResource(R.string.mode_touch), "Shared · Applies next session.",
|
||||
listOf(SessionPrefs.TOUCH_AUTO to stringResource(R.string.common_auto), SessionPrefs.TOUCH_PAD to stringResource(R.string.mode_touch_touchpad), SessionPrefs.TOUCH_DIRECT to stringResource(R.string.mode_touch_direct), SessionPrefs.TOUCH_OFF to stringResource(R.string.widgets_off)), s.touchMode,
|
||||
note = stringResource(R.string.mode_touch_note),
|
||||
onPick = a.onTouch,
|
||||
)
|
||||
if (steam && s.steamController != null) ChoiceRow(
|
||||
host, "controller", stringResource(R.string.mode_controller), stringResource(R.string.mode_controller_hint),
|
||||
listOf(
|
||||
SessionPrefs.CONTROLLER_DECK to stringResource(R.string.mode_controller_deck),
|
||||
SessionPrefs.CONTROLLER_XBOX360 to stringResource(R.string.mode_controller_x360),
|
||||
), s.steamController,
|
||||
note = stringResource(R.string.mode_controller_note),
|
||||
onPick = a.onSteamController,
|
||||
)
|
||||
}
|
||||
}
|
||||
SettingsCategory.AUDIO -> {
|
||||
if (steam && s.directAudio != null && s.mic != null) SettingsGroup(stringResource(R.string.mode_audio)) {
|
||||
ToggleRow(host, "da", stringResource(R.string.mode_directaudio), stringResource(R.string.mode_directaudio_hint), s.directAudio, onChange = a.onDirectAudio)
|
||||
ChoiceRow(
|
||||
host, "clientAudio", "Steam-menu audio", stringResource(R.string.mode_client_audio_hint),
|
||||
listOf("classic" to stringResource(R.string.mode_client_audio_classic), "directaudio" to stringResource(R.string.mode_client_audio_direct)), if (s.clientDirectAudio) "directaudio" else "classic",
|
||||
onPick = { id -> a.onClientDirectAudio(id == "directaudio") },
|
||||
)
|
||||
ToggleRow(host, "mic", stringResource(R.string.mode_mic), null, s.mic, onChange = a.onMic)
|
||||
}
|
||||
}
|
||||
SettingsCategory.LIBRARY -> {
|
||||
if (steam && s.addedGamesDirs != null) SettingsAnchor("added-games") { SettingsGroup(stringResource(R.string.mode_added_games)) {
|
||||
for (dir in s.addedGamesDirs) {
|
||||
val n = s.addedGames.count { it.folderPath.startsWith("$dir/") }
|
||||
SettingsAnchor("added-games:${dir}") { ActionRow(
|
||||
dir.substringAfterLast('/').ifEmpty { dir }, dir + " · " + (if (n == 0) stringResource(R.string.mode_added_none) else pluralStringResource(R.plurals.mode_added_count, n, n)) + ". " + stringResource(R.string.added_games_forget_hint),
|
||||
stringResource(R.string.common_forget), onClick = { a.onForgetAddedGamesDir(dir) },
|
||||
) }
|
||||
}
|
||||
SettingsAnchor("added-games-add") { ActionRow(
|
||||
if (s.addedGamesDirs.isEmpty()) stringResource(R.string.mode_games_folder) else stringResource(R.string.mode_games_folder_another),
|
||||
stringResource(R.string.added_games_import_hint), stringResource(R.string.common_add_ellipsis), onClick = a.onPickAddedGamesDir,
|
||||
) }
|
||||
ToggleRow(host, "addedArt", stringResource(R.string.mode_added_art), stringResource(R.string.mode_added_art_hint), s.addedGamesArt, onChange = a.onAddedGamesArt)
|
||||
for (g in s.addedGames) ChoiceRow(
|
||||
host, "added:" + g.folderPath, g.folderName, if (s.addedGamesDirs.size > 1) stringResource(R.string.mode_added_launches_in, g.exeName, g.folderPath.substringBeforeLast('/').substringAfterLast('/')) else stringResource(R.string.mode_added_launches, g.exeName),
|
||||
g.candidates + ("__pick__" to stringResource(R.string.mode_added_choose)), g.exePath,
|
||||
note = stringResource(R.string.mode_added_exe_note),
|
||||
onPick = { path -> if (path == "__pick__") a.onPickAddedGameExe(g.folderPath) else a.onAddedGameExe(g.folderPath, path) },
|
||||
)
|
||||
} }
|
||||
if (steam && s.gameStorage != null) SettingsAnchor("storage") { SettingsGroup(stringResource(R.string.mode_storage)) {
|
||||
val custom = s.gameStorage.isNotEmpty() && s.gameStorage != "off" && s.storageOptions.none { it.second == s.gameStorage }
|
||||
val options = buildList {
|
||||
add("" to (if (s.storageOptions.isEmpty()) stringResource(R.string.mode_storage_auto_none) else stringResource(R.string.mode_storage_auto)))
|
||||
add("off" to stringResource(R.string.mode_storage_internal))
|
||||
for ((label, path) in s.storageOptions) add(path to label)
|
||||
if (custom) add(s.gameStorage to stringResource(R.string.mode_storage_folder, s.gameStorage))
|
||||
}
|
||||
val open = host.open == "storage"
|
||||
SettingsAnchor("storage-location") { SettingsRow(stringResource(R.string.mode_second_library), stringResource(R.string.second_library_import_hint), highlighted = open) {
|
||||
androidx.compose.foundation.layout.Box {
|
||||
ValueChip(options.firstOrNull { it.first == s.gameStorage }?.second?.substringBefore(" -") ?: "-", open) { host.open = if (open) null else "storage" }
|
||||
AnchoredMenu(open, onDismiss = { if (host.open == "storage") host.open = null }, title = stringResource(R.string.mode_second_library), note = stringResource(R.string.mode_storage_note)) { firstItemFocus ->
|
||||
options.forEachIndexed { index, (path, label) -> MenuItem(label, checked = path == s.gameStorage, focusRequester = if (index == 0) firstItemFocus else null) {
|
||||
a.onGameStorage(path, if (path.isEmpty() || path == "off") "" else label.substringBefore(" ·")); host.open = null
|
||||
} }
|
||||
MenuItem(stringResource(R.string.mode_choose_folder), checked = false) { host.open = null; a.onPickGameStorageFolder() }
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.display_image_scaling)) {
|
||||
ChoiceRow(
|
||||
host, "upscaler", stringResource(R.string.display_filter), null,
|
||||
SessionPrefs.upscalerChoices, s.upscaler,
|
||||
note = stringResource(R.string.display_filter_note), onPick = a.onUpscaler,
|
||||
)
|
||||
if (SessionPrefs.upscalerHasSharpness(s.upscaler)) SliderRow(
|
||||
stringResource(R.string.display_sharpness), null, s.upscaleSharpness, 0..100, step = 5,
|
||||
format = { "$it%" }, onChange = a.onUpscaleSharpness,
|
||||
)
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.display_frame_rate)) {
|
||||
ChoiceRow(host, "fps", stringResource(R.string.mode_fps), stringResource(R.string.common_applies_next_session),
|
||||
SessionPrefs.fpsLimitChoices, s.fpsLimit, note = stringResource(R.string.mode_fps_note), onPick = a.onFpsLimit)
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.mode_hdr)) {
|
||||
ToggleRow(
|
||||
host, "hdr", stringResource(R.string.mode_hdr10),
|
||||
s.hdrReason?.let { stringResource(R.string.mode_hdr_unavailable, it) }
|
||||
?: stringResource(R.string.mode_hdr_restart),
|
||||
checked = s.hdr && s.hdrReason == null, enabled = s.hdrReason == null, onChange = a.onHdr,
|
||||
)
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.mode_drivers)) {
|
||||
SettingsRow(stringResource(R.string.mode_gpu_drivers), stringResource(R.string.mode_gpu_drivers_hint)) {
|
||||
ValueChip(s.gpuDrivers, open = false) { a.onGpuDrivers() }
|
||||
}
|
||||
}
|
||||
} }
|
||||
} }
|
||||
}
|
||||
SettingsCategory.SESSIONS -> {
|
||||
SettingsGroup(stringResource(R.string.mode_session)) {
|
||||
ChoiceRow(
|
||||
host, "suspend", stringResource(R.string.mode_suspend),
|
||||
stringResource(R.string.mode_suspend_hint),
|
||||
listOf(
|
||||
SessionPrefs.SUSPEND_AUTO to stringResource(R.string.common_auto),
|
||||
SessionPrefs.SUSPEND_MANUAL to stringResource(R.string.mode_suspend_manual),
|
||||
SessionPrefs.SUSPEND_NEVER to stringResource(R.string.common_never),
|
||||
),
|
||||
s.suspendPolicy,
|
||||
note = stringResource(R.string.mode_suspend_note),
|
||||
onPick = a.onSuspendPolicy,
|
||||
)
|
||||
}
|
||||
if (tab == ModeSettingsTab.CONTROLS) {
|
||||
SettingsGroup(if (steam) stringResource(R.string.mode_touch_controls) else stringResource(R.string.mode_touch)) {
|
||||
ChoiceRow(
|
||||
host, "touch", stringResource(R.string.mode_touch), null,
|
||||
listOf(SessionPrefs.TOUCH_AUTO to stringResource(R.string.common_auto), SessionPrefs.TOUCH_PAD to stringResource(R.string.mode_touch_touchpad), SessionPrefs.TOUCH_DIRECT to stringResource(R.string.mode_touch_direct), SessionPrefs.TOUCH_OFF to stringResource(R.string.widgets_off)), s.touchMode,
|
||||
note = stringResource(R.string.mode_touch_note),
|
||||
onPick = a.onTouch,
|
||||
)
|
||||
if (steam && s.oscMode != null) ChoiceRow(
|
||||
host, "osc", stringResource(R.string.mode_osc), null,
|
||||
listOf(
|
||||
SessionPrefs.OSC_AUTO to stringResource(R.string.common_auto),
|
||||
SessionPrefs.OSC_ALWAYS to stringResource(R.string.common_always),
|
||||
SessionPrefs.OSC_STEAM_QAM to stringResource(R.string.mode_osc_qam),
|
||||
SessionPrefs.OSC_NEVER to stringResource(R.string.common_never),
|
||||
), s.oscMode,
|
||||
note = stringResource(R.string.mode_osc_note), onPick = a.onOsc,
|
||||
)
|
||||
if (steam && s.steamController != null) ChoiceRow(
|
||||
host, "controller", stringResource(R.string.mode_controller), stringResource(R.string.mode_controller_hint),
|
||||
listOf(
|
||||
SessionPrefs.CONTROLLER_DECK to stringResource(R.string.mode_controller_deck),
|
||||
SessionPrefs.CONTROLLER_XBOX360 to stringResource(R.string.mode_controller_x360),
|
||||
), s.steamController,
|
||||
note = stringResource(R.string.mode_controller_note),
|
||||
onPick = a.onSteamController,
|
||||
)
|
||||
if (steam) ChoiceRow(
|
||||
host, "back-actions", stringResource(R.string.mode_back), SessionPrefs.backActionsOrder(s.backActionsInverted),
|
||||
listOf(
|
||||
false to SessionPrefs.BACK_MENU_THEN_QAM,
|
||||
true to SessionPrefs.BACK_QAM_THEN_MENU,
|
||||
), s.backActionsInverted, onPick = a.onBackActionsInverted,
|
||||
)
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.pip_title)) {
|
||||
ToggleRow(host, "pip-auto", stringResource(R.string.pip_auto),
|
||||
if (s.pipSupported) null else "Picture-in-picture is unavailable on this device.",
|
||||
s.pipAutoEnter, enabled = s.pipSupported, onChange = a.onPipAutoEnter)
|
||||
}
|
||||
if (tab == ModeSettingsTab.SESSION) {
|
||||
SettingsGroup(stringResource(R.string.mode_session)) {
|
||||
ChoiceRow(
|
||||
host, "suspend", stringResource(R.string.mode_suspend),
|
||||
stringResource(R.string.mode_suspend_hint),
|
||||
listOf(
|
||||
SessionPrefs.SUSPEND_AUTO to stringResource(R.string.common_auto),
|
||||
SessionPrefs.SUSPEND_MANUAL to stringResource(R.string.mode_suspend_manual),
|
||||
SessionPrefs.SUSPEND_NEVER to stringResource(R.string.common_never),
|
||||
),
|
||||
s.suspendPolicy,
|
||||
note = stringResource(R.string.mode_suspend_note),
|
||||
onPick = a.onSuspendPolicy,
|
||||
)
|
||||
}
|
||||
if (s.pipSupported) SettingsGroup(stringResource(R.string.pip_title)) {
|
||||
ToggleRow(host, "pip-auto", stringResource(R.string.pip_auto), null,
|
||||
s.pipAutoEnter, onChange = a.onPipAutoEnter)
|
||||
}
|
||||
if (steam) SettingsGroup(stringResource(R.string.mode_startup)) {
|
||||
ToggleRow(
|
||||
host, "steam-startup", stringResource(R.string.mode_steam_startup),
|
||||
stringResource(R.string.mode_steam_startup_hint),
|
||||
s.runSteamAtStartup, onChange = a.onRunSteamAtStartup,
|
||||
)
|
||||
}
|
||||
if (steam) SettingsGroup(stringResource(R.string.mode_startup)) {
|
||||
ToggleRow(
|
||||
host, "steam-startup", stringResource(R.string.mode_steam_startup),
|
||||
stringResource(R.string.mode_steam_startup_hint),
|
||||
s.runSteamAtStartup, onChange = a.onRunSteamAtStartup,
|
||||
)
|
||||
}
|
||||
if (steam && tab == ModeSettingsTab.STEAM) SettingsGroup(stringResource(R.string.mode_decky)) {
|
||||
if (steam) SettingsAnchor("decky") { SettingsGroup(stringResource(R.string.mode_decky)) {
|
||||
val updateAvailable = s.deckyInstalled != null && s.deckyLatestRelease != null &&
|
||||
s.deckyInstalled != s.deckyLatestRelease.tag
|
||||
val status = when {
|
||||
@@ -318,7 +365,7 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
|
||||
updateAvailable -> stringResource(R.string.mode_decky_update, s.deckyLatestRelease.tag)
|
||||
else -> stringResource(R.string.mode_decky_current, s.deckyInstalled)
|
||||
}
|
||||
SettingsRow(stringResource(R.string.mode_decky_loader), status) {
|
||||
SettingsAnchor("decky-loader") { SettingsRow(stringResource(R.string.mode_decky_loader), status) {
|
||||
val action = when {
|
||||
s.deckyStage != null -> stringResource(R.string.common_working)
|
||||
s.deckyChecking -> stringResource(R.string.common_checking)
|
||||
@@ -339,16 +386,17 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
|
||||
enabled = s.deckyStage == null && !s.deckySessionRunning,
|
||||
) { confirmDeckyRemoval = true }
|
||||
}
|
||||
}
|
||||
if (s.deckyInstalled != null) ToggleRow(
|
||||
} }
|
||||
ToggleRow(
|
||||
host, "decky-enabled", stringResource(R.string.mode_decky),
|
||||
if (s.deckyEnabled) stringResource(R.string.mode_decky_on)
|
||||
if (s.deckyInstalled == null) "Install Decky Loader above to enable it."
|
||||
else if (s.deckyEnabled) stringResource(R.string.mode_decky_on)
|
||||
else stringResource(R.string.mode_decky_off),
|
||||
s.deckyEnabled,
|
||||
enabled = !s.deckySessionRunning && s.deckyStage == null,
|
||||
enabled = s.deckyInstalled != null && !s.deckySessionRunning && s.deckyStage == null,
|
||||
onChange = a.onDeckyEnabled,
|
||||
)
|
||||
SettingsRow(
|
||||
SettingsAnchor("decky-plugins") { SettingsRow(
|
||||
"Plugins",
|
||||
"Install a plugin ZIP for the next Steam session.",
|
||||
) {
|
||||
@@ -357,47 +405,38 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
|
||||
enabled = s.deckyInstalled != null && s.deckyStage == null && !s.deckySessionRunning,
|
||||
onClick = a.onPickDeckyPluginZip,
|
||||
)
|
||||
}
|
||||
} }
|
||||
if (s.deckyStage != null && s.deckyPercent >= 0) {
|
||||
LinearProgressIndicator(
|
||||
progress = { s.deckyPercent / 100f },
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 14.dp, vertical = 8.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
if (steam && tab == ModeSettingsTab.STEAM && s.steamChannel != null) SettingsGroup(stringResource(R.string.mode_client)) {
|
||||
} }
|
||||
if (steam && s.steamChannel != null) SettingsGroup(stringResource(R.string.mode_client)) {
|
||||
ToggleRow(
|
||||
host, "steamdeck", stringResource(R.string.mode_deck_mode),
|
||||
stringResource(R.string.mode_deck_mode_hint),
|
||||
s.steamDeckMode, onChange = a.onSteamDeckMode,
|
||||
)
|
||||
if (s.steamDeckMode) ToggleRow(
|
||||
host, "mangoapp", stringResource(R.string.mode_mangoapp),
|
||||
stringResource(R.string.mode_mangoapp_hint),
|
||||
s.mangoapp, onChange = a.onMangoapp,
|
||||
)
|
||||
// Deck mode fixes the branch (SessionPrefs.steamChannel); the choice is for Deck mode off.
|
||||
if (s.steamDeckMode) SettingsRow(stringResource(R.string.mode_branch), stringResource(R.string.mode_branch_deck)) {}
|
||||
if (s.steamDeckMode) SettingsAnchor("channel") {
|
||||
SettingsRow(stringResource(R.string.mode_branch), stringResource(R.string.mode_branch_deck)) {}
|
||||
}
|
||||
else ChoiceRow(
|
||||
host, "channel", stringResource(R.string.mode_branch), stringResource(R.string.mode_branch_hint),
|
||||
listOf("publicbeta" to stringResource(R.string.mode_branch_public), "steamdeck_publicbeta" to stringResource(R.string.mode_branch_deck_beta)), s.steamChannel,
|
||||
note = stringResource(R.string.mode_branch_note),
|
||||
onPick = a.onSteamChannel,
|
||||
)
|
||||
SettingsRow(
|
||||
stringResource(R.string.mode_steam_repair),
|
||||
stringResource(if (s.steamRepairQueued) R.string.mode_steam_repair_queued else R.string.mode_steam_repair_hint),
|
||||
) {
|
||||
SecondaryButton(stringResource(R.string.mode_steam_repair_button), enabled = !s.steamRepairQueued, onClick = a.onSteamRepair)
|
||||
}
|
||||
}
|
||||
if (steam && tab == ModeSettingsTab.STEAM && s.wifiDiscovery != null) SettingsGroup(stringResource(R.string.mode_network)) {
|
||||
if (steam && s.wifiDiscovery != null) SettingsGroup(stringResource(R.string.mode_network)) {
|
||||
val hint = when {
|
||||
s.wifiDiscovery && !s.wifiDiscoveryLocation -> stringResource(R.string.mode_wifi_location_off)
|
||||
!s.wifiDiscoveryPermission && s.wifiDiscoveryAsked -> stringResource(R.string.mode_wifi_permission_denied)
|
||||
else -> stringResource(R.string.mode_wifi_discovery_hint)
|
||||
}
|
||||
SettingsRow(stringResource(R.string.mode_wifi_discovery), hint) {
|
||||
SettingsAnchor("wifi") { SettingsRow(stringResource(R.string.mode_wifi_discovery), hint) {
|
||||
Row(verticalAlignment = androidx.compose.ui.Alignment.CenterVertically,
|
||||
horizontalArrangement = androidx.compose.foundation.layout.Arrangement.spacedBy(8.dp)) {
|
||||
if (s.wifiDiscoveryBlocked || (s.wifiDiscovery && !s.wifiDiscoveryLocation)) {
|
||||
@@ -408,43 +447,25 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
|
||||
if (on) explainWifiDiscovery = true else a.onWifiDiscovery(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
} }
|
||||
}
|
||||
if ((tab == ModeSettingsTab.GAMES || (!steam && tab == ModeSettingsTab.DISPLAY)) && s.forceFullscreen != null) SettingsGroup(stringResource(R.string.display_window_compatibility)) {
|
||||
ToggleRow(host, "fill", stringResource(R.string.display_force_fullscreen),
|
||||
stringResource(R.string.display_force_fullscreen_hint), s.forceFullscreen, onChange = a.onForceFullscreen)
|
||||
if (!steam && 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 (steam && tab == ModeSettingsTab.GAMES && s.addedGamesDirs != null) SettingsGroup(stringResource(R.string.mode_added_games)) {
|
||||
for (dir in s.addedGamesDirs) {
|
||||
val n = s.addedGames.count { it.folderPath.startsWith("$dir/") }
|
||||
ActionRow(
|
||||
dir.substringAfterLast('/').ifEmpty { dir }, dir + " · " + (if (n == 0) stringResource(R.string.mode_added_none) else pluralStringResource(R.plurals.mode_added_count, n, n)) + ". " + stringResource(R.string.added_games_forget_hint),
|
||||
stringResource(R.string.common_forget), onClick = { a.onForgetAddedGamesDir(dir) },
|
||||
)
|
||||
}
|
||||
ActionRow(
|
||||
if (s.addedGamesDirs.isEmpty()) stringResource(R.string.mode_games_folder) else stringResource(R.string.mode_games_folder_another),
|
||||
stringResource(R.string.added_games_import_hint),
|
||||
stringResource(R.string.common_add_ellipsis), onClick = a.onPickAddedGamesDir,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "addedArt", stringResource(R.string.mode_added_art),
|
||||
stringResource(R.string.mode_added_art_hint),
|
||||
s.addedGamesArt, onChange = a.onAddedGamesArt,
|
||||
)
|
||||
for (g in s.addedGames) ChoiceRow(
|
||||
host, "added:" + g.folderPath, g.folderName, if (s.addedGamesDirs.size > 1) stringResource(R.string.mode_added_launches_in, g.exeName, g.folderPath.substringBeforeLast('/').substringAfterLast('/')) else stringResource(R.string.mode_added_launches, g.exeName),
|
||||
g.candidates + ("__pick__" to stringResource(R.string.mode_added_choose)), g.exePath,
|
||||
note = stringResource(R.string.mode_added_exe_note),
|
||||
onPick = { path -> if (path == "__pick__") a.onPickAddedGameExe(g.folderPath) else a.onAddedGameExe(g.folderPath, path) },
|
||||
)
|
||||
}
|
||||
SettingsCategory.COMPATIBILITY -> {
|
||||
SettingsGroup(stringResource(R.string.mode_drivers)) {
|
||||
SettingsAnchor("gpu-drivers") { SettingsRow(stringResource(R.string.mode_gpu_drivers), stringResource(R.string.mode_gpu_drivers_hint)) {
|
||||
ValueChip(s.gpuDrivers, open = false) { a.onGpuDrivers() }
|
||||
} }
|
||||
}
|
||||
if (steam && tab == ModeSettingsTab.GAMES && s.fexPreset != null) SettingsGroup(stringResource(R.string.game_settings_title)) {
|
||||
if (s.syncBackend != null) SettingsRow(
|
||||
stringResource(R.string.sync_backend_title),
|
||||
stringResource(R.string.sync_backend_hint),
|
||||
) {
|
||||
SegmentedTabs(
|
||||
if (steam && s.fexPreset != null) {
|
||||
SettingsAdvanced("game-settings", stringResource(R.string.game_settings_title), targets = setOf("fex", "syncBackend", "game-env")) {
|
||||
if (s.syncBackend != null) SettingsAnchor("syncBackend") { SettingsRow(
|
||||
stringResource(R.string.sync_backend_title), stringResource(R.string.sync_backend_hint),
|
||||
) { SegmentedTabs(
|
||||
listOf(
|
||||
SessionPrefs.SYNC_NTSYNC to stringResource(R.string.sync_backend_ntsync),
|
||||
SessionPrefs.SYNC_FSYNC to stringResource(R.string.sync_backend_fsync),
|
||||
@@ -452,69 +473,22 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
|
||||
SessionPrefs.SYNC_WINESERVER to stringResource(R.string.sync_backend_wineserver),
|
||||
),
|
||||
s.syncBackend,
|
||||
) { id -> host.open = null; a.onSyncBackend(id) }
|
||||
) { id -> host.open = null; a.onSyncBackend(id) } } }
|
||||
ChoiceRow(
|
||||
host, "fex", stringResource(R.string.fex_preset_title), stringResource(R.string.fex_next_launch),
|
||||
FexPreset.all.map { it.id to stringResource(it.label) }, s.fexPreset,
|
||||
note = stringResource(FexPreset.byId(s.fexPreset).detail), onPick = a.onFexPreset,
|
||||
)
|
||||
SettingsAnchor("game-env") { GameEnvironmentRow() }
|
||||
}
|
||||
ChoiceRow(
|
||||
host, "fex", stringResource(R.string.fex_preset_title), stringResource(R.string.fex_next_launch),
|
||||
FexPreset.all.map { it.id to stringResource(it.label) }, s.fexPreset,
|
||||
note = stringResource(FexPreset.byId(s.fexPreset).detail), onPick = a.onFexPreset,
|
||||
)
|
||||
GameEnvironmentRow()
|
||||
|
||||
}
|
||||
if (steam && tab == ModeSettingsTab.AUDIO && s.directAudio != null && s.mic != null) SettingsGroup(stringResource(R.string.mode_audio)) {
|
||||
ToggleRow(host, "da", stringResource(R.string.mode_directaudio), stringResource(R.string.mode_directaudio_hint), s.directAudio, onChange = a.onDirectAudio)
|
||||
ChoiceRow(
|
||||
host, "clientAudio", stringResource(R.string.mode_client_audio), stringResource(R.string.mode_client_audio_hint),
|
||||
listOf("classic" to stringResource(R.string.mode_client_audio_classic), "directaudio" to stringResource(R.string.mode_client_audio_direct)), if (s.clientDirectAudio) "directaudio" else "classic",
|
||||
onPick = { id -> a.onClientDirectAudio(id == "directaudio") },
|
||||
)
|
||||
ToggleRow(host, "mic", stringResource(R.string.mode_mic), stringResource(R.string.mode_mic_hint), s.mic, onChange = a.onMic)
|
||||
}
|
||||
if (steam && tab == ModeSettingsTab.GAMES && s.gameStorage != null) SettingsGroup(stringResource(R.string.mode_storage)) {
|
||||
val custom = s.gameStorage.isNotEmpty() && s.gameStorage != "off" && s.storageOptions.none { it.second == s.gameStorage }
|
||||
val options = buildList {
|
||||
add("" to (if (s.storageOptions.isEmpty()) stringResource(R.string.mode_storage_auto_none) else stringResource(R.string.mode_storage_auto)))
|
||||
add("off" to stringResource(R.string.mode_storage_internal))
|
||||
for ((label, path) in s.storageOptions) add(path to label)
|
||||
if (custom) add(s.gameStorage to stringResource(R.string.mode_storage_folder, s.gameStorage))
|
||||
}
|
||||
val open = host.open == "storage"
|
||||
SettingsRow(
|
||||
stringResource(R.string.mode_second_library),
|
||||
stringResource(R.string.second_library_import_hint),
|
||||
highlighted = open,
|
||||
) {
|
||||
androidx.compose.foundation.layout.Box {
|
||||
ValueChip(options.firstOrNull { it.first == s.gameStorage }?.second?.substringBefore(" -") ?: "-", open) { host.open = if (open) null else "storage" }
|
||||
AnchoredMenu(
|
||||
open, onDismiss = { if (host.open == "storage") host.open = null }, title = stringResource(R.string.mode_second_library),
|
||||
note = stringResource(R.string.mode_storage_note),
|
||||
) { firstItemFocus ->
|
||||
options.forEachIndexed { index, (path, label) ->
|
||||
MenuItem(label, checked = path == s.gameStorage, focusRequester = if (index == 0) firstItemFocus else null) {
|
||||
a.onGameStorage(path, if (path.isEmpty() || path == "off") "" else label.substringBefore(" ·"))
|
||||
host.open = null
|
||||
}
|
||||
}
|
||||
MenuItem(stringResource(R.string.mode_choose_folder), checked = false) { host.open = null; a.onPickGameStorageFolder() }
|
||||
}
|
||||
}
|
||||
}
|
||||
ToggleRow(
|
||||
host, "storageDiagnostics", stringResource(R.string.mode_storage_diagnostics),
|
||||
stringResource(R.string.mode_storage_diagnostics_hint), s.storageDiagnostics,
|
||||
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,
|
||||
)
|
||||
}
|
||||
SettingsCategory.SUPPORT -> {
|
||||
if (steam && s.gameStorage != null) SettingsAdvanced("storage-diagnostics", stringResource(R.string.mode_storage), targets = setOf("storageDiagnostics")) {
|
||||
ToggleRow(host, "storageDiagnostics", stringResource(R.string.mode_storage_diagnostics), stringResource(R.string.mode_storage_diagnostics_hint), s.storageDiagnostics, onChange = a.onStorageDiagnostics)
|
||||
}
|
||||
}
|
||||
SettingsCategory.GENERAL -> Unit
|
||||
}
|
||||
if (explainWifiDiscovery) AlertDialog(
|
||||
onDismissRequest = { explainWifiDiscovery = false },
|
||||
@@ -540,10 +514,13 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
|
||||
)
|
||||
}
|
||||
|
||||
/** The Resolution menu's "Custom…" entry. */
|
||||
private const val CUSTOM = -1
|
||||
|
||||
/** Width × height for the session, with the common handheld shapes one tap away. */
|
||||
@OptIn(androidx.compose.foundation.layout.ExperimentalLayoutApi::class)
|
||||
@Composable
|
||||
internal fun CustomResolutionDialog(initial: Pair<Int, Int>?, onSave: (Pair<Int, Int>) -> Unit, onDismiss: () -> Unit) {
|
||||
private fun CustomResolutionDialog(initial: Pair<Int, Int>?, onSave: (Pair<Int, Int>) -> Unit, onDismiss: () -> Unit) {
|
||||
var w by remember { mutableStateOf(initial?.first?.toString() ?: "") }
|
||||
var h by remember { mutableStateOf(initial?.second?.toString() ?: "") }
|
||||
val parsed = SessionPrefs.parseResolution("${w}x$h")
|
||||
|
||||
@@ -9,7 +9,7 @@ import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
@@ -71,7 +71,6 @@ fun PerformancePage(
|
||||
val coreItems = cores.map { it.core to it.label }
|
||||
SettingsPage(
|
||||
host, title = stringResource(R.string.perf_title),
|
||||
lede = stringResource(R.string.perf_lede),
|
||||
onBack = onDismiss,
|
||||
) {
|
||||
SettingsGroup(stringResource(R.string.perf_client_cores_group)) {
|
||||
@@ -80,17 +79,17 @@ fun PerformancePage(
|
||||
stringResource(R.string.perf_override_hint),
|
||||
clientOverride, onChange = onClientOverride,
|
||||
)
|
||||
MultiRow(
|
||||
SettingsAnchor("clientCores") { MultiRow(
|
||||
host, "clientCores", stringResource(R.string.perf_client_cores), if (clientOverride) stringResource(R.string.perf_client_cores_on) else stringResource(R.string.perf_client_cores_off),
|
||||
coreItems, clientCores, enabled = clientOverride, onToggle = onClientCore,
|
||||
)
|
||||
) }
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.perf_game_cores_group)) {
|
||||
MultiRow(
|
||||
SettingsAnchor("gameCores") { MultiRow(
|
||||
host, "gameCores", stringResource(R.string.perf_game_cores),
|
||||
stringResource(R.string.perf_game_cores_hint),
|
||||
coreItems, gameCores, onToggle = onGameCore,
|
||||
)
|
||||
) }
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.perf_client_ui)) {
|
||||
ToggleRow(
|
||||
@@ -162,7 +161,7 @@ fun PerformancePage(
|
||||
SettingsGroup(stringResource(R.string.perf_identity)) {
|
||||
var draft by remember(guestHostname) { mutableStateOf(guestHostname) }
|
||||
val valid = SessionPrefs.validGuestHostname(draft) != null
|
||||
SettingsRow(
|
||||
SettingsAnchor("hostname") { SettingsRow(
|
||||
stringResource(R.string.perf_hostname),
|
||||
if (valid || draft.isBlank()) stringResource(R.string.perf_hostname_hint, SessionPrefs.DEFAULT_GUEST_HOSTNAME)
|
||||
else stringResource(R.string.perf_hostname_invalid),
|
||||
@@ -174,9 +173,9 @@ fun PerformancePage(
|
||||
},
|
||||
singleLine = true, isError = !valid && draft.isNotBlank(),
|
||||
placeholder = { Text(SessionPrefs.DEFAULT_GUEST_HOSTNAME) },
|
||||
modifier = Modifier.width(220.dp),
|
||||
modifier = Modifier.widthIn(max = 220.dp),
|
||||
)
|
||||
}
|
||||
} }
|
||||
}
|
||||
if (phantomWarning != null) {
|
||||
Spacer(Modifier.height(16.dp))
|
||||
|
||||
@@ -36,8 +36,6 @@ fun ProtonPage(
|
||||
SettingsPage(
|
||||
host,
|
||||
title = stringResource(R.string.setup_tool_protons),
|
||||
eyebrow = stringResource(R.string.setup_title),
|
||||
lede = stringResource(R.string.proton_lede),
|
||||
onBack = onBack,
|
||||
) {
|
||||
if (!runtimeReady) Text(
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.session.SessionDisplay
|
||||
|
||||
/** Pre-session resolution choice, applied when the session starts. */
|
||||
@Composable
|
||||
fun ResolutionRow(
|
||||
host: MenuHost, choice: String, panel: Pair<Int, Int>, onPick: (String) -> Unit,
|
||||
chipModifier: Modifier = Modifier,
|
||||
) {
|
||||
val custom = "custom"
|
||||
val size = SessionDisplay.resolveChoice(panel, choice)
|
||||
val screen = SessionDisplay.screenSize(panel)
|
||||
val choices = SessionDisplay.resolutionOptions(panel)
|
||||
val selected = if (size == screen) SessionDisplay.MATCH_SCREEN else choice
|
||||
var editCustom by remember { mutableStateOf(false) }
|
||||
val options = choices.map { value ->
|
||||
val dimensions = SessionDisplay.resolveChoice(panel, value)
|
||||
value to if (value == SessionDisplay.MATCH_SCREEN) stringResource(R.string.display_match_screen, screen.first, screen.second)
|
||||
else if (value == SessionDisplay.DEFAULT_RESOLUTION) stringResource(R.string.mode_res_default, "${dimensions.first}×${dimensions.second}")
|
||||
else "${dimensions.first}×${dimensions.second}"
|
||||
} + (custom to if (selected in choices) stringResource(R.string.mode_res_custom)
|
||||
else stringResource(R.string.mode_res_custom_value, size.first, size.second))
|
||||
ChoiceRow(host, "resolution", stringResource(R.string.display_resolution),
|
||||
stringResource(R.string.common_applies_next_session),
|
||||
options, if (selected in choices) selected else custom, chipModifier = chipModifier,
|
||||
onPick = { value -> if (value == custom) editCustom = true else onPick(value) })
|
||||
if (editCustom) CustomResolutionDialog(size,
|
||||
onSave = { value -> editCustom = false; onPick("${value.first}x${value.second}") },
|
||||
onDismiss = { editCustom = false })
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
/** Stable page identities keep focus and scroll positions when a secondary display comes and goes. */
|
||||
internal enum class SessionDrawerPage(val firstControl: String) {
|
||||
CONTROLLER("touch"),
|
||||
SECOND_SCREEN("second-screen:none"),
|
||||
DISPLAY("hud"),
|
||||
EFFECTS("look"),
|
||||
GAMES("anisotropy"),
|
||||
SESSION("suspend"),
|
||||
}
|
||||
|
||||
internal fun sessionDrawerPages(hasSecondScreen: Boolean): List<SessionDrawerPage> =
|
||||
SessionDrawerPage.entries.filter { hasSecondScreen || it != SessionDrawerPage.SECOND_SCREEN }
|
||||
|
||||
internal fun List<SessionDrawerPage>.step(current: SessionDrawerPage, direction: Int): SessionDrawerPage {
|
||||
val index = indexOf(current).coerceAtLeast(0)
|
||||
return this[Math.floorMod(index + direction, size)]
|
||||
}
|
||||
@@ -70,9 +70,6 @@ import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.PlatformTextStyle
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.style.LineHeightStyle
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
|
||||
// The session's loading screen, its paused screen and the HUD text style.
|
||||
@@ -276,11 +273,7 @@ private fun CancelHint(onCancel: () -> Unit, modifier: Modifier = Modifier) {
|
||||
.padding(horizontal = 12.dp),
|
||||
) {
|
||||
Box(contentAlignment = Alignment.Center, modifier = Modifier.size(20.dp).clip(CircleShape).background(colors.onBackground)) {
|
||||
Text("B", color = colors.background, style = TextStyle(
|
||||
fontSize = 12.sp, lineHeight = 12.sp, fontWeight = FontWeight.Bold,
|
||||
platformStyle = PlatformTextStyle(includeFontPadding = false),
|
||||
lineHeightStyle = LineHeightStyle(LineHeightStyle.Alignment.Center, LineHeightStyle.Trim.Both),
|
||||
))
|
||||
Text("B", fontSize = 12.sp, fontWeight = FontWeight.Bold, color = colors.background)
|
||||
}
|
||||
Text(stringResource(R.string.common_cancel), fontSize = 13.sp, color = colors.onSurfaceVariant)
|
||||
}
|
||||
|
||||
@@ -28,24 +28,15 @@ import androidx.compose.foundation.layout.offset
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.material.icons.outlined.AutoFixHigh
|
||||
import androidx.compose.material.icons.outlined.ExpandMore
|
||||
import androidx.compose.material.icons.outlined.Home
|
||||
import androidx.compose.material.icons.outlined.MoreHoriz
|
||||
import androidx.compose.material.icons.outlined.PowerSettingsNew
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.material.icons.outlined.DesktopWindows
|
||||
import androidx.compose.material.icons.outlined.Layers
|
||||
import androidx.compose.material.icons.outlined.ScreenShare
|
||||
import androidx.compose.material.icons.outlined.PictureInPictureAlt
|
||||
import androidx.compose.material.icons.automirrored.outlined.ExitToApp
|
||||
import androidx.compose.material.icons.outlined.Settings
|
||||
import androidx.compose.material.icons.outlined.SportsEsports
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.RadioButton
|
||||
import androidx.compose.material3.RadioButtonDefaults
|
||||
import androidx.compose.foundation.selection.selectable
|
||||
import androidx.compose.foundation.selection.selectableGroup
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.draw.clipToBounds
|
||||
import android.view.Display
|
||||
import androidx.activity.compose.BackHandler
|
||||
@@ -88,8 +79,6 @@ import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.animateColorAsState
|
||||
import androidx.compose.animation.core.Spring
|
||||
import androidx.compose.animation.core.animateFloatAsState
|
||||
import androidx.compose.ui.draw.rotate
|
||||
import androidx.compose.ui.semantics.stateDescription
|
||||
import androidx.compose.animation.fadeIn
|
||||
import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.animation.slideInHorizontally
|
||||
@@ -104,6 +93,7 @@ import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
@@ -126,11 +116,10 @@ import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.core.FexPreset
|
||||
import com.droiddeck.launcher.core.TextureFiltering
|
||||
import com.droiddeck.launcher.core.FexPreset
|
||||
import com.droiddeck.launcher.gpu.FrameGen
|
||||
import com.droiddeck.launcher.gpu.Lossless
|
||||
import com.droiddeck.launcher.gpu.ScreenEffectLooks
|
||||
import com.droiddeck.launcher.gpu.ScreenEffects
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.session.ComponentsManager
|
||||
@@ -139,33 +128,22 @@ import com.droiddeck.launcher.input.SecondScreenMode
|
||||
import kotlinx.coroutines.flow.collect
|
||||
import java.util.Locale
|
||||
|
||||
private val SessionDrawerPage.title: Int get() = when (this) {
|
||||
SessionDrawerPage.CONTROLLER -> R.string.drawer_page_controller
|
||||
SessionDrawerPage.SECOND_SCREEN -> R.string.drawer_second_screen
|
||||
SessionDrawerPage.DISPLAY -> R.string.drawer_page_display
|
||||
SessionDrawerPage.EFFECTS -> R.string.drawer_page_effects
|
||||
SessionDrawerPage.GAMES -> R.string.game_settings_title
|
||||
SessionDrawerPage.SESSION -> R.string.mode_session
|
||||
}
|
||||
private val drawerPageTitles = listOf(R.string.drawer_page_display, R.string.drawer_page_effects, R.string.drawer_page_controls, R.string.drawer_page_components, R.string.drawer_page_settings)
|
||||
|
||||
private val SessionDrawerPage.icon get() = when (this) {
|
||||
SessionDrawerPage.CONTROLLER -> Icons.Outlined.SportsEsports
|
||||
SessionDrawerPage.SECOND_SCREEN -> Icons.Outlined.ScreenShare
|
||||
SessionDrawerPage.DISPLAY -> Icons.Outlined.DesktopWindows
|
||||
SessionDrawerPage.EFFECTS -> Icons.Outlined.AutoFixHigh
|
||||
SessionDrawerPage.GAMES -> Icons.Outlined.Layers
|
||||
SessionDrawerPage.SESSION -> Icons.Outlined.Settings
|
||||
}
|
||||
/** One icon per drawer page, in page order (QAM-style tabs). */
|
||||
private val drawerPageIcons = listOf(Icons.Outlined.DesktopWindows, Icons.Outlined.AutoFixHigh, Icons.Outlined.SportsEsports, Icons.Outlined.Layers, Icons.Outlined.Settings)
|
||||
|
||||
private val drawerPageEntries = listOf("hud", "look", "touch", "cmp-proton", "suspend")
|
||||
|
||||
private class DrawerFocus {
|
||||
private val requesters = HashMap<String, FocusRequester>()
|
||||
private val last = mutableMapOf<SessionDrawerPage, String>()
|
||||
private val last = arrayOfNulls<String>(DRAWER_PAGES)
|
||||
var focused by mutableStateOf<String?>(null)
|
||||
private set
|
||||
|
||||
private fun requester(key: String) = requesters.getOrPut(key) { FocusRequester() }
|
||||
|
||||
fun track(page: SessionDrawerPage, key: String): Modifier = Modifier.focusRequester(requester(key)).onFocusChanged {
|
||||
fun track(page: Int, key: String): Modifier = Modifier.focusRequester(requester(key)).onFocusChanged {
|
||||
if (it.isFocused) {
|
||||
last[page] = key
|
||||
focused = key
|
||||
@@ -173,9 +151,9 @@ private class DrawerFocus {
|
||||
}
|
||||
|
||||
/** Where focus was last on [page], if anywhere. */
|
||||
fun target(page: SessionDrawerPage) = last[page]
|
||||
fun target(page: Int) = last[page]
|
||||
fun request(key: String) = runCatching { requester(key).requestFocus() }
|
||||
fun forget(page: SessionDrawerPage) { last.remove(page) }
|
||||
fun forget(page: Int) { last[page] = null }
|
||||
}
|
||||
|
||||
/** Everything the drawer shows and does. */
|
||||
@@ -189,13 +167,13 @@ class DrawerActions(
|
||||
val frameGen: FrameGen.Mode,
|
||||
val lossless: Lossless.State,
|
||||
val oscMode: String,
|
||||
val onScreenButtonsVisible: Boolean,
|
||||
val suspendPolicy: String,
|
||||
val backActionsInverted: Boolean,
|
||||
val touchMode: String,
|
||||
val touchAuto: String,
|
||||
val shapeMode: String,
|
||||
val fexPreset: String,
|
||||
/** Steam only: forces game windows fullscreen, changed live (null = not Steam). */
|
||||
/** Steam only: games stretched to the screen's size, changed live (null = not Steam). */
|
||||
val fillScreen: Boolean? = null,
|
||||
val upscaler: Int = 0,
|
||||
val upscaleSharpness: Int = 75,
|
||||
@@ -225,6 +203,7 @@ class DrawerActions(
|
||||
val onSuspendPolicy: (String) -> Unit,
|
||||
val onBackActionsInverted: (Boolean) -> Unit,
|
||||
val onTouch: (String) -> Unit,
|
||||
val onShape: (String) -> Unit,
|
||||
val onFexPreset: (String) -> Unit,
|
||||
val onFillScreen: (Boolean) -> Unit = {},
|
||||
val onUpscaler: (Int) -> Unit = {},
|
||||
@@ -245,7 +224,7 @@ class DrawerActions(
|
||||
/** Stop with the dialog's button's bounds on screen, for the flood to grow out of; null falls back to [onStop]. */
|
||||
val onStopFrom: ((androidx.compose.ui.geometry.Rect?) -> Unit)? = null,
|
||||
val onClose: () -> Unit,
|
||||
/** Games tab: every Proton with what it uses; null until first read. */
|
||||
/** Components tab: every Proton with what it uses; null until first read. */
|
||||
val components: ComponentsManager.Snapshot? = null,
|
||||
/** Re-reads the Protons (and runs swaps that waited for a game to close). */
|
||||
val onComponentsRefresh: () -> Unit = {},
|
||||
@@ -255,20 +234,16 @@ class DrawerActions(
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, controllerActive: Boolean, onPageChange: (SessionDrawerPage) -> Unit, a: DrawerActions) {
|
||||
val pages = sessionDrawerPages(a.steam && a.secondScreenDisplays.isNotEmpty())
|
||||
val page = requestedPage.takeIf { it in pages } ?: SessionDrawerPage.CONTROLLER
|
||||
LaunchedEffect(requestedPage, pages) { if (page != requestedPage) onPageChange(page) }
|
||||
fun SessionDrawer(open: Boolean, page: Int, controllerActive: Boolean, onPageChange: (Int) -> Unit, a: DrawerActions) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val host = rememberMenuHost()
|
||||
var androidAppsExpanded by rememberSaveable { mutableStateOf(false) }
|
||||
var advancedEffectsExpanded by rememberSaveable { mutableStateOf(false) }
|
||||
var appToChooseDisplay by remember { mutableStateOf<HomeApp.LaunchableApp?>(null) }
|
||||
var confirmStop by remember { mutableStateOf(false) }
|
||||
var sheetCoords by remember { mutableStateOf<LayoutCoordinates?>(null) }
|
||||
var stopCoords by remember { mutableStateOf<LayoutCoordinates?>(null) }
|
||||
val pageScroll = remember { SessionDrawerPage.entries.associateWith { ScrollState(0) } }
|
||||
val pageScroll = remember { List(DRAWER_PAGES) { ScrollState(0) } }
|
||||
val veil by animateFloatAsState(if (open) 1f else 0f, Motion.tw(260), label = "veil")
|
||||
val focus = remember { DrawerFocus() }
|
||||
val inputModeManager = LocalInputModeManager.current
|
||||
@@ -278,13 +253,13 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
}
|
||||
BackHandler(enabled = open && confirmStop) { confirmStop = false }
|
||||
LaunchedEffect(page) { host.open = null; appToChooseDisplay = null }
|
||||
LaunchedEffect(open, page) { if (open && page == SessionDrawerPage.GAMES) a.onComponentsRefresh() }
|
||||
LaunchedEffect(open, page) { if (open && page == DRAWER_PAGE_COMPONENTS) a.onComponentsRefresh() }
|
||||
LaunchedEffect(open, controllerActive) {
|
||||
if (open && !controllerActive) focusManager.clearFocus(force = true)
|
||||
}
|
||||
// The page focus was last put on: turning to another (LB, RB, a tab) starts it at its first
|
||||
// option; anything else (a menu closing, the drawer opening again) goes back where it was.
|
||||
var focusedPage by remember { mutableStateOf(page) }
|
||||
var focusedPage by remember { mutableIntStateOf(page) }
|
||||
LaunchedEffect(open, page, controllerActive, host.open, appToChooseDisplay, confirmStop) {
|
||||
if (!open) {
|
||||
host.open = null
|
||||
@@ -294,8 +269,8 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
if (host.open != null || appToChooseDisplay != null || confirmStop) return@LaunchedEffect
|
||||
val turned = page != focusedPage
|
||||
focusedPage = page
|
||||
// The page's top control: on Session that is Android apps, when it is shown.
|
||||
val first = if (page == SessionDrawerPage.SESSION && a.isHomeApp) "apps" else page.firstControl
|
||||
// The page's top control: on Settings that is Android apps, when it is shown.
|
||||
val first = if (page == drawerPageEntries.lastIndex && a.isHomeApp) "apps" else drawerPageEntries[page]
|
||||
if (turned) focus.forget(page)
|
||||
val target = focus.target(page) ?: first
|
||||
repeat(24) {
|
||||
@@ -308,7 +283,7 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
}
|
||||
}
|
||||
if (open || veil > 0.01f) Box(
|
||||
modifier = Modifier.fillMaxSize()
|
||||
modifier = Modifier.fillMaxSize().graphicsLayer { alpha = veil }.background(Color(0x8A000000))
|
||||
.clickable(interactionSource = remember { MutableInteractionSource() }, indication = null) { host.open = null; a.onClose() },
|
||||
)
|
||||
androidx.compose.foundation.layout.BoxWithConstraints(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.CenterEnd) {
|
||||
@@ -374,21 +349,31 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
modifier = Modifier.fillMaxWidth().padding(top = if (short) 6.dp else 12.dp),
|
||||
) {
|
||||
DrawerBumper("LB", stringResource(R.string.drawer_prev_page), modifier = focus.track(page, "prev")) {
|
||||
host.open = null; onPageChange(pages.step(page, -1))
|
||||
host.open = null; onPageChange((page + DRAWER_PAGES - 1) % DRAWER_PAGES)
|
||||
}
|
||||
DrawerPageTabs(page = page, pages = pages, compact = short, modifier = Modifier.weight(1f)) { index -> host.open = null; onPageChange(index) }
|
||||
DrawerPageTabs(page = page, compact = short, modifier = Modifier.weight(1f)) { index -> host.open = null; onPageChange(index) }
|
||||
DrawerBumper("RB", stringResource(R.string.drawer_next_page), modifier = focus.track(page, "next")) {
|
||||
host.open = null; onPageChange(pages.step(page, 1))
|
||||
host.open = null; onPageChange((page + 1) % DRAWER_PAGES)
|
||||
}
|
||||
}
|
||||
Column(
|
||||
modifier = Modifier.weight(1f).fillMaxWidth().verticalScroll(pageScroll.getValue(page)),
|
||||
modifier = Modifier.weight(1f).fillMaxWidth().verticalScroll(pageScroll[page]),
|
||||
) { CompositionLocalProvider(LocalChipMinWidth provides 120.dp) {
|
||||
when (page) {
|
||||
SessionDrawerPage.DISPLAY -> {
|
||||
0 -> {
|
||||
SettingsGroup(stringResource(R.string.drawer_page_display)) {
|
||||
ToggleRow(host, "hud", stringResource(R.string.drawer_hud), null, a.hudOn,
|
||||
chipModifier = focus.track(page, "hud"), onChange = a.onHud)
|
||||
if (a.fillScreen != null) ToggleRow(
|
||||
host, "fill", stringResource(R.string.drawer_fill), null, a.fillScreen,
|
||||
chipModifier = focus.track(page, "fill"), onChange = a.onFillScreen,
|
||||
)
|
||||
ChoiceRow(host, "upscaler", stringResource(R.string.drawer_scaling), null,
|
||||
SessionPrefs.upscalerChoices, a.upscaler,
|
||||
chipModifier = focus.track(page, "upscaler"), onPick = a.onUpscaler)
|
||||
SliderRow(stringResource(R.string.drawer_scaling_sharpness), null, a.upscaleSharpness, 0..100, step = 5,
|
||||
enabled = a.upscaler != 0, format = { "$it%" }, modifier = focus.track(page, "upscale-sharpness"),
|
||||
onChange = a.onUpscaleSharpness)
|
||||
val fgOpen = host.open == "fg"
|
||||
val fgLabel = FrameGen.label(LocalContext.current, a.frameGen)
|
||||
SettingsRow(stringResource(R.string.frame_gen_title), null, highlighted = fgOpen) {
|
||||
@@ -398,27 +383,15 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.display_image_scaling)) {
|
||||
ChoiceRow(host, "upscaler", stringResource(R.string.display_filter), null,
|
||||
SessionPrefs.upscalerChoices, a.upscaler,
|
||||
note = stringResource(R.string.display_filter_note),
|
||||
chipModifier = focus.track(page, "upscaler"), onPick = a.onUpscaler)
|
||||
if (SessionPrefs.upscalerHasSharpness(a.upscaler)) SliderRow(
|
||||
stringResource(R.string.display_sharpness), null, a.upscaleSharpness, 0..100, step = 5,
|
||||
format = { "$it%" }, modifier = focus.track(page, "upscale-sharpness"), onChange = a.onUpscaleSharpness)
|
||||
}
|
||||
if (a.fillScreen != null) SettingsGroup(stringResource(R.string.display_window_compatibility)) {
|
||||
ToggleRow(host, "fill", stringResource(R.string.display_force_fullscreen),
|
||||
stringResource(R.string.display_force_fullscreen_live), a.fillScreen,
|
||||
chipModifier = focus.track(page, "fill"), onChange = a.onFillScreen)
|
||||
}
|
||||
}
|
||||
SessionDrawerPage.EFFECTS -> {
|
||||
ScreenEffectsGroup(host, a, advancedEffectsExpanded,
|
||||
onAdvancedToggle = { advancedEffectsExpanded = !advancedEffectsExpanded }) { key -> focus.track(page, key) }
|
||||
DRAWER_PAGE_EFFECTS -> {
|
||||
ScreenEffectsSettings(host, a.effects, a.upscaler, a.onEffects, a.onUpscaler) { key -> focus.track(page, key) }
|
||||
TextureFilteringSettings(host, a.textureAnisotropy, a.textureLodBias,
|
||||
a.onTextureAnisotropy, a.onTextureLodBias) { key -> focus.track(page, key) }
|
||||
}
|
||||
SessionDrawerPage.CONTROLLER -> {
|
||||
SettingsGroup(stringResource(R.string.drawer_page_controller)) {
|
||||
DRAWER_PAGE_COMPONENTS -> ComponentsDrawerPage(host, a) { key -> focus.track(page, key) }
|
||||
DRAWER_PAGE_CONTROLS -> {
|
||||
SettingsGroup(stringResource(R.string.drawer_page_controls)) {
|
||||
ChoiceRow(host, "touch", stringResource(R.string.mode_touch), null,
|
||||
listOf(SessionPrefs.TOUCH_AUTO to stringResource(R.string.drawer_touch_auto, a.touchAuto), SessionPrefs.TOUCH_PAD to stringResource(R.string.mode_touch_touchpad), SessionPrefs.TOUCH_DIRECT to stringResource(R.string.mode_touch_direct), SessionPrefs.TOUCH_OFF to stringResource(R.string.widgets_off)),
|
||||
a.touchMode, chipModifier = focus.track(page, "touch"), onPick = a.onTouch)
|
||||
@@ -429,16 +402,12 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
a.controller?.let { c ->
|
||||
ToggleRow(host, "rumble", stringResource(R.string.ctrl_rumble), null, c.rumble,
|
||||
chipModifier = focus.track(page, "rumble"), onChange = a.onRumble)
|
||||
if (a.onScreenButtonsVisible) {
|
||||
if (a.steam) {
|
||||
ToggleRow(host, "steam-button", stringResource(R.string.ctrl_steam_button), null, c.steamButton,
|
||||
chipModifier = focus.track(page, "steam-button"), onChange = a.onSteamButton)
|
||||
ToggleRow(host, "qam-button", stringResource(R.string.ctrl_qam_button), null, c.qamButton,
|
||||
chipModifier = focus.track(page, "qam-button"), onChange = a.onQamButton)
|
||||
}
|
||||
ToggleRow(host, "keyboard-button", stringResource(R.string.ctrl_keyboard_button), null, c.keyboardButton,
|
||||
chipModifier = focus.track(page, "keyboard-button"), onChange = a.onKeyboardButton)
|
||||
}
|
||||
ToggleRow(host, "steam-button", stringResource(R.string.ctrl_steam_button), null, c.steamButton,
|
||||
chipModifier = focus.track(page, "steam-button"), onChange = a.onSteamButton)
|
||||
ToggleRow(host, "qam-button", stringResource(R.string.ctrl_qam_button), null, c.qamButton,
|
||||
chipModifier = focus.track(page, "qam-button"), onChange = a.onQamButton)
|
||||
ToggleRow(host, "keyboard-button", stringResource(R.string.ctrl_keyboard_button), null, c.keyboardButton,
|
||||
chipModifier = focus.track(page, "keyboard-button"), onChange = a.onKeyboardButton)
|
||||
}
|
||||
if (a.steam) ChoiceRow(host, "back-actions", stringResource(R.string.mode_back), null,
|
||||
listOf(false to SessionPrefs.BACK_MENU_THEN_QAM, true to SessionPrefs.BACK_QAM_THEN_MENU),
|
||||
@@ -454,23 +423,18 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SessionDrawerPage.SECOND_SCREEN -> {
|
||||
SecondScreenGroup(host, a) { key -> focus.track(page, key) }
|
||||
}
|
||||
SessionDrawerPage.GAMES -> {
|
||||
Text(stringResource(R.string.fex_next_launch), fontSize = 12.sp,
|
||||
color = colors.onSurfaceVariant, modifier = Modifier.padding(horizontal = 14.dp, vertical = 8.dp))
|
||||
TextureFilteringGroup(host, a) { key -> focus.track(page, key) }
|
||||
if (a.steam) SettingsGroup(stringResource(R.string.game_settings_title)) {
|
||||
ChoiceRow(host, "fex", stringResource(R.string.fex_preset_title), null,
|
||||
FexPreset.all.map { it.id to stringResource(it.label) }, a.fexPreset,
|
||||
chipModifier = focus.track(page, "fex"), onPick = a.onFexPreset)
|
||||
GameEnvironmentRow(modifier = focus.track(page, "game-env"), showHint = false)
|
||||
if (a.steam && a.secondScreenDisplays.isNotEmpty()) SettingsGroup(stringResource(R.string.drawer_second_screen)) {
|
||||
ChoiceRow(host, "second-screen-mode", stringResource(R.string.drawer_second_screen_shows), null,
|
||||
(listOf(SecondScreenMode.NONE, SecondScreenMode.KEYBOARD_TRACKPAD, SecondScreenMode.TERMINAL) +
|
||||
(if (com.droiddeck.launcher.session.SessionState.deckPad) listOf(SecondScreenMode.DECK_CONTROLS) else emptyList()))
|
||||
.map { it to it.label },
|
||||
a.secondScreenMode, chipModifier = focus.track(page, "second-screen-mode"), onPick = a.onSecondScreenMode)
|
||||
if (a.secondScreenDisplays.size > 1) ChoiceRow(host, "second-screen-display", stringResource(R.string.drawer_page_display), null,
|
||||
a.secondScreenDisplays.map { it.id to it.label }, a.selectedSecondScreenDisplay,
|
||||
chipModifier = focus.track(page, "second-screen-display"), onPick = a.onSecondScreenDisplay)
|
||||
}
|
||||
ComponentsDrawerPage(host, a) { key -> focus.track(page, key) }
|
||||
}
|
||||
SessionDrawerPage.SESSION -> {
|
||||
else -> {
|
||||
if (a.isHomeApp) SettingsGroup(stringResource(R.string.drawer_android_apps)) {
|
||||
SettingsRow(stringResource(R.string.drawer_launch_app), null) {
|
||||
DrawerOutlineButton(if (androidAppsExpanded) stringResource(R.string.common_hide) else stringResource(R.string.common_show), modifier = focus.track(page, "apps")) {
|
||||
@@ -502,7 +466,7 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
SettingsGroup(stringResource(R.string.drawer_session_behavior)) {
|
||||
ChoiceRow(
|
||||
host, "suspend", stringResource(R.string.mode_suspend),
|
||||
null,
|
||||
stringResource(R.string.drawer_suspend_hint),
|
||||
listOf(
|
||||
SessionPrefs.SUSPEND_AUTO to stringResource(R.string.common_auto),
|
||||
SessionPrefs.SUSPEND_MANUAL to stringResource(R.string.mode_suspend_manual),
|
||||
@@ -514,6 +478,17 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
onPick = a.onSuspendPolicy,
|
||||
)
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.drawer_next_session)) {
|
||||
ChoiceRow(host, "shape", stringResource(R.string.mode_ratio), null,
|
||||
SessionPrefs.shapeChoices, a.shapeMode,
|
||||
chipModifier = focus.track(page, "shape"), onPick = a.onShape)
|
||||
}
|
||||
if (a.steam) SettingsGroup(stringResource(R.string.game_settings_title)) {
|
||||
ChoiceRow(host, "fex", stringResource(R.string.fex_preset_title), stringResource(R.string.fex_next_launch),
|
||||
FexPreset.all.map { it.id to stringResource(it.label) }, a.fexPreset,
|
||||
chipModifier = focus.track(page, "fex"), onPick = a.onFexPreset)
|
||||
GameEnvironmentRow(modifier = focus.track(page, "game-env"))
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.drawer_support)) {
|
||||
SettingsRow(stringResource(R.string.drawer_logs), stringResource(R.string.drawer_logs_hint)) {
|
||||
DrawerOutlineButton(stringResource(R.string.drawer_share_logs), modifier = focus.track(page, "share-logs")) {
|
||||
@@ -526,11 +501,12 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
ToggleRow(host, "pip-auto", stringResource(R.string.pip_auto), null,
|
||||
a.pipAutoEnter, onChange = a.onPipAutoEnter)
|
||||
}
|
||||
Column(Modifier.fillMaxWidth().padding(top = 12.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
if (a.pipSupported) DrawerActionButton(stringResource(R.string.pip_title), Icons.Outlined.PictureInPictureAlt,
|
||||
modifier = focus.track(page, "pip")) { host.open = null; a.onPip() }
|
||||
if (!a.isHomeApp) DrawerActionButton(stringResource(R.string.drawer_background), Icons.AutoMirrored.Outlined.ExitToApp,
|
||||
modifier = focus.track(page, "background")) { host.open = null; a.onBackground() }
|
||||
Spacer(Modifier.height(18.dp))
|
||||
if (a.pipSupported) DrawerOutlineButton(stringResource(R.string.pip_title), modifier = focus.track(page, "pip")) {
|
||||
host.open = null; a.onPip()
|
||||
}
|
||||
if (!a.isHomeApp) DrawerOutlineButton(stringResource(R.string.drawer_background), modifier = focus.track(page, "background")) {
|
||||
host.open = null; a.onBackground()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -570,27 +546,6 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun DrawerActionButton(text: String, icon: androidx.compose.ui.graphics.vector.ImageVector, modifier: Modifier = Modifier, onClick: () -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val source = remember { MutableInteractionSource() }
|
||||
val hot = source.collectIsFocusedAsState().value || source.collectIsHoveredAsState().value
|
||||
val shape = RoundedCornerShape(8.dp)
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
modifier = modifier.fillMaxWidth().heightIn(min = 52.dp).clip(shape)
|
||||
.background(if (hot) pal.signal.copy(alpha = 0.16f) else colors.surfaceVariant)
|
||||
.glideBorder(hot, shape, pal.signal)
|
||||
.hoverable(source).clickable(interactionSource = source, indication = LocalIndication.current, onClick = onClick)
|
||||
.controllerConfirm(onClick = onClick).padding(horizontal = 16.dp, vertical = 10.dp),
|
||||
) {
|
||||
Icon(icon, contentDescription = null, tint = colors.onBackground, modifier = Modifier.size(22.dp))
|
||||
Text(text, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun DrawerOutlineButton(text: String, modifier: Modifier = Modifier, onClick: () -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
@@ -681,60 +636,58 @@ private fun DrawerBumper(label: String, description: String, modifier: Modifier
|
||||
/**
|
||||
* The drawer's page tabs, QAM-style: one icon per page standing in a line in page order. The
|
||||
* selected one steps forward - full size, bright, a soft glow - while the others step back to
|
||||
* a little smaller and fade, and the whole line leans a little toward the selection. LB / RB still turn
|
||||
* half size and fade, and the whole line leans a little toward the selection. LB / RB still turn
|
||||
* the page (the buttons beside it and the pad's bumpers); a tab can be tapped or picked with the
|
||||
* pad like the dots it replaces.
|
||||
*/
|
||||
@Composable
|
||||
private fun DrawerPageTabs(page: SessionDrawerPage, pages: List<SessionDrawerPage>, modifier: Modifier = Modifier, compact: Boolean = false, onSelect: (SessionDrawerPage) -> Unit) {
|
||||
private fun DrawerPageTabs(page: Int, modifier: Modifier = Modifier, compact: Boolean = false, onSelect: (Int) -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val count = pages.size
|
||||
val selectedIndex = pages.indexOf(page)
|
||||
val count = drawerPageIcons.size
|
||||
val middle = (count - 1) / 2f
|
||||
val motion = Motion.tw<Float>(340, easing = FastOutSlowInEasing)
|
||||
androidx.compose.foundation.layout.BoxWithConstraints(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = modifier.height(if (compact) 44.dp else 64.dp).clipToBounds(),
|
||||
) {
|
||||
val tab = if (compact) 36f else 44f
|
||||
val tab = if (compact) 40f else 56f
|
||||
// Fit the line to the room between LB and RB. Worst case is an end tab selected: full size
|
||||
// ([tab] dp) and pushed outward by the lean, which scales with the spacing. So
|
||||
// (count-1) * spacing * (1 + lean/spacingMax) + tab <= width
|
||||
val spacing = ((maxWidth.value - tab) / ((count - 1) * (1f + DRAWER_TAB_LEAN_DP / DRAWER_TAB_SPACING_DP))).coerceIn(24f, DRAWER_TAB_SPACING_DP)
|
||||
// (count-1) * spacing * (1 + lean/64) + 56 <= width
|
||||
// - never more than the mock's 64 dp, never tighter than 32 dp.
|
||||
val spacing = ((maxWidth.value - tab) / ((count - 1) * (1f + DRAWER_TAB_LEAN_DP / DRAWER_TAB_SPACING_DP))).coerceIn(32f, DRAWER_TAB_SPACING_DP)
|
||||
val leanStep = DRAWER_TAB_LEAN_DP * spacing / DRAWER_TAB_SPACING_DP
|
||||
val lean by animateFloatAsState(-(selectedIndex - middle) * leanStep, motion, label = "tabLean")
|
||||
pages.forEachIndexed { index, item ->
|
||||
androidx.compose.runtime.key(item) {
|
||||
val selected = item == page
|
||||
val source = remember { MutableInteractionSource() }
|
||||
val focused = source.collectIsFocusedAsState().value
|
||||
val scale by animateFloatAsState(if (selected) 1f else DRAWER_TAB_SIDE_SCALE, motion, label = "tabScale")
|
||||
val alpha by animateFloatAsState(if (selected) 1f else DRAWER_TAB_SIDE_ALPHA, motion, label = "tabAlpha")
|
||||
val glow by animateFloatAsState(if (selected) 1f else 0f, motion, label = "tabGlow")
|
||||
val pageDescription = stringResource(R.string.drawer_page_desc, stringResource(item.title))
|
||||
val tint by animateColorAsState(if (selected) colors.onBackground else colors.onSurfaceVariant, Motion.tw(340, easing = FastOutSlowInEasing), label = "tabTint")
|
||||
val select = { onSelect(item) }
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier
|
||||
.offset(x = ((index - middle) * spacing + lean).dp)
|
||||
.size(tab.dp)
|
||||
.graphicsLayer { scaleX = scale; scaleY = scale; this.alpha = alpha }
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.background(
|
||||
Brush.radialGradient(
|
||||
listOf(pal.signal.copy(alpha = 0.34f * glow), pal.signal.copy(alpha = 0.10f * glow), Color.Transparent),
|
||||
),
|
||||
)
|
||||
.glideBorder(focused, RoundedCornerShape(16.dp), colors.onBackground)
|
||||
.semantics { contentDescription = pageDescription }
|
||||
.hoverable(source)
|
||||
.clickable(interactionSource = source, indication = LocalIndication.current, onClick = select)
|
||||
.controllerConfirm(onClick = select),
|
||||
) {
|
||||
Icon(item.icon, contentDescription = null, tint = tint, modifier = Modifier.size(if (compact) 22.dp else 30.dp))
|
||||
}
|
||||
val lean by animateFloatAsState(-(page - middle) * leanStep, motion, label = "tabLean")
|
||||
drawerPageIcons.forEachIndexed { index, icon ->
|
||||
val selected = index == page
|
||||
val source = remember { MutableInteractionSource() }
|
||||
val focused = source.collectIsFocusedAsState().value
|
||||
val scale by animateFloatAsState(if (selected) 1f else DRAWER_TAB_SIDE_SCALE, motion, label = "tabScale")
|
||||
val alpha by animateFloatAsState(if (selected) 1f else DRAWER_TAB_SIDE_ALPHA, motion, label = "tabAlpha")
|
||||
val glow by animateFloatAsState(if (selected) 1f else 0f, motion, label = "tabGlow")
|
||||
val pageDescription = stringResource(R.string.drawer_page_desc, stringResource(drawerPageTitles[index]))
|
||||
val tint by animateColorAsState(if (selected) colors.onBackground else colors.onSurfaceVariant, Motion.tw(340, easing = FastOutSlowInEasing), label = "tabTint")
|
||||
val select = { onSelect(index) }
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier
|
||||
.offset(x = ((index - middle) * spacing + lean).dp)
|
||||
.size(tab.dp)
|
||||
.graphicsLayer { scaleX = scale; scaleY = scale; this.alpha = alpha }
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.background(
|
||||
Brush.radialGradient(
|
||||
listOf(pal.signal.copy(alpha = 0.34f * glow), pal.signal.copy(alpha = 0.10f * glow), Color.Transparent),
|
||||
),
|
||||
)
|
||||
.glideBorder(focused, RoundedCornerShape(16.dp), colors.onBackground)
|
||||
.semantics { contentDescription = pageDescription }
|
||||
.hoverable(source)
|
||||
.clickable(interactionSource = source, indication = LocalIndication.current, onClick = select)
|
||||
.controllerConfirm(onClick = select),
|
||||
) {
|
||||
Icon(icon, contentDescription = null, tint = tint, modifier = Modifier.size(if (compact) 22.dp else 30.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -743,123 +696,16 @@ private fun DrawerPageTabs(page: SessionDrawerPage, pages: List<SessionDrawerPag
|
||||
/** The Look row's value when the rows below match no Look. */
|
||||
private const val LOOK_CUSTOM = "custom"
|
||||
|
||||
/** Presets and simple effects first; detailed adjustments stay behind Advanced. */
|
||||
@Composable
|
||||
private fun ScreenEffectsGroup(
|
||||
host: MenuHost, a: DrawerActions, advancedExpanded: Boolean, onAdvancedToggle: () -> Unit,
|
||||
track: (String) -> Modifier,
|
||||
) {
|
||||
val e = a.effects
|
||||
val preset = ScreenEffectLooks.match(e, a.upscaler)
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
SettingsGroup(stringResource(R.string.drawer_effects)) {
|
||||
val presets = ScreenEffectLooks.LOOKS.map { it.name to it.name }
|
||||
ChoiceRow(host, "look", stringResource(R.string.drawer_look), null,
|
||||
if (preset == null) listOf(LOOK_CUSTOM to stringResource(R.string.drawer_look_custom)) + presets else presets,
|
||||
preset?.name ?: LOOK_CUSTOM, chipModifier = track("look")) { name ->
|
||||
ScreenEffectLooks.LOOKS.firstOrNull { it.name == name }?.let { picked ->
|
||||
picked.scalingMode?.let(a.onUpscaler)
|
||||
a.onEffects(picked.effects)
|
||||
}
|
||||
}
|
||||
ToggleRow(host, "fxaa", stringResource(R.string.drawer_fxaa), null, e.fxaa, chipModifier = track("fxaa")) { a.onEffects(e.copy(fxaa = it)) }
|
||||
ToggleRow(host, "toon", stringResource(R.string.drawer_toon), null, e.toon, chipModifier = track("toon")) { a.onEffects(e.copy(toon = it)) }
|
||||
ToggleRow(host, "crt", stringResource(R.string.drawer_crt), null, e.crt, chipModifier = track("crt")) { a.onEffects(e.copy(crt = it)) }
|
||||
ToggleRow(host, "ntsc", stringResource(R.string.drawer_ntsc), null, e.ntsc, chipModifier = track("ntsc")) { a.onEffects(e.copy(ntsc = it)) }
|
||||
ToggleRow(host, "fake-hdr", stringResource(R.string.drawer_fake_hdr), null, e.hdr, chipModifier = track("fake-hdr")) { a.onEffects(e.copy(hdr = it)) }
|
||||
}
|
||||
val source = remember { MutableInteractionSource() }
|
||||
val hot = source.collectIsFocusedAsState().value || source.collectIsHoveredAsState().value
|
||||
val rotation by animateFloatAsState(if (advancedExpanded) 180f else 0f, Motion.tw(180), label = "advancedArrow")
|
||||
val description = stringResource(if (advancedExpanded) R.string.widgets_expanded else R.string.widgets_collapsed)
|
||||
val toggle = { host.open = null; onAdvancedToggle() }
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
modifier = track("effects-advanced").fillMaxWidth().padding(top = 12.dp).heightIn(min = 48.dp)
|
||||
.glideBorder(hot, RoundedCornerShape(8.dp), pal.signal)
|
||||
.hoverable(source).clickable(interactionSource = source, indication = LocalIndication.current, role = Role.Button, onClick = toggle)
|
||||
.controllerConfirm(onClick = toggle).semantics { stateDescription = description }.padding(horizontal = 4.dp),
|
||||
) {
|
||||
Text(stringResource(R.string.drawer_effects_advanced).uppercase(), fontSize = 12.sp,
|
||||
fontWeight = FontWeight.SemiBold, letterSpacing = 1.5.sp, color = colors.onSurfaceVariant)
|
||||
Box(Modifier.weight(1f).height(1.dp).background(pal.line))
|
||||
Icon(Icons.Outlined.ExpandMore, contentDescription = null, tint = colors.onSurfaceVariant,
|
||||
modifier = Modifier.size(22.dp).rotate(rotation))
|
||||
}
|
||||
AnimatedVisibility(advancedExpanded) {
|
||||
Column(Modifier.fillMaxWidth().clip(RoundedCornerShape(14.dp)).background(colors.surface).border(1.dp, pal.line, RoundedCornerShape(14.dp))) {
|
||||
ToggleRow(host, "cas", stringResource(R.string.drawer_cas), null, e.cas, chipModifier = track("cas")) { a.onEffects(e.copy(cas = it)) }
|
||||
if (e.cas) SliderRow(stringResource(R.string.drawer_cas_level), null, e.casLevel, 0..100, step = 5,
|
||||
format = { "$it%" }, modifier = track("cas-level")) { a.onEffects(e.copy(casLevel = it)) }
|
||||
ToggleRow(host, "deband", stringResource(R.string.drawer_deband), null, e.deband, chipModifier = track("deband")) { a.onEffects(e.copy(deband = it)) }
|
||||
if (e.deband) SliderRow(stringResource(R.string.drawer_deband_strength), null, e.debandStrength, 0..200, step = 5,
|
||||
format = { "$it%" }, modifier = track("deband-strength")) { a.onEffects(e.copy(debandStrength = it)) }
|
||||
SliderRow(stringResource(R.string.drawer_brightness), null, e.brightness, -100..100, step = 2,
|
||||
format = ::signed, modifier = track("brightness")) { a.onEffects(e.copy(brightness = it)) }
|
||||
SliderRow(stringResource(R.string.drawer_contrast), null, e.contrast, -100..100, step = 2,
|
||||
format = ::signed, modifier = track("contrast")) { a.onEffects(e.copy(contrast = it)) }
|
||||
SliderRow(stringResource(R.string.drawer_gamma), null, (e.gamma * 100f).roundToInt(), 50..300, step = 5,
|
||||
format = { String.format(Locale.US, "%.2f", it / 100f) }, modifier = track("gamma")) { a.onEffects(e.copy(gamma = it / 100f)) }
|
||||
SliderRow(stringResource(R.string.drawer_saturation), null, e.saturation, 0..200, step = 5,
|
||||
format = { "$it%" }, modifier = track("saturation")) { a.onEffects(e.copy(saturation = it)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
/** Display, Effects, Controls, Components, Settings. */
|
||||
const val DRAWER_PAGES = 5
|
||||
|
||||
/** Secondary-display modes are mutually exclusive and apply immediately. */
|
||||
@Composable
|
||||
private fun SecondScreenGroup(host: MenuHost, a: DrawerActions, track: (String) -> Modifier) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val modes = listOf(SecondScreenMode.NONE, SecondScreenMode.KEYBOARD_TRACKPAD, SecondScreenMode.TERMINAL) +
|
||||
if (com.droiddeck.launcher.session.SessionState.deckPad) listOf(SecondScreenMode.DECK_CONTROLS) else emptyList()
|
||||
SettingsGroup(stringResource(R.string.drawer_second_screen_mode)) {
|
||||
Column(Modifier.fillMaxWidth().selectableGroup()) {
|
||||
modes.forEach { mode ->
|
||||
val selected = a.secondScreenMode == mode
|
||||
val source = remember { MutableInteractionSource() }
|
||||
val hot = source.collectIsFocusedAsState().value || source.collectIsHoveredAsState().value
|
||||
val pick = { host.open = null; a.onSecondScreenMode(mode) }
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = track("second-screen:${mode.id}").fillMaxWidth().heightIn(min = 56.dp)
|
||||
.background(if (hot) pal.signal.copy(alpha = 0.12f) else Color.Transparent)
|
||||
.glideBorder(hot, RoundedCornerShape(8.dp), pal.signal)
|
||||
.hoverable(source)
|
||||
.selectable(selected, interactionSource = source, indication = null, role = Role.RadioButton, onClick = pick)
|
||||
.controllerConfirm(onClick = pick)
|
||||
.padding(horizontal = 14.dp, vertical = 8.dp),
|
||||
) {
|
||||
Text(mode.label, fontSize = 15.sp, color = colors.onBackground, modifier = Modifier.weight(1f))
|
||||
RadioButton(selected, onClick = null,
|
||||
colors = RadioButtonDefaults.colors(selectedColor = pal.signal, unselectedColor = colors.onSurfaceVariant))
|
||||
}
|
||||
}
|
||||
}
|
||||
if (a.secondScreenDisplays.size > 1) ChoiceRow(host, "second-screen-display", stringResource(R.string.drawer_page_display), null,
|
||||
a.secondScreenDisplays.map { it.id to it.label }, a.selectedSecondScreenDisplay,
|
||||
chipModifier = track("second-screen-display"), onPick = a.onSecondScreenDisplay)
|
||||
}
|
||||
}
|
||||
private const val DRAWER_PAGE_EFFECTS = 1
|
||||
private const val DRAWER_PAGE_CONTROLS = 2
|
||||
|
||||
/** Texture filtering on the Games page: DXVK options for the next DirectX 9-11 launch. */
|
||||
@Composable
|
||||
private fun TextureFilteringGroup(host: MenuHost, a: DrawerActions, track: (String) -> Modifier) {
|
||||
SettingsGroup(stringResource(R.string.drawer_texture)) {
|
||||
ChoiceRow(host, "anisotropy", stringResource(R.string.drawer_anisotropy), null,
|
||||
SessionPrefs.textureAnisotropyChoices, a.textureAnisotropy, chipModifier = track("anisotropy"), onPick = a.onTextureAnisotropy)
|
||||
ChoiceRow(host, "texture-sharpness", stringResource(R.string.drawer_texture_sharpness), null,
|
||||
SessionPrefs.textureLodBiasChoices, a.textureLodBias, note = stringResource(R.string.drawer_texture_sharpness_note),
|
||||
chipModifier = track("texture-sharpness"), onPick = a.onTextureLodBias)
|
||||
}
|
||||
}
|
||||
|
||||
private fun signed(v: Int) = if (v > 0) "+$v" else "$v"
|
||||
private const val DRAWER_PAGE_COMPONENTS = 3
|
||||
|
||||
/**
|
||||
* The Games tab's components: quick swaps between what is already installed, per Proton. A swap
|
||||
* The drawer's Components tab: quick swaps between what is already installed, per Proton. A swap
|
||||
* into the Proton a running game uses waits until that game closes; downloading, importing and
|
||||
* deleting stay on the Components page in the app.
|
||||
*/
|
||||
@@ -983,14 +829,14 @@ private fun <T> DrawerStackedChoice(
|
||||
Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
|
||||
}
|
||||
|
||||
/** A close row of icons: inactive tabs stay legible while the active tab leads. */
|
||||
private const val DRAWER_TAB_SPACING_DP = 48f
|
||||
/** The tab row's measure, from the approved mock: side tabs at half size, a little faded. */
|
||||
private const val DRAWER_TAB_SPACING_DP = 64f
|
||||
|
||||
private const val DRAWER_TAB_LEAN_DP = 8f
|
||||
private const val DRAWER_TAB_LEAN_DP = 12f
|
||||
|
||||
private const val DRAWER_TAB_SIDE_SCALE = 0.8f
|
||||
private const val DRAWER_TAB_SIDE_SCALE = 0.5f
|
||||
|
||||
private const val DRAWER_TAB_SIDE_ALPHA = 0.8f
|
||||
private const val DRAWER_TAB_SIDE_ALPHA = 0.7f
|
||||
|
||||
/** Room between the Stop pill and the box that steps out under it: the pull. */
|
||||
private val StepPull = 6.dp
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.foundation.focusGroup
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.snapshotFlow
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.ui.focus.onFocusChanged
|
||||
import kotlinx.coroutines.flow.filterNotNull
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
internal fun SettingsCategoryPage(
|
||||
s: FrontEndState,
|
||||
a: FrontEndActions,
|
||||
category: SettingsCategory,
|
||||
mode: String,
|
||||
target: String?,
|
||||
onOpenDeveloperOptions: () -> Unit,
|
||||
onRequestWirelessAdb: (Boolean) -> Unit,
|
||||
modeContent: @Composable (MenuHost) -> Unit,
|
||||
) {
|
||||
val host = rememberMenuHost()
|
||||
val entry = remember { FocusRequester() }
|
||||
val frontFocus = LocalFrontFocus.current
|
||||
var hasFocus by remember { mutableStateOf(false) }
|
||||
var lastItem by rememberSaveable { mutableStateOf<String?>(null) }
|
||||
LaunchedEffect(frontFocus) {
|
||||
snapshotFlow { if (hasFocus) frontFocus?.last else null }.filterNotNull().collect { lastItem = it }
|
||||
}
|
||||
val back = { if (host.open != null) host.open = null else a.onPageBack() }
|
||||
BackHandler(enabled = host.open != null, onBack = back)
|
||||
LaunchedEffect(category, mode) {
|
||||
if (target == null) {
|
||||
focusWithinFrames({ hasFocus }) {
|
||||
val id = lastItem
|
||||
if (id != null && (frontFocus?.attached?.get(id) ?: 0) > 0) frontFocus!!.items.getValue(id)
|
||||
else entry
|
||||
}
|
||||
}
|
||||
}
|
||||
CompositionLocalProvider(LocalSettingsTarget provides target, LocalSettingsAnchorsEnabled provides true) {
|
||||
SettingsPage(
|
||||
host, category.title, back,
|
||||
) {
|
||||
if (category == SettingsCategory.DISPLAY || category == SettingsCategory.SESSIONS) {
|
||||
SegmentedTabs(
|
||||
settingsSessionModes, mode,
|
||||
Modifier.padding(bottom = 10.dp), a.onSettingsMode,
|
||||
)
|
||||
}
|
||||
Column(Modifier.fillMaxWidth().focusRequester(entry).onFocusChanged { hasFocus = it.hasFocus }.focusGroup()) {
|
||||
if (category != SettingsCategory.SESSIONS || mode == "steam") {
|
||||
SetupContent(s, a, category, host, onOpenDeveloperOptions, onRequestWirelessAdb)
|
||||
}
|
||||
modeContent(host)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,391 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.foundation.LocalIndication
|
||||
import androidx.compose.foundation.focusGroup
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.hoverable
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.foundation.interaction.collectIsFocusedAsState
|
||||
import androidx.compose.foundation.interaction.collectIsHoveredAsState
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.DisplaySettings
|
||||
import androidx.compose.material.icons.outlined.FolderOpen
|
||||
import androidx.compose.material.icons.outlined.Gamepad
|
||||
import androidx.compose.material.icons.outlined.GraphicEq
|
||||
import androidx.compose.material.icons.outlined.HelpOutline
|
||||
import androidx.compose.material.icons.outlined.Home
|
||||
import androidx.compose.material.icons.outlined.Settings
|
||||
import androidx.compose.material.icons.outlined.Speed
|
||||
import androidx.compose.material.icons.outlined.Search
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.EditText
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.rememberUpdatedState
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.snapshotFlow
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.focus.onFocusChanged
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.droiddeck.launcher.session.SessionService
|
||||
import com.droiddeck.launcher.core.PhantomProcessLimit
|
||||
import kotlinx.coroutines.flow.filterNotNull
|
||||
|
||||
/** The settings taxonomy is shared by the hub, category pages, and the searchable index. */
|
||||
enum class SettingsCategory(val title: String, val description: String) {
|
||||
GENERAL("General", "Launcher appearance and home-screen behavior"),
|
||||
DISPLAY("Display & graphics", "Resolution, effects, scaling, and frame generation"),
|
||||
CONTROLS("Controls & input", "Controller layout, touch behavior, and button mapping"),
|
||||
AUDIO("Audio & microphone", "Session audio and microphone options"),
|
||||
LIBRARY("Library & storage", "Game folders, storage, ROMs, and file access"),
|
||||
SESSIONS("Sessions", "Session startup, suspend, and client behavior"),
|
||||
COMPATIBILITY("Compatibility & performance", "Proton, components, and performance tools"),
|
||||
SUPPORT("Support & diagnostics", "System checks, logs, runtime, and app updates"),
|
||||
}
|
||||
|
||||
data class SettingsEntry(
|
||||
val target: String,
|
||||
val category: SettingsCategory,
|
||||
val title: String,
|
||||
val description: String,
|
||||
val aliases: List<String> = emptyList(),
|
||||
/** Null means the target is available regardless of Steam/Desktop mode. */
|
||||
val mode: String? = null,
|
||||
) {
|
||||
internal fun matches(query: String): Boolean {
|
||||
val q = query.trim().lowercase()
|
||||
if (q.isEmpty()) return false
|
||||
return sequenceOf(title, description, category.title).plus(aliases.asSequence())
|
||||
.any { it.lowercase().contains(q) }
|
||||
}
|
||||
}
|
||||
|
||||
/** Search data points into the existing settings rows and specialist pages; it stores no values. */
|
||||
object SettingsCatalog {
|
||||
val entries: List<SettingsEntry> = listOf(
|
||||
SettingsEntry("theme", SettingsCategory.GENERAL, "Theme", "Choose the launcher color theme", listOf("appearance", "colors")),
|
||||
SettingsEntry("home-screen", SettingsCategory.GENERAL, "Home screen", "Enable DroidDeck as an Android home app", listOf("launcher", "default launcher")),
|
||||
SettingsEntry("default-home", SettingsCategory.GENERAL, "Default home app", "Choose DroidDeck as the Android home app", listOf("home app", "launcher app")),
|
||||
SettingsEntry("launcher-fullscreen", SettingsCategory.GENERAL, "Fullscreen", "Show the launcher without Android system bars", listOf("immersive")),
|
||||
SettingsEntry("launcher-animations", SettingsCategory.GENERAL, "Animations", "Enable or disable launcher motion", listOf("motion")),
|
||||
SettingsEntry("store-enabled", SettingsCategory.GENERAL, "Linux app store", "Show the Flathub Store in the launcher", listOf("store", "flathub")),
|
||||
SettingsEntry("res", SettingsCategory.DISPLAY, "Resolution", "Set the next session resolution", listOf("720p", "900p", "1080p", "native"), "steam"),
|
||||
SettingsEntry("shape", SettingsCategory.DISPLAY, "Aspect ratio", "Choose how the session fits the screen", listOf("shape", "ratio"), "steam"),
|
||||
SettingsEntry("fps", SettingsCategory.DISPLAY, "Frame-rate limit", "Limit the session frame rate", listOf("fps", "refresh rate"), "steam"),
|
||||
SettingsEntry("upscaler", SettingsCategory.DISPLAY, "Upscaling", "Choose the session image scaling filter", listOf("sharpness", "scaling"), "steam"),
|
||||
SettingsEntry("upscale-sharpness", SettingsCategory.DISPLAY, "Upscaling sharpness", "Adjust image sharpening", listOf("sharpening"), "steam"),
|
||||
SettingsEntry("hdr", SettingsCategory.DISPLAY, "HDR", "Enable HDR output when supported", listOf("high dynamic range"), "steam"),
|
||||
SettingsEntry("fill", SettingsCategory.DISPLAY, "Fill screen", "Stretch the session to fill the display", listOf("force fullscreen"), "steam"),
|
||||
SettingsEntry("stretch169", SettingsCategory.DISPLAY, "Stretch to 16:9", "Stretch the session image to a 16:9 shape", listOf("widescreen stretch"), "steam"),
|
||||
SettingsEntry("gpu-drivers", SettingsCategory.COMPATIBILITY, "GPU drivers", "Manage Android and Linux display drivers", listOf("turnip", "adreno", "vulkan"), "steam"),
|
||||
SettingsEntry("fg", SettingsCategory.DISPLAY, "Frame generation", "Choose a frame-generation mode or import Lossless Scaling", listOf("lossless scaling", "lsfg")),
|
||||
SettingsEntry("effects-look", SettingsCategory.DISPLAY, "Screen effects preset", "Choose a preset for image effects", listOf("look", "post-processing")),
|
||||
SettingsEntry("effects-cas", SettingsCategory.DISPLAY, "Contrast adaptive sharpening", "Enable contrast adaptive sharpening", listOf("cas", "sharpness")),
|
||||
SettingsEntry("effects-cas-level", SettingsCategory.DISPLAY, "Sharpening strength", "Adjust contrast adaptive sharpening", listOf("cas level")),
|
||||
SettingsEntry("effects-fake-hdr", SettingsCategory.DISPLAY, "Fake HDR", "Add an HDR-style image effect", listOf("hdr effect")),
|
||||
SettingsEntry("effects-deband", SettingsCategory.DISPLAY, "Debanding", "Reduce color banding in gradients", listOf("banding")),
|
||||
SettingsEntry("effects-deband-strength", SettingsCategory.DISPLAY, "Debanding strength", "Adjust color banding reduction", listOf("banding strength")),
|
||||
SettingsEntry("effects-brightness", SettingsCategory.DISPLAY, "Brightness", "Adjust the session image brightness", listOf("light")),
|
||||
SettingsEntry("effects-contrast", SettingsCategory.DISPLAY, "Contrast", "Adjust the session image contrast", listOf("image contrast")),
|
||||
SettingsEntry("effects-gamma", SettingsCategory.DISPLAY, "Gamma", "Adjust the session image gamma", listOf("midtones")),
|
||||
SettingsEntry("effects-saturation", SettingsCategory.DISPLAY, "Saturation", "Adjust the session image saturation", listOf("color intensity")),
|
||||
SettingsEntry("effects-fxaa", SettingsCategory.DISPLAY, "FXAA", "Enable fast approximate anti-aliasing", listOf("anti-aliasing")),
|
||||
SettingsEntry("effects-toon", SettingsCategory.DISPLAY, "Toon effect", "Enable the toon image effect", listOf("cartoon")),
|
||||
SettingsEntry("effects-crt", SettingsCategory.DISPLAY, "CRT effect", "Enable the CRT image effect", listOf("scanlines")),
|
||||
SettingsEntry("effects-ntsc", SettingsCategory.DISPLAY, "NTSC effect", "Enable the NTSC image effect", listOf("composite video")),
|
||||
SettingsEntry("textures-anisotropy", SettingsCategory.DISPLAY, "Texture anisotropy", "Choose texture filtering anisotropy", listOf("anisotropic filtering")),
|
||||
SettingsEntry("textures-sharpness", SettingsCategory.DISPLAY, "Texture sharpness", "Adjust texture level-of-detail bias", listOf("lod bias", "texture filtering")),
|
||||
SettingsEntry("touch", SettingsCategory.CONTROLS, "Touch mode", "Choose how touch input behaves in a session", listOf("touchpad", "direct touch"), "steam"),
|
||||
SettingsEntry("controller-osc", SettingsCategory.CONTROLS, "On-screen controls", "Choose when the touch controls appear", listOf("overlay", "controller overlay"), "steam"),
|
||||
SettingsEntry("controller", SettingsCategory.CONTROLS, "Controller type", "Choose the controller profile exposed to Steam", listOf("xbox", "steam deck"), "steam"),
|
||||
SettingsEntry("back-actions", SettingsCategory.CONTROLS, "Back-button actions", "Choose the order of the Steam menu and Quick Access Menu", listOf("b button", "menu button", "qam")),
|
||||
SettingsEntry("controller-mapping", SettingsCategory.CONTROLS, "Button mapping", "Remap controller buttons", listOf("mapping", "remap")),
|
||||
SettingsEntry("controller-tint", SettingsCategory.CONTROLS, "Controller color", "Choose the on-screen controller color", listOf("tint")),
|
||||
SettingsEntry("controller-layout", SettingsCategory.CONTROLS, "Controller layout", "Edit or reset the touch controller layout", listOf("custom layout")),
|
||||
SettingsEntry("controller-reset", SettingsCategory.CONTROLS, "Reset controller settings", "Reset the on-screen controller configuration", listOf("reset all")),
|
||||
SettingsEntry("controller-opacity", SettingsCategory.CONTROLS, "Controller opacity", "Adjust the on-screen controller opacity", listOf("transparency")),
|
||||
SettingsEntry("controller-size", SettingsCategory.CONTROLS, "Controller size", "Adjust the on-screen controller size", listOf("scale")),
|
||||
SettingsEntry("controller-stick-click", SettingsCategory.CONTROLS, "Stick click", "Enable stick-click controls", listOf("l3", "r3")),
|
||||
SettingsEntry("controller-adaptive", SettingsCategory.CONTROLS, "Adaptive sticks", "Adjust stick behavior to the active game", listOf("stick sensitivity")),
|
||||
SettingsEntry("controller-rumble", SettingsCategory.CONTROLS, "Controller rumble", "Enable controller vibration", listOf("vibration")),
|
||||
SettingsEntry("controller-steam", SettingsCategory.CONTROLS, "Steam button", "Show the Steam button on the virtual controller", listOf("steam menu")),
|
||||
SettingsEntry("controller-qam", SettingsCategory.CONTROLS, "Quick Access button", "Show the Quick Access button on the virtual controller", listOf("qam")),
|
||||
SettingsEntry("controller-keyboard", SettingsCategory.CONTROLS, "On-screen keyboard button", "Show the keyboard button on the virtual controller", listOf("keyboard")),
|
||||
SettingsEntry("controller-actions", SettingsCategory.CONTROLS, "Controller layout and mapping", "Edit the on-screen layout, remap buttons, or reset controller settings", listOf("color", "opacity", "size", "stick click", "adaptive sticks", "rumble", "steam button", "qam button", "keyboard button", "layout", "mapping", "reset")),
|
||||
SettingsEntry("da", SettingsCategory.AUDIO, "Direct audio", "Configure direct game audio", listOf("audio output"), "steam"),
|
||||
SettingsEntry("clientAudio", SettingsCategory.AUDIO, "Steam-menu audio", "Choose the audio mode for Steam menus", listOf("client audio", "steam client audio"), "steam"),
|
||||
SettingsEntry("mic", SettingsCategory.AUDIO, "Microphone", "Allow session microphone input", listOf("recording", "voice chat"), "steam"),
|
||||
SettingsEntry("added-games", SettingsCategory.LIBRARY, "Added games", "Manage imported game folders and launch files", listOf("non-steam games", "exe"), "steam"),
|
||||
SettingsEntry("addedArt", SettingsCategory.LIBRARY, "Added game artwork", "Show artwork for imported games", listOf("game covers", "covers"), "steam"),
|
||||
SettingsEntry("storage", SettingsCategory.LIBRARY, "Game storage", "Choose where Steam stores games", listOf("second library", "sd card"), "steam"),
|
||||
SettingsEntry("storage-location", SettingsCategory.LIBRARY, "Second library", "Import or remove a second Steam library", listOf("library location", "sd card folder"), "steam"),
|
||||
SettingsEntry("added-games-add", SettingsCategory.LIBRARY, "Add a game folder", "Import another folder of games", listOf("add games directory", "import folder"), "steam"),
|
||||
SettingsEntry("roms", SettingsCategory.LIBRARY, "ROM folders", "Choose the folder scanned for ROMs", listOf("emulator games")),
|
||||
SettingsEntry("files", SettingsCategory.LIBRARY, "File manager", "Browse files in the Linux runtime", listOf("file browser")),
|
||||
SettingsEntry("suspend", SettingsCategory.SESSIONS, "Suspend behavior", "Choose how sessions respond to suspend", listOf("sleep", "suspend policy"), "steam"),
|
||||
SettingsEntry("offline", SettingsCategory.SESSIONS, "Offline mode", "Use the signed-in account in offline mode", listOf("offline account")),
|
||||
SettingsEntry("pip-auto", SettingsCategory.SESSIONS, "Picture-in-picture", "Automatically enter picture-in-picture", listOf("pip"), "steam"),
|
||||
SettingsEntry("steam-startup", SettingsCategory.SESSIONS, "Start Steam on launch", "Start Steam automatically with DroidDeck", listOf("autostart"), "steam"),
|
||||
SettingsEntry("steamdeck", SettingsCategory.SESSIONS, "Steam Deck mode", "Use the Steam Deck client interface", listOf("big picture", "deck mode"), "steam"),
|
||||
SettingsEntry("mangoapp", SettingsCategory.DISPLAY, "Performance overlay", "Show the MangoHud performance overlay", listOf("mangohud", "mangoapp"), "steam"),
|
||||
SettingsEntry("channel", SettingsCategory.SESSIONS, "Steam branch", "Choose the Steam client update branch", listOf("beta", "client channel"), "steam"),
|
||||
SettingsEntry("wifi", SettingsCategory.SESSIONS, "Wi-Fi discovery", "Enable local network discovery for Steam", listOf("network", "remote play"), "steam"),
|
||||
SettingsEntry("renderer", SettingsCategory.SESSIONS, "Desktop renderer", "Choose the Linux desktop renderer", listOf("desktop graphics"), SessionService.MODE_DESKTOP),
|
||||
SettingsEntry("decky", SettingsCategory.SESSIONS, "Decky Loader", "Install and manage Decky Loader", listOf("decky loader", "plugin loader"), "steam"),
|
||||
SettingsEntry("decky-enabled", SettingsCategory.SESSIONS, "Enable Decky Loader", "Start or stop Decky Loader with Steam", listOf("decky toggle"), "steam"),
|
||||
SettingsEntry("decky-loader", SettingsCategory.SESSIONS, "Decky installation", "Install or repair the Decky loader", listOf("decky install", "decky status"), "steam"),
|
||||
SettingsEntry("decky-plugins", SettingsCategory.SESSIONS, "Decky plugins", "Install a Decky plugin ZIP", listOf("plugin zip"), "steam"),
|
||||
SettingsEntry("components", SettingsCategory.COMPATIBILITY, "Compatibility components", "Manage FEX, DXVK, and VKD3D-Proton", listOf("dxvk", "vkd3d", "fex")),
|
||||
SettingsEntry("default-proton", SettingsCategory.COMPATIBILITY, "Default Proton", "Choose the synchronized Steam default", listOf("default-proton")),
|
||||
SettingsEntry("editing-proton", SettingsCategory.COMPATIBILITY, "Editing components for", "Choose which Proton build to edit", listOf("component editing target")),
|
||||
SettingsEntry("protons", SettingsCategory.COMPATIBILITY, "Proton versions", "Install and manage Proton builds", listOf("wine", "proton-ge", "installed proton")),
|
||||
SettingsEntry("performance", SettingsCategory.COMPATIBILITY, "Performance", "Tune CPU cores and graphics compatibility options", listOf("cpu", "cores", "zink", "fsync")),
|
||||
SettingsEntry("performance:override", SettingsCategory.COMPATIBILITY, "Per-app core limits", "Override the Steam client CPU core selection", listOf("client core override", "cpu affinity")),
|
||||
SettingsEntry("performance:clientCores", SettingsCategory.COMPATIBILITY, "Steam client CPU cores", "Choose CPU cores available to the Steam client", listOf("steam cores", "client affinity")),
|
||||
SettingsEntry("performance:gameCores", SettingsCategory.COMPATIBILITY, "Game CPU cores", "Choose CPU cores available to games", listOf("game affinity")),
|
||||
SettingsEntry("performance:glthread", SettingsCategory.COMPATIBILITY, "GL threading", "Change GL threading behavior", listOf("gl thread")),
|
||||
SettingsEntry("performance:zink", SettingsCategory.COMPATIBILITY, "Zink", "Change Zink lazy pipeline behavior", listOf("lazy pipeline")),
|
||||
SettingsEntry("performance:noglerror", SettingsCategory.COMPATIBILITY, "Ignore GL errors", "Change OpenGL error handling", listOf("opengl errors")),
|
||||
SettingsEntry("performance:gsrealtime", SettingsCategory.COMPATIBILITY, "Gamescope real-time priority", "Set Gamescope scheduling priority", listOf("realtime scheduling")),
|
||||
SettingsEntry("performance:gpuclock", SettingsCategory.COMPATIBILITY, "Pin GPU clock", "Set the GPU clock policy", listOf("gpu clock")),
|
||||
SettingsEntry("performance:sysmem", SettingsCategory.COMPATIBILITY, "Turnip system memory", "Change Turnip system memory behavior", listOf("tu sysmem")),
|
||||
SettingsEntry("performance:xalia", SettingsCategory.COMPATIBILITY, "Xalia", "Change Xalia input behavior", listOf("no xalia")),
|
||||
SettingsEntry("performance:syncfallback", SettingsCategory.COMPATIBILITY, "Esync fallback", "Change synchronization fallback behavior", listOf("esync")),
|
||||
SettingsEntry("performance:fsyncfirst", SettingsCategory.COMPATIBILITY, "Fsync first", "Try fsync before other synchronization backends", listOf("fsync")),
|
||||
SettingsEntry("performance:fastsync", SettingsCategory.COMPATIBILITY, "Fast sync", "Enable fast synchronization", listOf("wine sync")),
|
||||
SettingsEntry("performance:seccomp", SettingsCategory.COMPATIBILITY, "Proot seccomp", "Change the proot seccomp setting", listOf("syscall filtering")),
|
||||
SettingsEntry("performance:fastpath", SettingsCategory.COMPATIBILITY, "Proot fast path", "Enable the proot fast path", listOf("fast path")),
|
||||
SettingsEntry("performance:hostname", SettingsCategory.COMPATIBILITY, "Guest hostname", "Set the Linux guest hostname", listOf("computer name")),
|
||||
SettingsEntry("fex", SettingsCategory.COMPATIBILITY, "FEX preset", "Choose CPU translation settings for games", listOf("translation", "x86"), "steam"),
|
||||
SettingsEntry("syncBackend", SettingsCategory.COMPATIBILITY, "Synchronization backend", "Choose the game synchronization backend", listOf("ntsync", "fsync", "esync"), "steam"),
|
||||
SettingsEntry("game-env", SettingsCategory.COMPATIBILITY, "Game environment", "Edit per-game environment options", listOf("environment variables", "launch options"), "steam"),
|
||||
SettingsEntry("storageDiagnostics", SettingsCategory.SUPPORT, "Storage diagnostics", "Collect diagnostics for game storage", listOf("storage logs"), "steam"),
|
||||
SettingsEntry("runtime", SettingsCategory.SUPPORT, "Linux runtime", "Install, update, or manage the Linux runtime", listOf("runtime install", "container")),
|
||||
SettingsEntry("logs", SettingsCategory.SUPPORT, "Session logs", "Enable, share, or clear session logs", listOf("diagnostics", "debug logs")),
|
||||
SettingsEntry("updates", SettingsCategory.SUPPORT, "DroidDeck updates", "View build information and release channel", listOf("version", "build")),
|
||||
SettingsEntry("phantom-process", SettingsCategory.SUPPORT, "Child-process limit", "Diagnose Android's process limit that can block Steam", listOf("phantom process", "developer options", "wireless debugging", "adb")),
|
||||
)
|
||||
|
||||
fun search(query: String): List<SettingsEntry> = entries.filter { it.matches(query) }
|
||||
}
|
||||
|
||||
private data class CategoryCard(val category: SettingsCategory, val icon: ImageVector)
|
||||
|
||||
@Composable
|
||||
fun SettingsHub(s: FrontEndState, a: FrontEndActions) {
|
||||
var query by rememberSaveable { mutableStateOf("") }
|
||||
val frontFocus = LocalFrontFocus.current
|
||||
var hasFocus by remember { mutableStateOf(false) }
|
||||
var lastItem by rememberSaveable { mutableStateOf<String?>(null) }
|
||||
LaunchedEffect(frontFocus) {
|
||||
snapshotFlow { if (hasFocus) frontFocus?.last else null }.filterNotNull().collect { lastItem = it }
|
||||
}
|
||||
LaunchedEffect(Unit) {
|
||||
if (frontFocus != null) focusWithinFrames({ hasFocus }) {
|
||||
val id = lastItem
|
||||
if (id != null && (frontFocus.attached[id] ?: 0) > 0) frontFocus.items.getValue(id)
|
||||
else frontFocus.primary
|
||||
}
|
||||
}
|
||||
DisposableEffect(frontFocus) {
|
||||
frontFocus?.let { it.primaryAttached++ }
|
||||
onDispose { frontFocus?.let { it.primaryAttached-- } }
|
||||
}
|
||||
val cards = listOf(
|
||||
CategoryCard(SettingsCategory.GENERAL, Icons.Outlined.Home),
|
||||
CategoryCard(SettingsCategory.DISPLAY, Icons.Outlined.DisplaySettings),
|
||||
CategoryCard(SettingsCategory.CONTROLS, Icons.Outlined.Gamepad),
|
||||
CategoryCard(SettingsCategory.AUDIO, Icons.Outlined.GraphicEq),
|
||||
CategoryCard(SettingsCategory.LIBRARY, Icons.Outlined.FolderOpen),
|
||||
CategoryCard(SettingsCategory.SESSIONS, Icons.Outlined.Settings),
|
||||
CategoryCard(SettingsCategory.COMPATIBILITY, Icons.Outlined.Speed),
|
||||
CategoryCard(SettingsCategory.SUPPORT, Icons.Outlined.HelpOutline),
|
||||
)
|
||||
Column(
|
||||
modifier = Modifier.fillMaxSize().onFocusChanged { hasFocus = it.hasFocus }.focusGroup()
|
||||
.verticalScroll(rememberScrollState()).padding(horizontal = 16.dp, vertical = 12.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||
) {
|
||||
PageHeader("Settings")
|
||||
HubSearchField(query = query, onQuery = { query = it }, frontFocus = frontFocus)
|
||||
if (!s.ready || s.removalPending || PhantomProcessLimit.blocksSteam(s.phantomProcessStatus)) {
|
||||
val (title, detail, target) = when {
|
||||
s.removalPending -> Triple("Runtime needs attention", "Runtime removal needs to be completed before using the session.", "runtime")
|
||||
!s.ready -> Triple("Linux runtime is not ready", "Install or repair the runtime to launch Steam.", "runtime")
|
||||
else -> Triple("Android process limit may block Steam", "Review the child-process setting and available fixes.", "phantom-process")
|
||||
}
|
||||
SettingsAnchor(target) { ActionRow(title, detail, "Review") { a.onSettingsCategory(SettingsCategory.SUPPORT, target) } }
|
||||
}
|
||||
if (query.isBlank()) {
|
||||
val columns = if (LocalNarrowPane.current) 1 else 2
|
||||
cards.chunked(columns).forEach { row ->
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.fillMaxWidth().heightIn(min = 72.dp)) {
|
||||
row.forEach { card ->
|
||||
SettingsCategoryCard(card, Modifier.weight(1f).paneItem("settings-category:${card.category.name}"), onClick = { a.onSettingsCategory(card.category, null) })
|
||||
}
|
||||
repeat(columns - row.size) { Spacer(Modifier.weight(1f)) }
|
||||
}
|
||||
}
|
||||
} else {
|
||||
val results = SettingsCatalog.search(query)
|
||||
if (results.isEmpty()) {
|
||||
Note("No settings found for “${query.trim()}”.")
|
||||
} else {
|
||||
results.forEach { entry ->
|
||||
SettingsSearchResult(entry, Modifier.paneItem("settings-search:${entry.target}")) { a.onSettingsCategory(entry.category, entry.target) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun HubSearchField(query: String, onQuery: (String) -> Unit, frontFocus: FrontFocus?) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val shape = RoundedCornerShape(14.dp)
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
modifier = Modifier.fillMaxWidth().clip(shape).background(colors.surface)
|
||||
.border(1.dp, pal.line2, shape).padding(horizontal = 14.dp, vertical = 11.dp),
|
||||
) {
|
||||
Icon(Icons.Outlined.Search, contentDescription = null, tint = colors.onSurfaceVariant, modifier = Modifier.size(20.dp))
|
||||
val onQueryLatest = rememberUpdatedState(onQuery)
|
||||
AndroidView(
|
||||
modifier = Modifier.weight(1f).height(30.dp)
|
||||
.then(if (frontFocus == null) Modifier else Modifier.focusRequester(frontFocus.primary)),
|
||||
factory = { context ->
|
||||
EditText(context).apply {
|
||||
isSingleLine = true
|
||||
background = null
|
||||
setPadding(0, 0, 0, 0)
|
||||
setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 15f)
|
||||
hint = "Search settings"
|
||||
contentDescription = "Search settings"
|
||||
// Keep the hub visible while typing on landscape handhelds.
|
||||
imeOptions = EditorInfo.IME_ACTION_SEARCH or EditorInfo.IME_FLAG_NO_FULLSCREEN or EditorInfo.IME_FLAG_NO_EXTRACT_UI
|
||||
setOnFocusChangeListener { _, focused ->
|
||||
if (focused) frontFocus?.last = FrontFocus.PRIMARY
|
||||
}
|
||||
setOnEditorActionListener { _, action, _ ->
|
||||
if (action == EditorInfo.IME_ACTION_SEARCH) {
|
||||
(context.getSystemService(InputMethodManager::class.java)).hideSoftInputFromWindow(windowToken, 0)
|
||||
clearFocus()
|
||||
true
|
||||
} else false
|
||||
}
|
||||
addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) = Unit
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
onQueryLatest.value(s?.toString().orEmpty())
|
||||
}
|
||||
override fun afterTextChanged(s: Editable?) = Unit
|
||||
})
|
||||
}
|
||||
},
|
||||
update = { field ->
|
||||
field.setTextColor(colors.onBackground.toArgb())
|
||||
field.setHintTextColor(colors.onSurfaceVariant.toArgb())
|
||||
if (field.text.toString() != query) {
|
||||
field.setText(query)
|
||||
field.setSelection(query.length)
|
||||
}
|
||||
},
|
||||
)
|
||||
if (query.isNotEmpty()) Text(
|
||||
"Clear", color = pal.signal, fontSize = 13.sp, fontWeight = FontWeight.SemiBold,
|
||||
modifier = Modifier.clickable { onQuery("") }.padding(4.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun SettingsCategoryCard(card: CategoryCard, modifier: Modifier, onClick: () -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val source = remember { MutableInteractionSource() }
|
||||
val focused = source.collectIsFocusedAsState().value
|
||||
val hovered = source.collectIsHoveredAsState().value
|
||||
val shape = RoundedCornerShape(14.dp)
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(6.dp),
|
||||
modifier = modifier.fillMaxSize().clip(shape)
|
||||
.background(if (focused || hovered) pal.signal.copy(alpha = 0.10f) else colors.surface)
|
||||
.glideBorder(focused, shape, pal.signal, pal.line)
|
||||
.hoverable(source)
|
||||
.clickable(interactionSource = source, indication = LocalIndication.current, role = Role.Button, onClick = onClick)
|
||||
.controllerConfirm(onClick = onClick)
|
||||
.padding(14.dp),
|
||||
) {
|
||||
Icon(card.icon, contentDescription = null, tint = if (focused || hovered) pal.signal else colors.onSurfaceVariant, modifier = Modifier.size(22.dp))
|
||||
Text(card.category.title, fontSize = 16.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 2, overflow = TextOverflow.Ellipsis)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun SettingsSearchResult(entry: SettingsEntry, modifier: Modifier = Modifier, onClick: () -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val source = remember { MutableInteractionSource() }
|
||||
val focused = source.collectIsFocusedAsState().value
|
||||
val hovered = source.collectIsHoveredAsState().value
|
||||
val shape = RoundedCornerShape(12.dp)
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = modifier.fillMaxWidth().clip(shape)
|
||||
.background(if (focused || hovered) pal.signal.copy(alpha = 0.10f) else colors.surface)
|
||||
.glideBorder(focused, shape, pal.signal, pal.line)
|
||||
.hoverable(source)
|
||||
.clickable(interactionSource = source, indication = LocalIndication.current, role = Role.Button, onClick = onClick)
|
||||
.controllerConfirm(onClick = onClick)
|
||||
.padding(horizontal = 14.dp, vertical = 11.dp),
|
||||
) {
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(entry.title, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground)
|
||||
}
|
||||
Spacer(Modifier.width(12.dp))
|
||||
Text(entry.category.title, fontSize = 12.sp, color = pal.signal, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import com.droiddeck.launcher.session.SessionService
|
||||
|
||||
internal val settingsSessionModes = listOf(
|
||||
SessionService.MODE_STEAM to "Steam",
|
||||
SessionService.MODE_DESKTOP to "Desktop",
|
||||
)
|
||||
|
||||
/** A specialist search returns to the category control that opens that specialist. */
|
||||
internal fun settingsCategoryTarget(target: String?): String? = when {
|
||||
target == "default-proton" || target == "editing-proton" -> "components"
|
||||
target?.startsWith("performance:") == true -> "performance"
|
||||
else -> target
|
||||
}
|
||||
|
||||
sealed interface SettingsDestination {
|
||||
val key: String
|
||||
|
||||
data class Category(
|
||||
val category: SettingsCategory,
|
||||
val mode: String = "steam",
|
||||
val target: String? = null,
|
||||
) : SettingsDestination {
|
||||
override val key = "settings:${category.name}:$mode:${target.orEmpty()}"
|
||||
}
|
||||
|
||||
data class Components(val tab: String? = null, val target: String? = null) : SettingsDestination {
|
||||
override val key = "components"
|
||||
}
|
||||
|
||||
data object Protons : SettingsDestination { override val key = "protons" }
|
||||
data class Performance(val target: String? = null) : SettingsDestination { override val key = "performance:${target.orEmpty()}" }
|
||||
data object Mapping : SettingsDestination { override val key = "controller-mapping" }
|
||||
}
|
||||
|
||||
data class SettingsHistory(val destinations: List<SettingsDestination> = emptyList()) {
|
||||
val current: SettingsDestination? get() = destinations.lastOrNull()
|
||||
|
||||
fun open(destination: SettingsDestination): SettingsHistory =
|
||||
if (destination == current) this else copy(destinations = destinations + destination)
|
||||
|
||||
fun replace(destination: SettingsDestination): SettingsHistory =
|
||||
copy(destinations = destinations.dropLast(1) + destination)
|
||||
|
||||
fun back(): SettingsHistory = copy(destinations = destinations.dropLast(1))
|
||||
}
|
||||
@@ -10,6 +10,10 @@ import androidx.compose.animation.core.MutableTransitionState
|
||||
import androidx.compose.animation.core.animateFloatAsState
|
||||
import androidx.compose.animation.core.animateDpAsState
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.focusGroup
|
||||
import androidx.compose.foundation.relocation.BringIntoViewRequester
|
||||
import androidx.compose.foundation.relocation.bringIntoViewRequester
|
||||
import androidx.compose.foundation.layout.offset
|
||||
import androidx.compose.ui.semantics.role
|
||||
import androidx.compose.ui.semantics.selected
|
||||
@@ -29,7 +33,6 @@ import androidx.compose.ui.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.stateDescription
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.foundation.Canvas
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
@@ -57,11 +60,12 @@ import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberUpdatedState
|
||||
import androidx.compose.runtime.staticCompositionLocalOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
@@ -84,10 +88,6 @@ import androidx.compose.ui.input.pointer.pointerInput
|
||||
import androidx.compose.ui.layout.onSizeChanged
|
||||
import androidx.compose.ui.semantics.ProgressBarRangeInfo
|
||||
import androidx.compose.ui.semantics.progressBarRangeInfo
|
||||
import androidx.compose.ui.semantics.setProgress
|
||||
import androidx.compose.ui.semantics.disabled
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.graphics.StrokeCap
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import kotlin.math.roundToInt
|
||||
import androidx.compose.ui.input.InputMode
|
||||
@@ -101,6 +101,7 @@ import androidx.compose.ui.unit.IntSize
|
||||
import androidx.compose.ui.unit.LayoutDirection
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.ui.window.Popup
|
||||
import androidx.compose.ui.window.PopupPositionProvider
|
||||
import androidx.compose.ui.window.PopupProperties
|
||||
@@ -208,6 +209,77 @@ private fun BumperKey(label: String, description: String, onClick: () -> Unit) {
|
||||
/** The narrowest a setting's value box gets; the session menu's sheet sets it lower. */
|
||||
val LocalChipMinWidth = androidx.compose.runtime.compositionLocalOf { 150.dp }
|
||||
|
||||
/** Search destination for settings. A target names a [SettingsAnchor] id; null leaves focus alone. */
|
||||
val LocalSettingsTarget = staticCompositionLocalOf<String?> { null }
|
||||
|
||||
/** Enables anchors only on searchable settings category pages. */
|
||||
val LocalSettingsAnchorsEnabled = staticCompositionLocalOf { false }
|
||||
internal val LocalSettingsAnchorId = staticCompositionLocalOf<String?> { null }
|
||||
|
||||
@Composable
|
||||
internal fun Modifier.settingsTarget(id: String): Modifier =
|
||||
if (LocalSettingsAnchorsEnabled.current) paneItem("setting:$id") else this
|
||||
|
||||
/** A non-stopping focus group that can reveal itself and request its first actionable child. */
|
||||
@Composable
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
fun SettingsAnchor(id: String, modifier: Modifier = Modifier.fillMaxWidth(), content: @Composable () -> Unit) {
|
||||
val target = LocalSettingsTarget.current
|
||||
val enabled = LocalSettingsAnchorsEnabled.current
|
||||
if (!enabled) {
|
||||
content()
|
||||
return
|
||||
}
|
||||
val bringIntoView = remember { BringIntoViewRequester() }
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
Column(
|
||||
modifier = modifier
|
||||
.bringIntoViewRequester(bringIntoView)
|
||||
.focusRequester(focusRequester)
|
||||
.focusGroup(),
|
||||
) {
|
||||
CompositionLocalProvider(LocalSettingsAnchorId provides id) { content() }
|
||||
}
|
||||
LaunchedEffect(target, id) {
|
||||
if (target == id) {
|
||||
androidx.compose.runtime.withFrameNanos { }
|
||||
runCatching { bringIntoView.bringIntoView() }
|
||||
androidx.compose.runtime.withFrameNanos { }
|
||||
runCatching { focusRequester.requestFocus() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** An optional group that starts closed; a settings search opens it so its destination can focus. */
|
||||
@Composable
|
||||
fun SettingsAdvanced(
|
||||
id: String,
|
||||
title: String,
|
||||
targets: Set<String> = emptySet(),
|
||||
content: @Composable ColumnScope.() -> Unit,
|
||||
) {
|
||||
val target = LocalSettingsTarget.current
|
||||
val expandsForTarget = target == id || target in targets
|
||||
var expanded by rememberSaveable(id, target) { mutableStateOf(expandsForTarget) }
|
||||
SettingsAnchor(id) {
|
||||
SettingsGroup(title) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.End,
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 14.dp, vertical = 5.dp),
|
||||
) {
|
||||
SecondaryButton(
|
||||
stringResource(if (expanded) R.string.common_hide else R.string.common_show),
|
||||
compact = true,
|
||||
modifier = Modifier.settingsTarget(id),
|
||||
onClick = { expanded = !expanded },
|
||||
)
|
||||
}
|
||||
if (expanded) content()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MenuHost {
|
||||
var open by mutableStateOf<String?>(null)
|
||||
}
|
||||
@@ -325,7 +397,9 @@ fun ValueChip(text: String, open: Boolean, enabled: Boolean = true, modifier: Mo
|
||||
val rot by animateFloatAsState(if (open) 180f else 0f, Motion.sp(0.6f), label = "chipCaret")
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween,
|
||||
modifier = modifier
|
||||
modifier = modifier.then(
|
||||
LocalSettingsAnchorId.current?.let { Modifier.settingsTarget(it) } ?: Modifier,
|
||||
)
|
||||
.widthIn(min = LocalChipMinWidth.current)
|
||||
.heightIn(min = 44.dp)
|
||||
.clip(RoundedCornerShape(10.dp))
|
||||
@@ -406,14 +480,19 @@ fun <T> ChoiceRow(
|
||||
onPick: (T) -> Unit,
|
||||
) {
|
||||
val open = host.open == key
|
||||
SettingsRow(label, hint, highlighted = open, hintLines = hintLines) {
|
||||
Box {
|
||||
ValueChip(options.firstOrNull { it.first == selected }?.second ?: "-", open, enabled, modifier = chipModifier) { host.open = if (open) null else key }
|
||||
AnchoredMenu(open, onDismiss = { if (host.open == key) host.open = null }, title = label, note = note) { firstItemFocus ->
|
||||
options.forEachIndexed { index, (value, text) ->
|
||||
MenuItem(text, checked = value == selected, focusRequester = if (index == 0) firstItemFocus else null) {
|
||||
onPick(value)
|
||||
host.open = null
|
||||
SettingsAnchor(key) {
|
||||
SettingsRow(label, hint, highlighted = open, hintLines = hintLines) {
|
||||
Box {
|
||||
ValueChip(
|
||||
options.firstOrNull { it.first == selected }?.second ?: "-", open, enabled,
|
||||
modifier = chipModifier,
|
||||
) { host.open = if (open) null else key }
|
||||
AnchoredMenu(open, onDismiss = { if (host.open == key) host.open = null }, title = label, note = note) { firstItemFocus ->
|
||||
options.forEachIndexed { index, (value, text) ->
|
||||
MenuItem(text, checked = value == selected, focusRequester = if (index == 0) firstItemFocus else null) {
|
||||
onPick(value)
|
||||
host.open = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,10 +501,13 @@ fun <T> ChoiceRow(
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ToggleRow(host: MenuHost, key: String, label: String, hint: String?, checked: Boolean, enabled: Boolean = true, chipModifier: Modifier = Modifier, onChange: (Boolean) -> Unit) =
|
||||
SettingsRow(label, hint) {
|
||||
ToggleSwitch(checked, enabled, label, chipModifier) { host.open = null; onChange(it) }
|
||||
fun ToggleRow(host: MenuHost, key: String, label: String, hint: String?, checked: Boolean, enabled: Boolean = true, chipModifier: Modifier = Modifier, onChange: (Boolean) -> Unit) {
|
||||
SettingsAnchor(key) {
|
||||
SettingsRow(label, hint) {
|
||||
ToggleSwitch(checked, enabled, label, chipModifier.settingsTarget(key)) { host.open = null; onChange(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** An on/off switch: one tap or one A press flips it, where a menu of On and Off took three. */
|
||||
@Composable
|
||||
@@ -474,16 +556,8 @@ fun ToggleSwitch(checked: Boolean, enabled: Boolean = true, label: String? = nul
|
||||
fun SliderRow(
|
||||
label: String, hint: String?, value: Int, range: IntRange, step: Int = 1, enabled: Boolean = true,
|
||||
format: (Int) -> String = { it.toString() }, modifier: Modifier = Modifier, onChange: (Int) -> Unit,
|
||||
) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
Column(Modifier.fillMaxWidth()) {
|
||||
ValueSlider(value, range, step, enabled, label, format,
|
||||
modifier = modifier.padding(horizontal = 6.dp, vertical = 3.dp), onChange = onChange)
|
||||
if (hint != null) Text(hint, fontSize = 12.5.sp, color = colors.onSurfaceVariant,
|
||||
modifier = Modifier.padding(start = 14.dp, end = 14.dp, bottom = 8.dp))
|
||||
Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
|
||||
}
|
||||
) = SettingsRow(label, hint) {
|
||||
ValueSlider(value, range, step, enabled, label, format, modifier, onChange)
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -493,39 +567,34 @@ fun ValueSlider(
|
||||
) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val source = remember { MutableInteractionSource() }
|
||||
val hot = source.collectIsFocusedAsState().value || source.collectIsHoveredAsState().value
|
||||
val currentOnChange by rememberUpdatedState(onChange)
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = src.collectIsFocusedAsState().value || src.collectIsHoveredAsState().value
|
||||
val span = (range.last - range.first).coerceAtLeast(1)
|
||||
val fraction = ((value - range.first).toFloat() / span).coerceIn(0f, 1f)
|
||||
val thumbInset = with(LocalDensity.current) { 8.dp.toPx() }
|
||||
val shape = RoundedCornerShape(99.dp)
|
||||
var trackPx by remember { mutableIntStateOf(0) }
|
||||
val text = format(value)
|
||||
val shape = RoundedCornerShape(8.dp)
|
||||
// Preserve off-grid preset values until the user adjusts; every input snaps to the same step.
|
||||
// A step from the d-pad lands on the grid of [step] from the range's start; a Look's own
|
||||
// value, which need not be on it, is kept until the user moves.
|
||||
fun stepped(v: Int) = (((v - range.first).toFloat() / step).roundToInt() * step + range.first).coerceIn(range.first, range.last)
|
||||
fun fromX(x: Float) {
|
||||
val width = trackPx - 2 * thumbInset
|
||||
if (width > 0) {
|
||||
val position = ((x - thumbInset) / width).coerceIn(0f, 1f)
|
||||
currentOnChange(stepped(range.first + (position * span).roundToInt()))
|
||||
}
|
||||
}
|
||||
Column(
|
||||
modifier = modifier.fillMaxWidth().heightIn(min = 72.dp)
|
||||
.clip(shape).background(if (hot) pal.signal.copy(alpha = 0.12f) else Color.Transparent)
|
||||
.glideBorder(hot, shape, pal.signal)
|
||||
fun fromX(x: Float) { if (trackPx > 0) onChange(stepped(range.first + (x / trackPx * span).roundToInt())) }
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = modifier
|
||||
.heightIn(min = 48.dp)
|
||||
.alpha(if (enabled) 1f else 0.5f)
|
||||
.hoverable(source).focusable(enabled, source)
|
||||
.hoverable(src)
|
||||
.focusable(enabled, src)
|
||||
.onPreviewKeyEvent { event ->
|
||||
val keyEvent = event.nativeKeyEvent
|
||||
val left = keyEvent.keyCode == KeyEvent.KEYCODE_DPAD_LEFT
|
||||
if (!left && keyEvent.keyCode != KeyEvent.KEYCODE_DPAD_RIGHT) false
|
||||
else {
|
||||
// Repeated key-down events let a held direction keep adjusting.
|
||||
if (!left && keyEvent.keyCode != KeyEvent.KEYCODE_DPAD_RIGHT) {
|
||||
false
|
||||
} else {
|
||||
// Every down counts, repeats included, so a held direction keeps stepping.
|
||||
if (enabled && keyEvent.action == KeyEvent.ACTION_DOWN) {
|
||||
val next = stepped(value + if (left) -step else step)
|
||||
if (next != value) currentOnChange(next)
|
||||
if (next != value) onChange(next)
|
||||
}
|
||||
true
|
||||
}
|
||||
@@ -534,33 +603,28 @@ fun ValueSlider(
|
||||
stateDescription = text
|
||||
progressBarRangeInfo = ProgressBarRangeInfo(value.toFloat(), range.first.toFloat()..range.last.toFloat())
|
||||
if (label != null) contentDescription = label
|
||||
if (!enabled) disabled()
|
||||
setProgress { next ->
|
||||
if (!enabled) false else { currentOnChange(stepped(next.roundToInt())); true }
|
||||
}
|
||||
}
|
||||
.padding(horizontal = 8.dp, vertical = 6.dp),
|
||||
},
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||
if (label != null) Text(label, fontSize = 15.sp, fontWeight = FontWeight.SemiBold,
|
||||
color = colors.onBackground, modifier = Modifier.weight(1f))
|
||||
else Spacer(Modifier.weight(1f))
|
||||
Text(text, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1)
|
||||
}
|
||||
Canvas(
|
||||
Modifier.fillMaxWidth().height(40.dp).onSizeChanged { trackPx = it.width }
|
||||
.pointerInput(enabled, range, step, thumbInset) { if (enabled) detectTapGestures { fromX(it.x) } }
|
||||
.pointerInput(enabled, range, step, thumbInset) {
|
||||
Text(text, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, textAlign = TextAlign.End,
|
||||
maxLines = 1, modifier = Modifier.width(56.dp))
|
||||
Spacer(Modifier.width(10.dp))
|
||||
Box(
|
||||
contentAlignment = Alignment.CenterStart,
|
||||
modifier = Modifier.size(width = 164.dp, height = 30.dp).clip(shape).background(colors.surfaceVariant)
|
||||
.glideBorder(hot, shape, colors.onBackground, pal.line2)
|
||||
.onSizeChanged { trackPx = it.width }
|
||||
.pointerInput(enabled, range, step) { if (enabled) detectTapGestures { fromX(it.x) } }
|
||||
.pointerInput(enabled, range, step) {
|
||||
if (enabled) detectHorizontalDragGestures { change, _ -> fromX(change.position.x); change.consume() }
|
||||
},
|
||||
) {
|
||||
val start = Offset(thumbInset, size.height / 2f)
|
||||
val end = Offset(size.width - thumbInset, start.y)
|
||||
val thumb = Offset(start.x + (end.x - start.x) * fraction, start.y)
|
||||
val fill = if (hot) pal.signal else colors.onBackground
|
||||
drawLine(colors.onSurfaceVariant.copy(alpha = 0.35f), start, end, strokeWidth = 4.dp.toPx(), cap = StrokeCap.Round)
|
||||
if (fraction > 0) drawLine(fill, start, thumb, strokeWidth = 4.dp.toPx(), cap = StrokeCap.Round)
|
||||
drawCircle(fill, radius = 7.dp.toPx(), center = thumb)
|
||||
Box(Modifier.fillMaxWidth(fraction).fillMaxHeight().background(pal.signal))
|
||||
Box(
|
||||
Modifier.padding(4.dp).size(22.dp)
|
||||
.graphicsLayer { translationX = fraction * (trackPx - 30.dp.toPx()).coerceAtLeast(0f) }
|
||||
.clip(CircleShape)
|
||||
.background(pal.onSignal),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -598,7 +662,7 @@ fun ActionRow(label: String, hint: String?, button: String, onClick: () -> Unit)
|
||||
@Composable
|
||||
fun SettingsPage(
|
||||
host: MenuHost,
|
||||
title: String?,
|
||||
title: String,
|
||||
onBack: () -> Unit,
|
||||
eyebrow: String? = null,
|
||||
lede: String? = null,
|
||||
@@ -608,9 +672,6 @@ fun SettingsPage(
|
||||
scroll: androidx.compose.foundation.ScrollState? = null,
|
||||
scrollContent: Boolean = true,
|
||||
compactLayout: Boolean = false,
|
||||
/** Fixed controls below the title, or beside Back when the title is omitted. */
|
||||
header: (@Composable () -> Unit)? = null,
|
||||
modifier: Modifier = Modifier,
|
||||
content: @Composable ColumnScope.() -> Unit,
|
||||
) {
|
||||
val scrollState = scroll ?: rememberScrollState()
|
||||
@@ -618,24 +679,13 @@ fun SettingsPage(
|
||||
val dim by animateFloatAsState(if (host.open != null) 0.6f else 1f, Motion.tw(220), label = "pageDim")
|
||||
val narrow = LocalNarrowPane.current && !compactLayout
|
||||
Column(
|
||||
modifier = modifier.fillMaxSize().padding(
|
||||
modifier = Modifier.fillMaxSize().padding(
|
||||
horizontal = if (compactLayout) 14.dp else if (narrow) 16.dp else 22.dp,
|
||||
vertical = if (compactLayout) 6.dp else if (narrow) 12.dp else 18.dp,
|
||||
),
|
||||
verticalArrangement = Arrangement.spacedBy(if (compactLayout) 2.dp else 0.dp),
|
||||
) {
|
||||
if (title == null) {
|
||||
Rise(0) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) {
|
||||
BackLink(stringResource(R.string.mode_back), compact = true, onClick = onBack)
|
||||
if (header != null) Box(Modifier.weight(1f)) { header() }
|
||||
}
|
||||
}
|
||||
} else if (narrow) {
|
||||
if (narrow) {
|
||||
// Back and the title share one line: a 4:3 screen has no height to spare.
|
||||
Rise(0) {
|
||||
Row(
|
||||
@@ -694,7 +744,6 @@ fun SettingsPage(
|
||||
}
|
||||
}
|
||||
}
|
||||
if (header != null && title != null) header()
|
||||
Rise(3, Modifier.weight(1f).fillMaxWidth()) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
|
||||
@@ -5,13 +5,9 @@ import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.staticCompositionLocalOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.luminance
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalConfiguration
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import com.droiddeck.launcher.core.AppUiPrefs
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
|
||||
class Palette(
|
||||
@@ -71,7 +67,7 @@ val LocalPalette = staticCompositionLocalOf { Themes.byId(Themes.GRAPHITE) }
|
||||
val Palette.onSignal: Color get() = if (signal.luminance() > 0.18f) Color(0xFF03111F) else Color.White
|
||||
|
||||
@Composable
|
||||
fun DroidDeckTheme(theme: String? = null, appScale: Int = AppUiPrefs.DEFAULT_SCALE, content: @Composable () -> Unit) {
|
||||
fun DroidDeckTheme(theme: String? = null, content: @Composable () -> Unit) {
|
||||
val id = theme ?: SessionPrefs.theme(LocalContext.current)
|
||||
val p = Themes.byId(id)
|
||||
val scheme = darkColorScheme(
|
||||
@@ -81,13 +77,5 @@ fun DroidDeckTheme(theme: String? = null, appScale: Int = AppUiPrefs.DEFAULT_SCA
|
||||
surfaceVariant = p.surfaceVariant, onSurfaceVariant = p.onSurfaceVariant,
|
||||
error = p.error,
|
||||
)
|
||||
val baseDensity = LocalDensity.current
|
||||
val baseConfiguration = LocalConfiguration.current
|
||||
val density = remember(baseDensity, appScale) { scaledAppDensity(baseDensity, appScale) }
|
||||
val configuration = remember(baseConfiguration, appScale) { scaledAppConfiguration(baseConfiguration, appScale) }
|
||||
CompositionLocalProvider(
|
||||
LocalPalette provides p,
|
||||
LocalDensity provides density,
|
||||
LocalConfiguration provides configuration,
|
||||
) { MaterialTheme(colorScheme = scheme, content = content) }
|
||||
CompositionLocalProvider(LocalPalette provides p) { MaterialTheme(colorScheme = scheme, content = content) }
|
||||
}
|
||||
@@ -178,7 +178,7 @@ fun WirelessAdbFixPage(
|
||||
step == 2 -> stringResource(R.string.wadb_title_done)
|
||||
else -> stringResource(R.string.wadb_title)
|
||||
},
|
||||
eyebrow = stringResource(R.string.setup_title),
|
||||
eyebrow = stringResource(R.string.settings_title),
|
||||
lede = when {
|
||||
compactSplit && step == 0 -> stringResource(R.string.wadb_lede_compact0)
|
||||
compactSplit && step == 1 -> stringResource(R.string.wadb_lede_compact1)
|
||||
|
||||
@@ -115,11 +115,6 @@ public final class WaylandCompositor {
|
||||
|
||||
public static void setPointerLockListener(PointerLockListener l) { pointerLockListener = l; }
|
||||
|
||||
/** Unhooks {@code l} only if it is still the listener, so a finishing activity never unhooks its successor's. */
|
||||
public static void clearPointerLockListener(PointerLockListener l) {
|
||||
if (pointerLockListener == l) pointerLockListener = null;
|
||||
}
|
||||
|
||||
/** Invoked from native (droiddeck_on_pointer_lock). */
|
||||
@SuppressWarnings("unused")
|
||||
static void onPointerLock(boolean locked, int x, int y) {
|
||||
@@ -505,11 +500,4 @@ public final class WaylandCompositor {
|
||||
if (dx == 0 && dy == 0) return;
|
||||
nativeSendSceneInput(6, dx * 256, dy * 256);
|
||||
}
|
||||
|
||||
/** As {@link #sendPointerDelta(int, int)}, keeping a captured mouse's fractions of a pixel. */
|
||||
public static void sendPointerDelta(float dx, float dy) {
|
||||
int x = Math.round(dx * 256f), y = Math.round(dy * 256f);
|
||||
if (x == 0 && y == 0) return;
|
||||
nativeSendSceneInput(6, x, y);
|
||||
}
|
||||
}
|
||||
@@ -1,952 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>Le premier lancement télécharge Steam. Cela peut prendre quelques minutes.</item>
|
||||
<item>Par défaut, quitter l\'application met Steam en pause ; y revenir reprend là où vous vous étiez arrêté.</item>
|
||||
<item>Votre manette apparaîtra comme une manette Xbox 360. Sinon, utilisez les commandes à l\'écran.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>Le premier lancement configure le bureau. Cela peut prendre quelques minutes.</item>
|
||||
<item>Par défaut, quitter l\'application met la session en pause ; y revenir reprend là où vous vous étiez arrêté.</item>
|
||||
<item>Le tactile fonctionne comme un pavé tactile : faites glisser pour déplacer le pointeur, tapotez pour cliquer.</item>
|
||||
<item>Votre manette apparaîtra comme une manette Xbox 360. Sinon, utilisez les commandes à l\'écran.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Session</string>
|
||||
<string name="session_channel_description">Affiché lorsqu\'une session Steam ou Bureau est ouverte</string>
|
||||
<string name="session_notification">Steam est en cours d\'exécution</string>
|
||||
<string name="session_notification_paused">Session en pause - Appuyez pour reprendre quand vous êtes prêt</string>
|
||||
<string name="resume_session">Reprendre</string>
|
||||
<string name="stop_session">Terminer cette session</string>
|
||||
<string name="frame_gen_title">Génération d\'images</string>
|
||||
<string name="frame_gen_hint">Sélectionnez le mode de génération d\'images à utiliser</string>
|
||||
<string name="frame_gen_off">Désactivé</string>
|
||||
<string name="frame_gen_winfg">Win-FG %1$d×</string>
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptatif %1$d</string>
|
||||
<string name="lsfg_needs_steam">Nécessite Lossless Scaling sur Steam</string>
|
||||
<string name="lsfg_needs_install">Installez Lossless Scaling sur Steam ou importez Lossless.dll</string>
|
||||
<string name="lsfg_import">Importer Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Utilise la version sur Steam</string>
|
||||
<string name="lsfg_using_import">Utilise la version importée</string>
|
||||
<string name="lsfg_pick_title">Sélectionner le fichier Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll importé</string>
|
||||
<string name="lsfg_import_unchanged">Ce Lossless.dll est déjà utilisé</string>
|
||||
<string name="lsfg_import_not_owned">Ce compte Steam ne possède pas Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Ce fichier n\'est pas le Lossless.dll de Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Impossible de préparer LSFG à partir de ce Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG nécessite Lossless Scaling depuis Steam, ou un fichier Lossless.dll importé</string>
|
||||
<string name="lsfg_problem_failed">LSFG ne peut pas préparer ses shaders à partir de ce Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s : non pris en charge</string>
|
||||
<string name="hud_fg_failed">%1$s : échec du moteur</string>
|
||||
<string name="hud_fg_needs_lossless">%1$s : nécessite Lossless Scaling</string>
|
||||
<string name="hud_fg_starting">%1$s %2$s · Démarrage en cours</string>
|
||||
<string name="added_games_import_hint">Un dossier contenant plusieurs sous-dossiers, chaque sous-dossier correspondant à un jeu Windows. Les jeux que vous possédez sur Steam utiliseront les entrées Steam correspondantes après le redémarrage de Steam ; les autres jeux deviendront des raccourcis non-Steam.</string>
|
||||
<string name="second_library_import_hint">Ajoutez une bibliothèque Steam et analysez-y les jeux Windows. Les jeux déjà possédés utiliseront les entrées Steam correspondantes, les autres deviendront des raccourcis non-Steam.</string>
|
||||
<string name="added_games_forget_hint">« Oublier » supprimera ces raccourcis lors de la prochaine session. Mais les fichiers resteront sur le disque.</string>
|
||||
<string name="game_env_title">Environnement de jeu</string>
|
||||
<string name="game_env_hint">Variables d\'environnement pour les jeux Proton.</string>
|
||||
<string name="game_env_edit">Modifier</string>
|
||||
<string name="game_env_shared">Tous les jeux Proton</string>
|
||||
<string name="game_env_scope">Profil</string>
|
||||
<string name="game_env_app_id">ID d\'application Steam</string>
|
||||
<string name="game_env_open">Ouvrir</string>
|
||||
<string name="game_env_profile">Jeu %1$s</string>
|
||||
<string name="game_env_add">Ajouter une variable</string>
|
||||
<string name="game_env_name">Nom de la variable</string>
|
||||
<string name="game_env_value">Valeur</string>
|
||||
<string name="game_env_save">Enregistrer</string>
|
||||
<string name="game_env_remove">Supprimer</string>
|
||||
<string name="game_env_restore">Rétablir l\'héritage</string>
|
||||
<string name="game_env_reset">Réinitialiser ce profil</string>
|
||||
<string name="game_env_unset">Annuler la définition pour ce profil</string>
|
||||
<string name="game_env_empty">Aucune variable définie.</string>
|
||||
<string name="game_env_inherited">Hérité</string>
|
||||
<string name="game_env_custom">Variable personnalisée</string>
|
||||
<string name="game_env_error">Impossible de charger ou d\'enregistrer. Vérifiez l\'espace de stockage restant et réessayez.</string>
|
||||
<string name="game_env_invalid">Veuillez saisir un nom et une valeur valides, jusqu\'à 8192 caractères.</string>
|
||||
<string name="game_env_unused">L\'environnement d\'exécution Proton standard ne lit pas cette variable.</string>
|
||||
<string name="game_env_loading">Chargement…</string>
|
||||
<string name="game_env_feature">Remplacement du niveau de fonctionnalité D3D12. 12_2 signalera les capacités DirectX 12 Ultimate ; les fonctionnalités non prises en charge peuvent entraîner un échec. Laissez vide pour la détection automatique.</string>
|
||||
<string name="game_env_shader">Remplacement du modèle de shader D3D12. 6_9 nécessite un VKD3D suffisamment récent et des fonctionnalités GPU correspondantes. Laissez vide pour la détection automatique.</string>
|
||||
<string name="game_env_cache">Maintient le cache de shaders Mesa activé pour réduire les recompilations. Définir sur false pour l\'activer.</string>
|
||||
<string name="game_env_cache_size">Taille maximale du cache de shaders Mesa, par exemple 1G. Un cache plus grand occupe plus d\'espace de stockage.</string>
|
||||
<string name="game_env_vkd3d_config">Options VKD3D pour D3D12. nodxr désactive le ray tracing ; à utiliser uniquement si le jeu le nécessite.</string>
|
||||
<string name="game_env_proton_log">Définir sur 1 pour générer un journal de diagnostic Proton. La journalisation peut réduire les performances et consommer de l\'espace de stockage.</string>
|
||||
<string name="game_env_wined3d">Définir sur 1 pour utiliser WineD3D (basé sur OpenGL) au lieu de DXVK, pour tester la compatibilité D3D9–11.</string>
|
||||
<string name="game_env_xalia">Définir sur 0 pour désactiver l\'assistant de navigation à la manette de Proton pour ce jeu.</string>
|
||||
<string name="game_env_hud">Superposition DXVK pour D3D9–11. fps affiche le taux de rafraîchissement ; annuler la définition masque la superposition.</string>
|
||||
<string name="game_env_dxvk_config">Paramètres DXVK séparés par des points-virgules. Les versions récentes utilisent dxvk.maxFrameRate pour limiter le taux de rafraîchissement ; pour un jeu quotidien, il est recommandé d\'utiliser le limiteur de taux de rafraîchissement de session.</string>
|
||||
<string name="game_env_vkd3d_limit">Limite de taux de rafraîchissement D3D12. 0 désactive la limite.</string>
|
||||
<string name="game_env_glthread">Mesa OpenGL multithread. Pour les jeux OpenGL limités par le CPU, true peut aider ; à tester jeu par jeu.</string>
|
||||
<string name="fex_preset_title">Préréglages FEX</string>
|
||||
<string name="fex_next_launch">Prendra effet au prochain lancement du jeu.</string>
|
||||
<string name="game_settings_title">Jeu</string>
|
||||
<string name="fex_default_label">FEX par défaut</string>
|
||||
<string name="fex_default_detail">Utiliser les paramètres par défaut de FEX.</string>
|
||||
<string name="fex_stability_label">Stabilité</string>
|
||||
<string name="fex_stability_detail">Paramètres les plus sûrs, les plus lents.</string>
|
||||
<string name="fex_compatibility_label">Compatibilité</string>
|
||||
<string name="fex_compatibility_detail">TSO complet + multiblock.</string>
|
||||
<string name="fex_intermediate_label">Intermédiaire</string>
|
||||
<string name="fex_intermediate_detail">Paramètres TSO équilibrés, avec une précision x87 réduite.</string>
|
||||
<string name="fex_performance_label">Performance</string>
|
||||
<string name="fex_performance_detail">Désactive tous les TSO ; active le multiblock.</string>
|
||||
<string name="fex_performance_tso_label">Performance + TSO</string>
|
||||
<string name="fex_performance_tso_detail">Paramètres de performance, avec TSO principal activé.</string>
|
||||
<string name="fex_extreme_label">Extrême</string>
|
||||
<string name="fex_extreme_detail">Désactive la vérification du code auto-modifiant. Les jeux JIT et les DRM peuvent ne pas fonctionner.</string>
|
||||
<string name="fex_extreme_tso_label">Extrême + TSO</string>
|
||||
<string name="fex_extreme_tso_detail">Paramètres extrêmes, avec TSO principal activé.</string>
|
||||
<string name="fex_extreme_gn_label">Extrême-gn</string>
|
||||
<string name="fex_extreme_gn_detail">Paramètres de performance, active TSC et les astuces de métadonnées. Il est recommandé d\'essayer d\'abord ce mode avant « Extrême ».</string>
|
||||
<string name="fex_denuvo_label">Denuvo</string>
|
||||
<string name="fex_denuvo_detail">Paramètres de performance, active la vérification complète du code et masque les bits de l\'hyperviseur.</string>
|
||||
<string name="game_env_custom_value">Valeur personnalisée</string>
|
||||
<string name="game_env_select_value">Sélectionner une valeur</string>
|
||||
<string name="user_apps_section">Émulateurs et applications</string>
|
||||
<string name="user_apps_add">Ajouter</string>
|
||||
<string name="user_apps_add_detail">Votre propre application ou jeu</string>
|
||||
<string name="user_apps_kind_script">Script</string>
|
||||
<string name="user_apps_kind_appimage">AppImage</string>
|
||||
<string name="user_apps_kind_flatpak">Flatpak</string>
|
||||
<string name="user_apps_progress">%1$s · %2$s</string>
|
||||
<string name="user_apps_progress_percent">%1$s · %2$s · %3$d%%</string>
|
||||
<string name="user_apps_starting">Démarrage…</string>
|
||||
<string name="user_apps_added">%1$s ajouté</string>
|
||||
<string name="user_apps_removed">%1$s supprimé</string>
|
||||
<string name="user_apps_back">Bureau</string>
|
||||
<string name="user_apps_gone">Cette application n\'existe plus. Veuillez la resélectionner depuis le bureau.</string>
|
||||
<string name="user_apps_open">Ouvrir %1$s</string>
|
||||
<string name="user_apps_remove">Supprimer</string>
|
||||
<string name="user_apps_remove_confirm">Appuyez à nouveau pour supprimer</string>
|
||||
<string name="user_apps_stop_session">Veuillez d\'abord terminer la session avant de supprimer</string>
|
||||
<string name="user_apps_script_linked">Exécute %1$s depuis son dossier et lie ce dossier à la session. La suppression de l\'application n\'affectera pas ce dossier.</string>
|
||||
<string name="user_apps_script_copied">Exécute %1$s depuis un dossier copié à l\'intérieur de DroidDeck. La suppression de l\'application supprimera la copie, mais pas le fichier d\'origine.</string>
|
||||
<string name="user_apps_runtime_required">Veuillez d\'abord installer l\'environnement d\'exécution Linux</string>
|
||||
<string name="user_apps_file_gone">Le fichier n\'existe plus</string>
|
||||
<string name="user_apps_no_space">Espace disponible insuffisant : %1$s est nécessaire pour copier ce dossier</string>
|
||||
<string name="user_apps_copying">Copie de %1$s en cours</string>
|
||||
<string name="user_apps_failed">Échec de l\'ajout de l\'application</string>
|
||||
<string name="user_apps_github_checking">Recherche des versions de %1$s</string>
|
||||
<string name="user_apps_github_unreachable">Impossible de lire les versions de %1$s</string>
|
||||
<string name="user_apps_github_no_appimage">%1$s ne fournit pas de version ARM64 AppImage</string>
|
||||
<string name="user_apps_downloading">Téléchargement de %1$s en cours</string>
|
||||
<string name="user_apps_download_failed">Échec du téléchargement</string>
|
||||
<string name="user_apps_update_failed">Échec de la mise à jour de l\'application</string>
|
||||
<string name="user_apps_icon_failed">Impossible de lire cette icône</string>
|
||||
<string name="user_apps_saved">%1$s enregistré</string>
|
||||
<string name="user_apps_edit">Modifier</string>
|
||||
<string name="user_apps_check_updates">Vérifier les mises à jour</string>
|
||||
<string name="user_apps_checking_updates">Vérification des mises à jour…</string>
|
||||
<string name="user_apps_update_to">Mettre à jour vers %1$s</string>
|
||||
<string name="user_apps_up_to_date">À jour · %1$s</string>
|
||||
<string name="user_apps_updated">%1$s mis à jour</string>
|
||||
<string name="user_apps_github_version">%1$s · %2$s</string>
|
||||
<string name="add_app_title">Ajouter une application</string>
|
||||
<string name="add_app_tab_script">Script</string>
|
||||
<string name="add_app_tab_appimage">AppImage</string>
|
||||
<string name="add_app_tab_github">GitHub</string>
|
||||
<string name="add_app_tab_flatpak">Flatpak</string>
|
||||
<string name="add_app_script_hint">Un fichier .sh. Il s\'exécutera depuis son propre dossier et s\'affichera en plein écran via gamescope.</string>
|
||||
<string name="add_app_appimage_hint">Un AppImage ARM64 (aarch64). Il sera décompressé dans l\'environnement d\'exécution Linux lors de la première utilisation.</string>
|
||||
<string name="add_app_github_hint">Installer l\'AppImage ARM64 depuis la dernière version du dépôt.</string>
|
||||
<string name="add_app_flatpak_hint">ID d\'application Flathub ou sa page Flathub. Si Flatpak n\'est pas encore configuré, il le sera d\'abord.</string>
|
||||
<string name="add_app_file">Fichier</string>
|
||||
<string name="add_app_no_file">Aucun fichier sélectionné</string>
|
||||
<string name="add_app_choose_file">Choisir un fichier</string>
|
||||
<string name="add_app_change_file">Modifier</string>
|
||||
<string name="add_app_pick_script">Sélectionner le script</string>
|
||||
<string name="add_app_pick_appimage">Sélectionner l\'AppImage</string>
|
||||
<string name="add_app_pick_icon">Sélectionner l\'icône</string>
|
||||
<string name="add_app_repository">Dépôt</string>
|
||||
<string name="add_app_repository_placeholder">owner/repo ou lien github.com</string>
|
||||
<string name="add_app_repository_invalid">N\'est pas un dépôt GitHub</string>
|
||||
<string name="add_app_flatpak_id">ID d\'application</string>
|
||||
<string name="add_app_flatpak_placeholder">org.ppsspp.PPSSPP</string>
|
||||
<string name="add_app_flatpak_invalid">N\'est pas un ID d\'application Flathub valide</string>
|
||||
<string name="add_app_source">Source</string>
|
||||
<string name="add_app_appearance">Afficher sur le bureau</string>
|
||||
<string name="add_app_preview_name">Nouvelle application</string>
|
||||
<string name="add_app_name">Nom</string>
|
||||
<string name="add_app_name_placeholder">Depuis l\'application</string>
|
||||
<string name="add_app_icon">Icône</string>
|
||||
<string name="add_app_icon_default">Icône par défaut</string>
|
||||
<string name="add_app_choose_icon">Choisir une icône</string>
|
||||
<string name="add_app_clear_icon">Effacer</string>
|
||||
<string name="add_app_icon_suggestions">Depuis le dépôt</string>
|
||||
<string name="add_app_icon_searching">Recherche d\'icônes…</string>
|
||||
<string name="add_app_icon_reset">Par défaut</string>
|
||||
<string name="edit_app_title">Modifier %1$s</string>
|
||||
<string name="edit_app_save">Enregistrer</string>
|
||||
<string name="add_app_checking_folder">Vérification du dossier…</string>
|
||||
<string name="add_app_folder_linked">Son dossier est lié à la session : %1$s</string>
|
||||
<string name="add_app_folder_copied">Ce dossier contient des programmes Linux qui ne peuvent pas s\'exécuter depuis le stockage partagé. Il sera donc copié dans DroidDeck (%1$s).</string>
|
||||
<string name="add_app_confirm">Ajouter</string>
|
||||
<string name="add_app_cancel">Annuler</string>
|
||||
<string name="add_app_runtime_required">Veuillez d\'abord installer l\'environnement d\'exécution Linux depuis les « Paramètres ».</string>
|
||||
<string name="add_app_busy">Veuillez attendre que %1$s soit terminé.</string>
|
||||
<string name="common_cancel">Annuler</string>
|
||||
<string name="common_auto">Auto</string>
|
||||
<string name="common_never">Jamais</string>
|
||||
<string name="common_always">Toujours</string>
|
||||
<string name="common_uninstall">Désinstaller</string>
|
||||
<string name="common_check">Vérifier</string>
|
||||
<string name="common_update">Mettre à jour</string>
|
||||
<string name="common_checking">Vérification…</string>
|
||||
<string name="common_working">Traitement en cours…</string>
|
||||
<string name="common_forget">Oublier</string>
|
||||
<string name="common_add_ellipsis">Ajouter…</string>
|
||||
<string name="common_use">Utiliser</string>
|
||||
<string name="common_applies_next_session">Prendra effet à la prochaine session.</string>
|
||||
<string name="mode_steam_title">Session Steam</string>
|
||||
<string name="mode_desktop_title">Session Bureau</string>
|
||||
<string name="mode_display">Affichage</string>
|
||||
<string name="mode_resolution">Résolution</string>
|
||||
<string name="mode_res_720">Max 720p</string>
|
||||
<string name="mode_res_900">Max 900p</string>
|
||||
<string name="mode_res_1080">Max 1080p</string>
|
||||
<string name="mode_res_native">Native</string>
|
||||
<string name="mode_res_default">%1$s (par défaut)</string>
|
||||
<string name="mode_res_custom_value">Personnalisée · %1$d×%2$d</string>
|
||||
<string name="mode_res_custom">Personnalisée…</string>
|
||||
<string name="mode_res_note">720p peut rendre les menus plus réactifs.</string>
|
||||
<string name="mode_ratio">Format d\'écran</string>
|
||||
<string name="mode_ratio_custom">Défini par la résolution personnalisée.</string>
|
||||
<string name="mode_ratio_auto">Le mode automatique utilise au moins 16:9.</string>
|
||||
<string name="mode_fps">Limite de taux de rafraîchissement</string>
|
||||
<string name="mode_fps_note">Limite le taux de rafraîchissement de toute la session. Le moniteur basculera vers un taux de rafraîchissement divisible par cette limite.</string>
|
||||
<string name="mode_hdr">HDR</string>
|
||||
<string name="mode_hdr10">Sortie HDR10</string>
|
||||
<string name="mode_hdr_unavailable">Non disponible : %1$s.</string>
|
||||
<string name="mode_hdr_restart">Prendra effet après le redémarrage de l\'application.</string>
|
||||
<string name="mode_drivers">Pilotes</string>
|
||||
<string name="mode_gpu_drivers">Pilotes GPU</string>
|
||||
<string name="mode_gpu_drivers_hint">Partagés entre Steam et le bureau. À configurer dans la page « Composants ».</string>
|
||||
<string name="mode_touch_controls">Tactile et contrôles</string>
|
||||
<string name="mode_touch">Tactile</string>
|
||||
<string name="mode_touch_touchpad">Pavé tactile</string>
|
||||
<string name="mode_touch_direct">Direct</string>
|
||||
<string name="mode_touch_note">Auto : pavé tactile pour le bureau, tactile direct pour Steam.</string>
|
||||
<string name="mode_osc">Commandes à l\'écran</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Le mode automatique affiche les commandes à l\'écran lorsqu\'aucune manette n\'est connectée.</string>
|
||||
<string name="mode_controller">Manette</string>
|
||||
<string name="mode_controller_hint">Comment Steam reconnaît votre manette. Prendra effet à la prochaine session.</string>
|
||||
<string name="mode_controller_deck">Manette Steam Deck</string>
|
||||
<string name="mode_controller_x360">Manette Xbox 360</string>
|
||||
<string name="mode_controller_note">Deck : fournit un bouton d\'accès rapide et un gyroscope. Xbox 360 : utilisez Guide+A pour ouvrir l\'accès rapide.</string>
|
||||
<string name="mode_back">Retour</string>
|
||||
<string name="mode_session">Session</string>
|
||||
<string name="mode_suspend">Comportement en arrière-plan</string>
|
||||
<string name="mode_suspend_hint">Comportement lorsque l\'application est masquée ou que l\'écran est éteint.</string>
|
||||
<string name="mode_suspend_manual">Manuel</string>
|
||||
<string name="mode_suspend_note">Le mode automatique met en pause en arrière-plan et reprend à l\'affichage. Le mode manuel nécessite d\'appuyer sur « Reprendre ». Ne reste jamais en cours d\'exécution.</string>
|
||||
<string name="mode_startup">Démarrage</string>
|
||||
<string name="mode_steam_startup">Lancer Steam à l\'ouverture de DroidDeck</string>
|
||||
<string name="mode_steam_startup_hint">Ouvre une session Steam au démarrage de DroidDeck.</string>
|
||||
<string name="mode_decky">Decky</string>
|
||||
<string name="mode_decky_checking">Vérification des versions…</string>
|
||||
<string name="mode_decky_ready">Prêt à installer %1$s.</string>
|
||||
<string name="mode_decky_none">Aucune version compatible trouvée. Veuillez réessayer plus tard.</string>
|
||||
<string name="mode_decky_installed">Installé · %1$s</string>
|
||||
<string name="mode_decky_update">Mise à jour disponible · %1$s</string>
|
||||
<string name="mode_decky_current">À jour · %1$s</string>
|
||||
<string name="mode_decky_loader">Chargeur</string>
|
||||
<string name="mode_decky_install_latest">Installer la dernière version</string>
|
||||
<string name="mode_decky_on">Démarre avec Steam. Une fois activé, d\'autres applications sur cet appareil peuvent contrôler Steam.</string>
|
||||
<string name="mode_decky_off">Désactivé. Le port de débogage distant de Steam reste fermé.</string>
|
||||
<string name="mode_decky_remove_title">Désinstaller Decky Loader ?</string>
|
||||
<string name="mode_decky_remove_text">Supprime le chargeur. Vos plugins et paramètres seront conservés.</string>
|
||||
<string name="mode_client">Client</string>
|
||||
<string name="mode_deck_mode">Mode Steam Deck</string>
|
||||
<string name="mode_deck_mode_hint">Interface Steam Deck et contrôles de performance à accès rapide. Prendra effet à la prochaine session.</string>
|
||||
<string name="mode_mangoapp">Superposition de performance</string>
|
||||
<string name="mode_mangoapp_hint">Désactivez cette option si les jeux plantent ou affichent un écran noir en mode Deck. Prendra effet à la prochaine session.</string>
|
||||
<string name="mode_branch">Branche du client</string>
|
||||
<string name="mode_branch_deck">Bêta Steam Deck (requis pour le mode Deck).</string>
|
||||
<string name="mode_branch_hint">Prendra effet à la prochaine session. Steam peut se mettre à jour une fois de lui-même.</string>
|
||||
<string name="mode_branch_public">Bêta</string>
|
||||
<string name="mode_branch_deck_beta">Bêta Steam Deck</string>
|
||||
<string name="mode_branch_note">Le mode Deck utilise toujours la version bêta de Steam Deck.</string>
|
||||
<string name="mode_added_games">Jeux ajoutés</string>
|
||||
<string name="mode_added_none">Aucun dossier de jeu contenant un .exe trouvé</string>
|
||||
<string name="mode_games_folder">Dossier de jeux</string>
|
||||
<string name="mode_games_folder_another">Autre dossier de jeux</string>
|
||||
<string name="mode_added_art">Images depuis Steam</string>
|
||||
<string name="mode_added_art_hint">Complète les images manquantes selon le nom du dossier. Les fichiers cover.jpg, hero.jpg, logo.png ou icon.png dans le dossier du jeu sont prioritaires.</string>
|
||||
<string name="mode_added_launches">Lancer %1$s</string>
|
||||
<string name="mode_added_launches_in">Lancer %1$s · dans %2$s</string>
|
||||
<string name="mode_added_choose">Choisir un autre fichier…</string>
|
||||
<string name="mode_added_exe_note">Utilise par défaut le .exe portant le même nom que le dossier, sinon le .exe le plus volumineux.</string>
|
||||
<string name="mode_fill">Étirer le jeu pour remplir l\'écran</string>
|
||||
<string name="mode_fill_hint">Maintient en plein écran les jeux capables de se redimensionner. Désactivez cette option si le jeu s\'affiche en petit. Prendra effet à la prochaine session.</string>
|
||||
<string name="mode_stretch169">Étirer les jeux 16:9</string>
|
||||
<string name="mode_stretch169_hint">Sur les écrans dont le rapport d\'aspect est inférieur à 16:9, étire le jeu pour remplir l\'écran au lieu d\'afficher des bandes noires. Prendra effet à la prochaine session.</string>
|
||||
<string name="mode_audio">Audio</string>
|
||||
<string name="mode_directaudio">Utiliser DirectAudio pour le jeu</string>
|
||||
<string name="mode_directaudio_hint">Contourne PulseAudio pour réduire la latence.</string>
|
||||
<string name="mode_client_audio">Audio du client Steam</string>
|
||||
<string name="mode_client_audio_hint">Prendra effet à la prochaine session.</string>
|
||||
<string name="mode_client_audio_classic">Classique</string>
|
||||
<string name="mode_client_audio_direct">DirectAudio</string>
|
||||
<string name="mode_mic">Microphone</string>
|
||||
<string name="mode_mic_hint">Utilisé pour le chat vocal.</string>
|
||||
<string name="mode_network">Réseau</string>
|
||||
<string name="mode_wifi_discovery">Découverte Wi-Fi</string>
|
||||
<string name="mode_wifi_discovery_hint">Affiche les noms Wi-Fi et les réseaux à proximité dans Steam.</string>
|
||||
<string name="mode_wifi_location_off">Les services de localisation sont désactivés.</string>
|
||||
<string name="mode_wifi_permission_denied">L\'autorisation de localisation n\'a pas été accordée.</string>
|
||||
<string name="mode_wifi_open_settings">Ouvrir les paramètres</string>
|
||||
<string name="mode_wifi_continue">Continuer</string>
|
||||
<string name="mode_wifi_explain_title">Activer la découverte Wi-Fi ?</string>
|
||||
<string name="mode_wifi_explain_text">Android a besoin de l\'autorisation de localisation pour lire les noms Wi-Fi et découvrir les réseaux à proximité. DroidDeck utilise cette autorisation pour afficher ces réseaux dans Steam. Nous ne suivons pas votre position. L\'accès à Internet reste possible sans cette autorisation.</string>
|
||||
<string name="mode_storage">Stockage des jeux</string>
|
||||
<string name="mode_storage_auto">Auto - Utiliser la carte SD si disponible</string>
|
||||
<string name="mode_storage_auto_none">Auto - Utiliser la carte SD si disponible (aucune carte SD actuellement)</string>
|
||||
<string name="mode_storage_internal">Stockage interne uniquement</string>
|
||||
<string name="mode_storage_folder">Dossier : %1$s</string>
|
||||
<string name="mode_second_library">Bibliothèque secondaire</string>
|
||||
<string name="mode_storage_note">Les jeux lisant des ressources depuis une carte SD ou un stockage partagé peuvent saccader.</string>
|
||||
<string name="mode_choose_folder">Choisir un dossier…</string>
|
||||
<string name="mode_renderer">Rendu</string>
|
||||
<string name="mode_desktop_renderer">Moteur de rendu du bureau</string>
|
||||
<string name="mode_renderer_hint">Responsable du dessin du bureau.</string>
|
||||
<string name="mode_renderer_vulkan">vulkan - GPU</string>
|
||||
<string name="mode_renderer_gles2">gles2 - GPU (expérimental)</string>
|
||||
<string name="mode_renderer_pixman">pixman - Logiciel</string>
|
||||
<string name="mode_renderer_note">Vulkan utilise le GPU pour exécuter les programmes de bureau, et bascule vers pixman en cas d\'échec. Avec pixman, les jeux s\'exécutent toujours en plein écran sur le GPU.</string>
|
||||
<string name="mode_custom_res_title">Résolution personnalisée</string>
|
||||
<string name="mode_custom_res_text">Remplace la limite de résolution et le format d\'écran. Les dimensions ne correspondant pas à l\'écran afficheront des bandes noires.</string>
|
||||
<string name="mode_width">Largeur</string>
|
||||
<string name="mode_height">Hauteur</string>
|
||||
<string name="mode_custom_res_range">Plage : 320×240 à 3840×2160.</string>
|
||||
<plurals name="mode_added_count">
|
||||
<item quantity="one">%1$d jeu</item>
|
||||
<item quantity="other">%1$d jeux</item>
|
||||
</plurals>
|
||||
<string name="common_ok">OK</string>
|
||||
<string name="common_delete">Supprimer</string>
|
||||
<string name="common_restore">Restaurer</string>
|
||||
<string name="common_download">Télécharger</string>
|
||||
<string name="common_delete_named">Supprimer %1$s</string>
|
||||
<string name="common_size_mb">%1$.1f Mo</string>
|
||||
<string name="comp_runtime_driver">Pilote d\'environnement d\'exécution</string>
|
||||
<string name="comp_runtime_driver_hint">Utilisé par Steam, les jeux et le bureau. Prendra effet à la prochaine session.</string>
|
||||
<string name="comp_import_turnip">Importer Turnip zip…</string>
|
||||
<string name="comp_display_driver">Pilote d\'affichage</string>
|
||||
<string name="comp_display_driver_hint">Responsable de la sortie vidéo vers l\'écran dans les deux modes. Prendra effet après le redémarrage de l\'application.</string>
|
||||
<string name="comp_import_adrenotools">Importer AdrenoTools zip…</string>
|
||||
<string name="comp_never">Jamais</string>
|
||||
<string name="comp_nightlies_checked">Nightlies vérifié le %1$s</string>
|
||||
<string name="comp_title">Composants</string>
|
||||
<string name="comp_about">À propos des composants</string>
|
||||
<string name="comp_check_drivers">Vérifier les nouveaux pilotes</string>
|
||||
<string name="comp_check_nightlies">Vérifier les nouveaux paquets dans Nightlies</string>
|
||||
<string name="comp_proton">Proton</string>
|
||||
<string name="comp_proton_note">Les mises à jour de Steam remplacent le Proton de Valve ; les fichiers originaux de chaque version sont conservés.</string>
|
||||
<string name="comp_swapped">%1$s · %2$d remplacé(s)</string>
|
||||
<string name="comp_all_original">%1$s · Tout est original</string>
|
||||
<string name="comp_game_running_suffix">%1$s · Jeu en cours d\'exécution</string>
|
||||
<string name="comp_gpu_drivers">Pilotes GPU</string>
|
||||
<string name="comp_reapplied">%1$s · Réappliqué au lancement de %2$s</string>
|
||||
<string name="comp_next_queued">Suivant : %1$s · Après la fermeture du jeu</string>
|
||||
<string name="comp_in_use">%1$s en cours d\'utilisation : %2$s</string>
|
||||
<string name="comp_waits">En attente de la fermeture du jeu</string>
|
||||
<string name="comp_applies_next_game">Prendra effet au prochain lancement du jeu</string>
|
||||
<string name="comp_import_zip">Importer .zip</string>
|
||||
<string name="comp_reading">Lecture de Proton…</string>
|
||||
<string name="comp_no_proton">Proton n\'est pas encore installé. Lancez Steam une fois pour télécharger son Proton ARM64, ou ajoutez GE-Proton ou CachyOS depuis les « Paramètres ».</string>
|
||||
<string name="comp_original">Original · %1$s</string>
|
||||
<string name="comp_this_build">%1$s · Version actuelle</string>
|
||||
<string name="comp_earlier_build">%1$s · Version antérieure</string>
|
||||
<string name="comp_installed_count">Installé · %1$d</string>
|
||||
<string name="comp_nothing_stored">Rien n\'a encore été enregistré pour %1$s. Les fichiers fournis avec ce Proton seront enregistrés comme fichiers originaux.</string>
|
||||
<string name="comp_waits_long">Un jeu utilise actuellement ce Proton, il faut donc attendre sa fermeture.</string>
|
||||
<string name="comp_applies_long">Prendra effet au prochain lancement du jeu.</string>
|
||||
<string name="comp_swap_title">Remplacer %1$s ?</string>
|
||||
<string name="comp_swap_body">Placer %1$s dans %2$s ? Ses fichiers originaux continueront d\'être conservés. %3$s</string>
|
||||
<string name="comp_restore_title">Restaurer %1$s ?</string>
|
||||
<string name="comp_restore_body">Remettre les fichiers originaux de %1$s dans %2$s ? %3$s</string>
|
||||
<string name="comp_delete_package_body">Supprime ce paquet de l\'application. Il pourra être téléchargé à nouveau ultérieurement.</string>
|
||||
<string name="comp_delete_original_title">Supprimer cette version originale ?</string>
|
||||
<string name="comp_delete_original_body">Cette version originale de %1$s provient d\'une version antérieure de %2$s. La version originale de la version actuelle sera toujours conservée.</string>
|
||||
<string name="comp_nightlies_count">Dans Nightlies · %1$d</string>
|
||||
<string name="comp_refresh_to_list">Actualiser pour lister les paquets dans Nightlies.</string>
|
||||
<string name="comp_nothing_new">Aucun nouvel élément depuis la dernière vérification.</string>
|
||||
<string name="comp_import_wcp">Importer .wcp</string>
|
||||
<string name="comp_restore_original">Restaurer les fichiers originaux de ce Proton</string>
|
||||
<string name="comp_restore_original_body">Remettre les fichiers originaux %2$s de %1$s ?</string>
|
||||
<string name="comp_swap">Basculer</string>
|
||||
<string name="comp_about_text">FEX, DXVK et VKD3D-Proton : pour chaque Proton utilisé par Steam pour exécuter des jeux.\n\nSélectionnez un élément installé pour le remplacer. Cela prendra effet au prochain lancement du jeu, ou après la fermeture du jeu en cours d\'exécution.\n\nVotre sélection sera revérifiée avant chaque lancement ; si elle a été modifiée, elle sera restaurée. Les fichiers originaux de chaque Proton sont conservés, ils ne seront donc jamais perdus lors des mises à jour de Steam.</string>
|
||||
<string name="comp_tag_original">Original</string>
|
||||
<string name="comp_tag_in_use">Utilisé</string>
|
||||
<string name="comp_tag_new">Nouveau</string>
|
||||
<string name="comp_tag_stored">Enregistré</string>
|
||||
<string name="perf_title">Performance</string>
|
||||
<string name="perf_lede">Cœurs CPU, correctifs de session et nom d\'hôte. Prendra effet à la prochaine session.</string>
|
||||
<string name="perf_client_cores_group">Cœurs du client Steam</string>
|
||||
<string name="perf_override">Remplacer la sélection des cœurs de Steam</string>
|
||||
<string name="perf_override_hint">Fixe Steam, l\'assistant d\'interface et gamescope sur les cœurs sélectionnés ci-dessous.</string>
|
||||
<string name="perf_client_cores">Cœurs du client</string>
|
||||
<string name="perf_client_cores_on">Cœurs utilisés par Steam.</string>
|
||||
<string name="perf_client_cores_off">Activer le remplacement pour pouvoir sélectionner.</string>
|
||||
<string name="perf_game_cores_group">Cœurs de jeu</string>
|
||||
<string name="perf_game_cores">Cœurs de jeu</string>
|
||||
<string name="perf_game_cores_hint">Cœurs utilisés par les jeux. Si tous sont sélectionnés, Android planifie librement.</string>
|
||||
<string name="perf_client_ui">Interface du client</string>
|
||||
<string name="perf_glthread">Multithread GL</string>
|
||||
<string name="perf_glthread_hint">Peut rendre les menus Steam plus réactifs.</string>
|
||||
<string name="perf_zink">Zink : descripteurs différés</string>
|
||||
<string name="perf_zink_hint">Recommandé pour les pilotes sans tampon de descripteurs.</string>
|
||||
<string name="perf_noglerror">Ignorer la vérification des erreurs GL</string>
|
||||
<string name="perf_noglerror_hint">Désactive la validation GL par appel.</string>
|
||||
<string name="perf_gsrealtime">gamescope : file d\'attente GPU temps réel</string>
|
||||
<string name="perf_gsrealtime_hint">Augmente la priorité du travail GPU du compositeur. Peut améliorer la stabilité du temps de frame, mais consomme une partie des performances du jeu.</string>
|
||||
<string name="perf_gpu">GPU</string>
|
||||
<string name="perf_gpuclock">Maintenir le GPU à sa fréquence maximale</string>
|
||||
<string name="perf_gpuclock_hint">Uniquement pour Adreno. Moins de saccades, mais plus de consommation d\'énergie et de chaleur.</string>
|
||||
<string name="perf_fixes">Correctifs de session</string>
|
||||
<string name="perf_sysmem">Turnip : rendu sysmem</string>
|
||||
<string name="perf_sysmem_hint">Steam et la plupart des jeux seront plus rapides. Requis pour Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">Ignorer l\'assistant xalia de Steam</string>
|
||||
<string name="perf_xalia_hint">Désactive l\'assistant de navigation à la manette de Proton, qui consomme du CPU dans chaque jeu.</string>
|
||||
<string name="perf_seccomp">Exécuter proot sans seccomp</string>
|
||||
<string name="perf_seccomp_hint">Peut corriger certaines erreurs d\'appels système manquants sur certains noyaux, mais peut réduire les performances.</string>
|
||||
<string name="perf_fastpath">Chemin rapide proot</string>
|
||||
<string name="perf_fastpath_needs_seccomp">Nécessite le filtre seccomp de proot.</string>
|
||||
<string name="perf_fastpath_hint">Recherche de fichiers plus rapide, moins de saccades. Désactivez cette option si un programme ne trouve pas ses fichiers.</string>
|
||||
<string name="perf_identity">Identité de la session</string>
|
||||
<string name="perf_hostname">Nom d\'hôte</string>
|
||||
<string name="perf_hostname_hint">Le nom sous lequel Steam voit cet appareil. Laisser vide pour restaurer %1$s.</string>
|
||||
<string name="perf_hostname_invalid">Ne peut contenir que des lettres, des chiffres et des tirets au milieu, jusqu\'à 63 caractères.</string>
|
||||
<string name="perf_phantom_warning">Android est configuré pour terminer cette session</string>
|
||||
<string name="driver_installed">Installé</string>
|
||||
<string name="driver_available">Téléchargeable</string>
|
||||
<string name="driver_nothing_new">Aucun nouvel élément depuis la dernière vérification.</string>
|
||||
<string name="driver_restore_builtin">Restaurer le pilote intégré</string>
|
||||
<string name="driver_delete_builtin">Pilote intégré à l\'application : cette opération supprimera les fichiers décompressés et masquera le pilote. Utilisez « Restaurer le pilote intégré » pour le restaurer.</string>
|
||||
<string name="driver_delete_bundle">Moitié du bundle Android + Linux : les deux parties seront supprimées. Le pilote en cours d\'utilisation basculera vers le pilote par défaut.</string>
|
||||
<string name="driver_delete_plain">Ses fichiers seront supprimés de l\'application.</string>
|
||||
<string name="driver_delete_in_use">Ses fichiers seront supprimés. Comme il est en cours d\'utilisation, le pilote par défaut sera utilisé à la place.</string>
|
||||
<string name="drawer_page_display">Affichage</string>
|
||||
<string name="drawer_page_controls">Contrôles</string>
|
||||
<string name="drawer_page_components">Composants</string>
|
||||
<string name="drawer_page_settings">Paramètres</string>
|
||||
<string name="drawer_page_desc">Page %1$s</string>
|
||||
<string name="drawer_steam">Steam</string>
|
||||
<string name="drawer_desktop">Bureau</string>
|
||||
<string name="drawer_steam_menu">Menu Steam</string>
|
||||
<string name="drawer_quick_access">Accès rapide</string>
|
||||
<string name="drawer_open_qam">Ouvrir le menu d\'accès rapide</string>
|
||||
<string name="drawer_prev_page">Page précédente</string>
|
||||
<string name="drawer_next_page">Page suivante</string>
|
||||
<string name="drawer_hud">HUD de performance</string>
|
||||
<string name="drawer_fill">Étirer le jeu pour remplir l\'écran</string>
|
||||
<string name="drawer_touch_auto">Auto (%1$s)</string>
|
||||
<string name="drawer_keyboard">Clavier</string>
|
||||
<string name="drawer_pc_keyboard">Clavier PC</string>
|
||||
<string name="drawer_android_keyboard">Android</string>
|
||||
<string name="drawer_second_screen">Deuxième écran</string>
|
||||
<string name="drawer_second_screen_shows">Afficher</string>
|
||||
<string name="drawer_android_apps">Applications Android</string>
|
||||
<string name="drawer_launch_app">Lancer l\'application</string>
|
||||
<string name="common_hide">Masquer</string>
|
||||
<string name="common_show">Afficher</string>
|
||||
<string name="drawer_no_apps">Aucune application à lancer</string>
|
||||
<string name="drawer_session_behavior">Comportement de la session</string>
|
||||
<string name="drawer_suspend_hint">Appliqué immédiatement, et prendra effet pour les futures sessions de ce mode.</string>
|
||||
<string name="drawer_next_session">Prochaine session</string>
|
||||
<string name="drawer_support">Assistance</string>
|
||||
<string name="drawer_logs">Journaux de session</string>
|
||||
<string name="drawer_logs_hint">Joindre au rapport d\'erreur</string>
|
||||
<string name="drawer_share_logs">Partager les journaux</string>
|
||||
<string name="drawer_background">Arrière-plan</string>
|
||||
<string name="drawer_stop">Arrêter</string>
|
||||
<string name="drawer_stop_title">Arrêter la session ?</string>
|
||||
<string name="drawer_running_now">En cours d\'exécution</string>
|
||||
<string name="drawer_no_game">Aucun jeu n\'utilise actuellement Proton</string>
|
||||
<string name="drawer_no_proton">Proton n\'est pas encore installé.</string>
|
||||
<string name="drawer_game_running">Jeu en cours d\'exécution</string>
|
||||
<string name="drawer_reapplied">Réappliqué au lancement de %1$s</string>
|
||||
<string name="drawer_original">Original</string>
|
||||
<string name="drawer_components_note">Veuillez télécharger, importer et supprimer depuis la page « Composants ».</string>
|
||||
<string name="setup_check_done">Terminé</string>
|
||||
<string name="setup_check_warn">À traiter</string>
|
||||
<string name="setup_check_busy">Traitement en cours</string>
|
||||
<string name="setup_limit_adb_failed">Veuillez vérifier l\'adresse IP et le port du débogage sans fil ; si Android a supprimé cet appareil, veuillez le réappairer.</string>
|
||||
<string name="setup_install">Installer</string>
|
||||
<string name="setup_manage">Gérer</string>
|
||||
<string name="setup_tab_overview">Aperçu</string>
|
||||
<string name="setup_tab_controller">Manette</string>
|
||||
<string name="setup_tab_session">Session</string>
|
||||
<string name="setup_tab_launcher">Lanceur</string>
|
||||
<string name="setup_title">Paramètres</string>
|
||||
<string name="setup_all_set">● Tout est prêt</string>
|
||||
<string name="setup_n_ready">%1$d/%2$d prêt(s)</string>
|
||||
<string name="setup_system_check">Vérification du système</string>
|
||||
<string name="setup_gpu_supported">Appareil pris en charge</string>
|
||||
<string name="setup_gpu_untested">GPU non testé</string>
|
||||
<string name="setup_gpu_unsupported">GPU non pris en charge</string>
|
||||
<string name="setup_gpu_detail">%1$s · %2$s</string>
|
||||
<string name="setup_gpu_untested_detail">%1$s : %2$s</string>
|
||||
<string name="setup_gpu_unsupported_detail">Steam nécessite un pilote Adreno ; %1$s peut afficher un écran noir.</string>
|
||||
<string name="setup_runtime">Environnement d\'exécution Linux</string>
|
||||
<string name="setup_runtime_progress">%1$s · %2$d%%</string>
|
||||
<string name="setup_runtime_missing">Non installé · Environ 3 Go, installé lors du premier lancement d\'un jeu</string>
|
||||
<string name="setup_installed">Installé</string>
|
||||
<string name="setup_runtime_update">%1$s · Mise à jour disponible</string>
|
||||
<string name="setup_runtime_current">%1$s · À jour</string>
|
||||
<string name="setup_limit">Limite des processus enfants</string>
|
||||
<string name="setup_limit_on">Activée · Android peut fermer Steam. La désactivation de cette limite prend environ une minute.</string>
|
||||
<string name="setup_limit_unset">Non définie · Android peut fermer Steam. La désactivation de cette limite prend environ une minute.</string>
|
||||
<string name="setup_limit_unknown">Impossible de vérifier · La désactivation de cette limite prend environ une minute.</string>
|
||||
<string name="setup_fix_it">Corriger</string>
|
||||
<string name="setup_details">Détails</string>
|
||||
<string name="setup_dev_options">Options pour les développeurs</string>
|
||||
<string name="setup_use_wireless">Utiliser le débogage sans fil</string>
|
||||
<string name="setup_check_again">Vérifier à nouveau</string>
|
||||
<string name="setup_limit_turn_on">Activer la limite</string>
|
||||
<string name="setup_account">Compte Steam</string>
|
||||
<string name="setup_signed_in_offline">Connecté en tant que %1$s · Mode hors ligne</string>
|
||||
<string name="setup_signed_in">Connecté en tant que %1$s</string>
|
||||
<string name="setup_sign_in">Appuyez sur Play et connectez-vous à Steam</string>
|
||||
<string name="setup_tools">Outils</string>
|
||||
<string name="setup_controller">Manette</string>
|
||||
<string name="setup_controller_unavailable">Les paramètres de la manette ne sont pas disponibles.</string>
|
||||
<string name="setup_session">Session</string>
|
||||
<string name="setup_logs">Journaux de session</string>
|
||||
<string name="setup_logs_hint">Enregistré après chaque fin de session</string>
|
||||
<string name="setup_latest_logs">Derniers journaux de session</string>
|
||||
<string name="setup_saved_logs">Journaux de session enregistrés</string>
|
||||
<string name="setup_saved_logs_hint">Conserver les %1$d plus récents</string>
|
||||
<string name="setup_clear_logs">Effacer les journaux</string>
|
||||
<string name="setup_offline">Mode hors ligne</string>
|
||||
<string name="setup_sign_in_first">Veuillez d\'abord vous connecter à Steam</string>
|
||||
<string name="setup_launcher">Lanceur</string>
|
||||
<string name="setup_theme">Thème</string>
|
||||
<string name="setup_theme_hint">Apparence du lanceur</string>
|
||||
<string name="setup_home">Utiliser comme écran d\'accueil</string>
|
||||
<string name="setup_home_on">DroidDeck peut être utilisé comme application d\'écran d\'accueil</string>
|
||||
<string name="setup_home_off">DroidDeck ne sera pas proposé comme application d\'écran d\'accueil</string>
|
||||
<string name="setup_fullscreen">Plein écran</string>
|
||||
<string name="setup_fullscreen_on">Masquer la barre d\'état et la barre de navigation Android</string>
|
||||
<string name="setup_fullscreen_off">Afficher la barre d\'état et la barre de navigation Android</string>
|
||||
<string name="setup_default_home">Application d\'écran d\'accueil par défaut</string>
|
||||
<string name="setup_choose_home">Choisir l\'application d\'écran d\'accueil</string>
|
||||
<string name="setup_choose">Choisir</string>
|
||||
<string name="setup_linux_apps">Applications Linux (bêta)</string>
|
||||
<string name="setup_store">Boutique Flathub</string>
|
||||
<string name="setup_store_on">Affiché dans le menu. Certaines applications peuvent ne pas se lancer ; les journaux se trouvent dans Download/DroidDeck.</string>
|
||||
<string name="setup_store_off">Installer des applications et des jeux Linux depuis Flathub</string>
|
||||
<string name="setup_tool_files">Fichiers</string>
|
||||
<string name="setup_tool_files_hint">Parcourir et gérer les fichiers</string>
|
||||
<string name="setup_tool_protons">Versions de Proton</string>
|
||||
<string name="setup_tool_protons_hint">Installer les versions ARM64 de Proton</string>
|
||||
<string name="setup_tool_performance">Performance</string>
|
||||
<string name="setup_tool_performance_hint">Attribution des cœurs CPU</string>
|
||||
<string name="setup_tool_roms">Dossiers ROM</string>
|
||||
<string name="setup_tool_roms_hint">Emplacement de stockage des jeux d\'émulateur</string>
|
||||
<string name="setup_card_components">Composants</string>
|
||||
<string name="setup_card_components_hint">FEX, DXVK, VKD3D</string>
|
||||
<string name="setup_card_controls">Contrôles</string>
|
||||
<string name="setup_card_controls_hint">Mappage des boutons</string>
|
||||
<string name="store_tab_discover">Découvrir</string>
|
||||
<string name="store_tab_search">Rechercher</string>
|
||||
<string name="store_tab_installed">Installé</string>
|
||||
<string name="store_tab_count">%1$s · %2$d</string>
|
||||
<string name="store_title">Boutique</string>
|
||||
<string name="store_chip_flathub">Flathub · ARM64</string>
|
||||
<string name="store_chip_ready">● Flatpak prêt</string>
|
||||
<string name="store_needs_runtime">Veuillez d\'abord installer l\'environnement d\'exécution Linux depuis les « Paramètres ».</string>
|
||||
<string name="store_setup_title">Configurer Flatpak</string>
|
||||
<string name="store_setup_text">Ajouter Flatpak et se connecter à Flathub (environ 20 Mo). La première application téléchargera également son environnement d\'exécution.</string>
|
||||
<string name="store_setting_up">Configuration en cours…</string>
|
||||
<string name="store_flatpak">Flatpak</string>
|
||||
<string name="store_updates">Mises à jour</string>
|
||||
<string name="store_busy">%1$s · %2$s</string>
|
||||
<string name="store_busy_percent">%1$s · %2$s · %3$d%%</string>
|
||||
<string name="store_starting">Démarrage…</string>
|
||||
<string name="store_categories">Catégories</string>
|
||||
<string name="store_unreachable">Impossible de se connecter à Flathub. Veuillez vérifier votre connexion réseau et réessayer.</string>
|
||||
<string name="store_try_again">Réessayer</string>
|
||||
<string name="store_search_label">Rechercher sur Flathub</string>
|
||||
<string name="store_search_placeholder">Firefox, jeux, émulateurs…</string>
|
||||
<string name="store_search">Rechercher</string>
|
||||
<string name="store_all">Tout</string>
|
||||
<string name="store_searching">Recherche en cours…</string>
|
||||
<string name="store_search_hint">Recherchez par nom ou sélectionnez une catégorie. Seules les applications ARM64 sont répertoriées ici.</string>
|
||||
<string name="store_no_results">Aucune application ARM64 correspondante sur Flathub.</string>
|
||||
<string name="store_results">Résultats</string>
|
||||
<string name="store_check_updates">Vérifier les mises à jour</string>
|
||||
<string name="store_update_all">Tout mettre à jour (%1$d)</string>
|
||||
<string name="store_all_current">● Tout est à jour</string>
|
||||
<string name="store_no_apps">Aucune application pour le moment. Recherchez dans « Découvrir » ou « Rechercher ».</string>
|
||||
<string name="store_setup_first_note">Configurez Flatpak pour pouvoir installer des applications.</string>
|
||||
<string name="store_update_available_prefix">Mise à jour disponible · %1$s</string>
|
||||
<string name="store_open">Ouvrir</string>
|
||||
<string name="store_details">Détails</string>
|
||||
<string name="store_remove">Supprimer</string>
|
||||
<string name="store_press_again">Appuyez à nouveau pour supprimer</string>
|
||||
<string name="store_installing">Installation…</string>
|
||||
<string name="store_install">Installer</string>
|
||||
<string name="store_setup_first">Configurer d\'abord Flatpak</string>
|
||||
<string name="store_download_size">Télécharger %1$s</string>
|
||||
<string name="store_installed_chip">● Installé</string>
|
||||
<string name="store_details_failed">Impossible de charger la page Flathub de cette application.</string>
|
||||
<string name="store_loading">Chargement depuis Flathub…</string>
|
||||
<string name="store_no_arm">Flathub ne propose pas de version ARM64, l\'installation est donc impossible ici.</string>
|
||||
<string name="store_screenshots">Captures d\'écran</string>
|
||||
<string name="store_about">À propos</string>
|
||||
<string name="store_app_id">ID de l\'application</string>
|
||||
<string name="store_license">Licence</string>
|
||||
<string name="store_runtime">Environnement d\'exécution</string>
|
||||
<string name="store_installed_size">Taille installée</string>
|
||||
<string name="store_installed_size_value">%1$s (plus l\'environnement d\'exécution partagé)</string>
|
||||
<string name="store_website">Site web</string>
|
||||
<string name="store_verified">Vérifié</string>
|
||||
<string name="upd_title">Mises à jour</string>
|
||||
<string name="upd_build">DroidDeck %1$s · %2$s</string>
|
||||
<string name="upd_checked">Vérifié le %1$s</string>
|
||||
<string name="upd_not_checked">Non vérifié</string>
|
||||
<string name="upd_perm_title">Autoriser DroidDeck à se mettre à jour</string>
|
||||
<string name="upd_perm_text">Activez « Autoriser depuis cette source » sur la page suivante, puis revenez. La mise à jour continuera automatiquement.</string>
|
||||
<string name="upd_open_settings">Ouvrir les paramètres</string>
|
||||
<string name="upd_not_now">Pas maintenant</string>
|
||||
<string name="upd_signed_status">Signature différente</string>
|
||||
<string name="upd_signed_headline">Impossible de mettre à jour sur place</string>
|
||||
<string name="upd_signed_detail">Cette copie n\'est pas signée avec la clé de publication de DroidDeck, elle ne peut donc pas être mise à jour par écrasement direct. Veuillez désinstaller puis basculer.</string>
|
||||
<string name="upd_available">Mise à jour disponible</string>
|
||||
<string name="upd_blocked_status">Installation impossible</string>
|
||||
<string name="upd_switch">Basculer possible</string>
|
||||
<string name="upd_ahead_status">En avance sur Stable</string>
|
||||
<string name="upd_ahead_headline">Vous êtes en avance sur Stable</string>
|
||||
<string name="upd_ahead_detail">Cette version est plus récente que la dernière Stable. Vous basculerez sur Stable après la publication de la prochaine version Stable.</string>
|
||||
<string name="upd_gone_status">Test terminé</string>
|
||||
<string name="upd_gone_headline">Ce test est terminé</string>
|
||||
<string name="upd_gone_detail">Ce correctif a été fusionné ou abandonné. Suivez Preview pour obtenir les derniers correctifs.</string>
|
||||
<string name="upd_current_status">À jour</string>
|
||||
<string name="upd_current_headline">Vous disposez de la dernière version de %1$s</string>
|
||||
<string name="upd_dot_ago">· %1$s</string>
|
||||
<string name="upd_stage_percent">%1$s… %2$d%%</string>
|
||||
<string name="upd_stage">%1$s…</string>
|
||||
<string name="upd_update_button">Mettre à jour %1$s</string>
|
||||
<string name="upd_install_button">Installer %1$s</string>
|
||||
<string name="upd_install_anyway">Installer Stable %1$s quand même</string>
|
||||
<string name="upd_follow_preview">Suivre Preview</string>
|
||||
<string name="upd_stop_session">Veuillez arrêter la session en cours avant de mettre à jour.</string>
|
||||
<string name="upd_less">Réduire</string>
|
||||
<string name="upd_more">Plus</string>
|
||||
<string name="upd_new_stable">DroidDeck %1$s</string>
|
||||
<string name="upd_new_preview">Nouvelle version Preview</string>
|
||||
<string name="upd_new_test">Version de test PR #%1$d</string>
|
||||
<string name="upd_mb">%1$d Mo</string>
|
||||
<string name="upd_channel">Canal de mise à jour</string>
|
||||
<string name="upd_stable">Stable</string>
|
||||
<string name="upd_stable_hint">Version testée, adaptée à la plupart des utilisateurs</string>
|
||||
<string name="upd_version_ago">%1$s · %2$s</string>
|
||||
<string name="upd_preview">Preview</string>
|
||||
<string name="upd_preview_hint">Derniers correctifs avant Stable</string>
|
||||
<string name="upd_preview_current">À jour</string>
|
||||
<string name="upd_tests">Versions de test</string>
|
||||
<string name="upd_tests_hint">Essayer un correctif avant sa publication officielle</string>
|
||||
<string name="upd_tests_none">Aucun pour le moment</string>
|
||||
<string name="upd_pr">PR #%1$d</string>
|
||||
<string name="upd_not_built">Non compilé pour cette copie de DroidDeck</string>
|
||||
<string name="upd_updated">%1$s mis à jour</string>
|
||||
<string name="upd_test_name">Version de test PR #%1$d</string>
|
||||
<string name="upd_while_ago">Il y a peu</string>
|
||||
<string name="upd_just_now">À l\'instant</string>
|
||||
<plurals name="upd_tests_count">
|
||||
<item quantity="one">%1$d disponible</item>
|
||||
<item quantity="other">%1$d disponibles</item>
|
||||
</plurals>
|
||||
<plurals name="upd_preview_behind">
|
||||
<item quantity="one">Modifications depuis votre version · %1$d version de retard</item>
|
||||
<item quantity="other">Modifications depuis votre version · %1$d versions de retard</item>
|
||||
</plurals>
|
||||
<plurals name="upd_preview_recent">
|
||||
<item quantity="one">Modifications récentes · %1$d version</item>
|
||||
<item quantity="other">Modifications récentes · %1$d versions</item>
|
||||
</plurals>
|
||||
<string name="gate_title">Un paramètre Android à modifier</string>
|
||||
<string name="gate_eyebrow">Steam</string>
|
||||
<string name="gate_lede">Android arrête les applications qui lancent de nombreux processus en arrière-plan, et Steam en lance des dizaines. Tant que ce paramètre n\'est pas modifié, les jeux peuvent se fermer sans message d\'erreur.</string>
|
||||
<string name="gate_fix_for_me">Corriger pour moi</string>
|
||||
<string name="gate_toggle_steps">Activez « Désactiver la limite de processus enfants », puis revenez. Gardez les options pour les développeurs activées, sinon l\'interrupteur se désactivera à nouveau.</string>
|
||||
<string name="gate_open_dev">Ouvrir les options pour les développeurs</string>
|
||||
<string name="gate_no_toggle">Cette version d\'Android ne dispose pas de cet interrupteur, DroidDeck effectuera donc la modification via le débogage sans fil. Cela prend environ une minute, sans ordinateur.</string>
|
||||
<string name="gate_needs_wifi">Le débogage sans fil nécessite un Wi-Fi. N\'importe quel réseau convient, Internet n\'est pas nécessaire.</string>
|
||||
<string name="gate_needs_notifications">Le code d\'appairage s\'affichera dans une notification. Veuillez autoriser DroidDeck à envoyer des notifications, ou utilisez « Autre méthode ».</string>
|
||||
<string name="gate_allow_notifications">Autoriser les notifications</string>
|
||||
<string name="gate_step1">Ouvrez Paramètres → Options pour les développeurs → Débogage sans fil, et activez-le</string>
|
||||
<string name="gate_step2">Appuyez sur « Associer l\'appareil avec un code d\'appairage »</string>
|
||||
<string name="gate_step3">Saisissez le code d\'appairage dans la notification DroidDeck</string>
|
||||
<string name="gate_waiting">En attente de la fenêtre d\'appairage…</string>
|
||||
<string name="gate_code_needed">Fenêtre trouvée. Veuillez saisir le code d\'appairage affiché dans la notification.</string>
|
||||
<string name="gate_status">État</string>
|
||||
<string name="gate_polling">Vérification toutes les 2 secondes. Cette page se fermera automatiquement une fois cet interrupteur désactivé.</string>
|
||||
<string name="gate_other_ways">Autres méthodes</string>
|
||||
<string name="gate_other_toggle">Débogage sans fil, saisie manuelle de l\'adresse, ADB sur PC</string>
|
||||
<string name="gate_other_no_toggle">Saisie manuelle de l\'adresse, ADB sur PC, options pour les développeurs</string>
|
||||
<string name="gate_use_wireless_instead">Utiliser plutôt le débogage sans fil</string>
|
||||
<string name="gate_some_roms">Certaines ROM proposent encore cet interrupteur. Recherchez « processus enfants » dans les options pour les développeurs.</string>
|
||||
<string name="gate_manual_hint">Si la méthode par notification ne fonctionne pas, saisissez manuellement l\'adresse et le code d\'appairage de la fenêtre.</string>
|
||||
<string name="gate_enter_manually">Saisir l\'adresse manuellement</string>
|
||||
<string name="gate_from_computer">Utiliser ADB depuis un ordinateur :</string>
|
||||
<string name="gate_copy_command">Copier la commande</string>
|
||||
<string name="gate_choose_display">Choisissez l\'écran sur lequel ouvrir les paramètres Android.</string>
|
||||
<string name="gate_main_screen">Écran principal</string>
|
||||
<string name="wadb_finding_port">Appairé. Recherche du port de débogage sans fil…</string>
|
||||
<string name="wadb_enter_port">Appairé. Veuillez saisir le port indiqué dans les paramètres.</string>
|
||||
<string name="wadb_applying">Appareil trouvé. Application des paramètres…</string>
|
||||
<string name="wadb_apply_failed">Impossible d\'appliquer automatiquement. Veuillez vérifier l\'adresse ci-dessous et réessayer. %1$s</string>
|
||||
<string name="wadb_title_wireless">Débogage sans fil</string>
|
||||
<string name="wadb_title_done">Limite des processus enfants mise à jour</string>
|
||||
<string name="wadb_title">Modifier la limite des processus enfants</string>
|
||||
<string name="wadb_lede_compact0">Si cette option n\'est pas disponible, appairez via le débogage sans fil.</string>
|
||||
<string name="wadb_lede_compact1">Appairé. Veuillez vérifier l\'adresse IP et le port dans le débogage sans fil.</string>
|
||||
<string name="wadb_lede_done">La limite des processus enfants a été mise à jour.</string>
|
||||
<string name="wadb_lede0">Si l\'option de processus enfants n\'est pas disponible dans les options pour les développeurs, utilisez l\'étape 2. Ouvrez Options pour les développeurs → Débogage sans fil → Associer l\'appareil avec un code d\'appairage.</string>
|
||||
<string name="wadb_lede1">Appairé. Utilisez l\'adresse ci-dessous, ou mettez-la à jour dans Débogage sans fil → Adresse IP et port.</string>
|
||||
<string name="wadb_lede_done_long">Limite des processus enfants mise à jour via le débogage sans fil.</string>
|
||||
<string name="wadb_confirmed_on">Android a confirmé que la limite est activée.</string>
|
||||
<string name="wadb_confirmed_off">Android a confirmé que la limite est désactivée.</string>
|
||||
<string name="wadb_pair_group">2 · Appairer le débogage sans fil</string>
|
||||
<string name="wadb_pair_address">Adresse IP et port dans la fenêtre d\'appairage</string>
|
||||
<string name="wadb_pin">Code d\'appairage (PIN)</string>
|
||||
<string name="wadb_pin_placeholder">6 chiffres</string>
|
||||
<string name="wadb_pair">Appairer</string>
|
||||
<string name="wadb_apply_group">2 · Appliquer via le débogage sans fil</string>
|
||||
<string name="wadb_connect_address">Adresse IP et port de connexion</string>
|
||||
<string name="wadb_pair_again">Réappairer</string>
|
||||
<string name="wadb_turn_off">Désactiver la limite</string>
|
||||
<string name="wadb_other_ways">Autres méthodes de modification</string>
|
||||
<string name="wadb_dev_try_first">1 · Options pour les développeurs (à essayer en premier)</string>
|
||||
<string name="wadb_restrict_on">Activez « Limiter les processus enfants ».</string>
|
||||
<string name="wadb_restrict_off">Désactivez « Limiter les processus enfants ».</string>
|
||||
<string name="wadb_computer_last">3 · ADB sur PC (en dernier recours)</string>
|
||||
<string name="wadb_only_if">À utiliser uniquement si le débogage sans fil n\'est pas disponible.</string>
|
||||
<string name="wadb_computer_group">3 · ADB sur PC (en dernier recours)</string>
|
||||
<string name="ctrl_osc_hint">Lors de l\'affichage des commandes à l\'écran en session</string>
|
||||
<string name="ctrl_color">Couleur</string>
|
||||
<string name="ctrl_color_hint">Teinte des boutons à l\'écran</string>
|
||||
<string name="ctrl_custom">Personnalisée</string>
|
||||
<string name="ctrl_opacity">Opacité</string>
|
||||
<string name="ctrl_percent">%1$d%%</string>
|
||||
<string name="ctrl_size">Taille des boutons</string>
|
||||
<string name="ctrl_size_hint" formatted="false">100 % correspond à la taille standard</string>
|
||||
<string name="ctrl_stick_click">Clic du joystick</string>
|
||||
<string name="ctrl_stick_click_hint">Double-cliquez et maintenez le joystick pour déclencher L3 ou R3</string>
|
||||
<string name="ctrl_adaptive">Joystick adaptatif</string>
|
||||
<string name="ctrl_rumble">Vibration du jeu</string>
|
||||
<string name="ctrl_steam_button">Bouton Steam</string>
|
||||
<string name="ctrl_qam_button">Bouton QAM</string>
|
||||
<string name="ctrl_keyboard_button">Bouton clavier</string>
|
||||
<string name="setup_animations">Animations</string>
|
||||
<string name="ctrl_adaptive_hint">Le joystick apparaîtra là où vous touchez et se masquera une fois relâché</string>
|
||||
<string name="ctrl_layout">Disposition</string>
|
||||
<string name="ctrl_layout_custom">Position personnalisée enregistrée</string>
|
||||
<string name="ctrl_layout_default">Adapté à cet écran</string>
|
||||
<string name="ctrl_edit">Modifier</string>
|
||||
<string name="ctrl_reset">Réinitialiser</string>
|
||||
<string name="ctrl_mapping">Mappage des boutons</string>
|
||||
<string name="ctrl_mapping_default">Chaque bouton envoie l\'entrée d\'origine correspondante</string>
|
||||
<string name="ctrl_mapping_count">%1$d/%2$d boutons remappés</string>
|
||||
<string name="ctrl_configure">Configurer</string>
|
||||
<string name="ctrl_reset_all">Réinitialiser la manette</string>
|
||||
<string name="ctrl_reset_all_hint">Restaurer tous les paramètres et dispositions de la manette</string>
|
||||
<string name="ctrl_mapping_lede">Définissez l\'entrée que chaque bouton à l\'écran envoie au jeu. « Masquer » supprimera ce bouton.</string>
|
||||
<string name="ctrl_onscreen_buttons">Boutons à l\'écran</string>
|
||||
<string name="ctrl_defaults">Valeurs par défaut</string>
|
||||
<string name="ctrl_reset_mapping">Réinitialiser le mappage</string>
|
||||
<string name="content_android_apps">Applications Android</string>
|
||||
<string name="content_apps_count">%1$d applications</string>
|
||||
<string name="content_no_android_apps">Aucune application Android lançable trouvée.</string>
|
||||
<string name="content_desktop_installed">● Bureau installé</string>
|
||||
<string name="content_desktop_first_open">Installé à la première ouverture</string>
|
||||
<string name="content_available">Installable</string>
|
||||
<string name="content_not_installed">Non installé.</string>
|
||||
<string name="content_not_installed_suffix">%1$s · Non installé</string>
|
||||
<string name="content_open_named">Ouvrir %1$s</string>
|
||||
<string name="content_games">Jeux</string>
|
||||
<string name="content_choose_roms">Sélectionnez un dossier ROM.</string>
|
||||
<string name="content_retroarch_roms">Dans RetroArch, naviguez vers /root/ROMs.</string>
|
||||
<string name="content_add_roms">Ajout de %1$s jeux à ROMs/%2$s.</string>
|
||||
<string name="content_install_named">Installer %1$s</string>
|
||||
<string name="content_stop_to_install">Arrêter la session pour installer</string>
|
||||
<string name="content_runtime_required">Environnement d\'exécution requis</string>
|
||||
<string name="content_loading_details">Chargement des détails d\'installation…</string>
|
||||
<string name="content_details_unavailable">Détails d\'installation non disponibles. Veuillez réessayer plus tard.</string>
|
||||
<string name="content_needs_runtime">Veuillez d\'abord installer l\'environnement d\'exécution Linux depuis les « Paramètres ».</string>
|
||||
<string name="content_stop_first">Veuillez arrêter la session en cours avant d\'installer une application de bureau.</string>
|
||||
<string name="content_install_into">Installer %1$s sur le bureau Linux.</string>
|
||||
<string name="store_busy_percent_short">%1$s · %2$d%%</string>
|
||||
<string name="content_hide_note">Masquer le retirera du bureau. Les fichiers resteront dans l\'environnement d\'exécution Linux.</string>
|
||||
<string name="content_rom_gone">Ce jeu n\'est plus dans le dossier ROM.</string>
|
||||
<string name="content_desktop_system">Bureau · %1$s</string>
|
||||
<string name="content_launch_in">Lancer dans %1$s</string>
|
||||
<string name="content_also_in">Également dans %1$s</string>
|
||||
<string name="content_page_gone">Cette page n\'existe plus. Veuillez sélectionner une section à gauche.</string>
|
||||
<string name="content_open_desktop">Ouvrir le bureau</string>
|
||||
<string name="content_install_open_desktop">Installer et ouvrir le bureau</string>
|
||||
<string name="content_linux_desktop">Bureau Linux</string>
|
||||
<string name="content_linux_desktop_hint">LXQt, Firefox et vos émulateurs</string>
|
||||
<string name="games_empty">Les jeux installés sur Steam apparaîtront ici après la fin de la session.</string>
|
||||
<string name="games_play_steam">Lancer Steam</string>
|
||||
<string name="games_launch_settings">Paramètres de lancement</string>
|
||||
<string name="games_launch">Lancer</string>
|
||||
<string name="games_files">Fichiers du jeu</string>
|
||||
<string name="games_prefix">Préfixe Proton</string>
|
||||
<string name="games_saves_looking">Recherche des sauvegardes…</string>
|
||||
<string name="games_saves_none">Aucun dossier de sauvegarde trouvé par nom. L\'exportation inclura l\'intégralité du dossier utilisateur.</string>
|
||||
<string name="games_saves_folders">%1$d dossiers de sauvegarde</string>
|
||||
<string name="games_saves_summary">%1$s · %2$d fichiers · %3$s</string>
|
||||
<string name="games_kb">%1$d Ko</string>
|
||||
<string name="games_manage_saves">Gérer les sauvegardes</string>
|
||||
<string name="games_saves">Sauvegardes de jeu</string>
|
||||
<string name="games_import_saves">Importer des sauvegardes…</string>
|
||||
<string name="games_import_saves_hint">Archive GameHub ou Winlator. Les sauvegardes actuelles seront sauvegardées avant l\'importation.</string>
|
||||
<string name="games_export_gamehub">Exporter en tant qu\'archive GameHub…</string>
|
||||
<string name="games_export_gamehub_hint">Compatible avec GameHub et BannerHub</string>
|
||||
<string name="games_export_winlator">Exporter en tant qu\'archive Winlator…</string>
|
||||
<string name="games_export_winlator_hint">Compatible avec Winlator, WinNative et Bannerlator</string>
|
||||
<string name="games_open_save_folder">Ouvrir le dossier de sauvegarde</string>
|
||||
<string name="games_never_played">Jamais lancé</string>
|
||||
<string name="games_runtime_busy_percent">Environnement d\'exécution occupé · %1$d%%</string>
|
||||
<string name="games_runtime_busy">Environnement d\'exécution occupé</string>
|
||||
<string name="games_runtime_first_play">Installation de l\'environnement d\'exécution lors du premier lancement du jeu</string>
|
||||
<string name="games_runtime_update">Mise à jour de l\'environnement d\'exécution disponible</string>
|
||||
<string name="games_runtime_ready">● Environnement d\'exécution prêt</string>
|
||||
<string name="games_last_played">Dernier lancement %1$s</string>
|
||||
<string name="games_internal">Stockage interne</string>
|
||||
<string name="games_added">Jeux ajoutés</string>
|
||||
<string name="gpu_auto_hint">Sélectionne la meilleure combinaison de pilotes pour ce GPU et les maintient à jour</string>
|
||||
<string name="gpu_manual_hint">Choisir manuellement la combinaison de pilotes</string>
|
||||
<string name="gpu_checking">Vérification des pilotes…</string>
|
||||
<string name="gpu_none_listed">Aucun pilote répertorié pour le moment. Actualisez pour rechercher des pilotes.</string>
|
||||
<string name="gpu_hide_other">Masquer les pilotes des autres GPU</string>
|
||||
<string name="gpu_show_other">Afficher les pilotes des autres GPU</string>
|
||||
<string name="gpu_advanced">Avancé</string>
|
||||
<string name="gpu_set_with_display">Configuré avec le pilote d\'affichage : %1$s inclut les deux.</string>
|
||||
<string name="gpu_set_with_runtime">Configuré avec le pilote d\'exécution : %1$s inclut les deux.</string>
|
||||
<string name="gpu_runtime_hint">Utilisé par les jeux et le bureau.</string>
|
||||
<string name="gpu_runtime_default">Par défaut de l\'environnement d\'exécution</string>
|
||||
<string name="gpu_display_hint">Responsable de la sortie vidéo vers l\'écran. Prendra effet après le redémarrage de DroidDeck.</string>
|
||||
<string name="gpu_auto_by_gpu">Auto - Sélection par GPU</string>
|
||||
<string name="gpu_manage">Télécharger, importer ou supprimer…</string>
|
||||
<string name="gpu_in_use_caps">Utilisé</string>
|
||||
<string name="gpu_builtin">Pilote intégré à DroidDeck</string>
|
||||
<string name="gpu_matched_pair">Le pilote d\'exécution et le pilote d\'affichage sont configurés ensemble en tant que paire correspondante.</string>
|
||||
<string name="gpu_recommended_for">Recommandé pour ce GPU : %1$s.</string>
|
||||
<string name="gpu_refresh_hint">Actualisez pour rechercher les pilotes adaptés à ce GPU.</string>
|
||||
<string name="gpu_recommended_caps">Recommandé</string>
|
||||
<string name="gpu_unavailable">Non disponible</string>
|
||||
<string name="load_runtime">Environnement d\'exécution Linux</string>
|
||||
<string name="load_runtime_detail">Préparation de l\'environnement d\'exécution Linux</string>
|
||||
<string name="load_session">Session</string>
|
||||
<string name="load_session_detail">Démarrage de l\'affichage et de l\'audio</string>
|
||||
<string name="load_steam">Client Steam</string>
|
||||
<string name="load_steam_detail">Vérification de Steam et de ses outils de compatibilité</string>
|
||||
<string name="load_opening_steam">Ouverture de Steam</string>
|
||||
<string name="load_opening_steam_detail">En attente de la première image de Steam</string>
|
||||
<string name="load_desktop">Bureau</string>
|
||||
<string name="load_desktop_detail">Préparation du bureau</string>
|
||||
<string name="load_opening">Ouverture</string>
|
||||
<string name="load_opening_detail">En attente de la première image</string>
|
||||
<string name="load_starting_steam">Démarrage de Steam</string>
|
||||
<string name="load_ended">Session terminée</string>
|
||||
<string name="load_step">Étape %1$d sur %2$d</string>
|
||||
<string name="load_steam_paused">Steam en pause</string>
|
||||
<string name="deck_tab_grips">Poignées</string>
|
||||
<string name="deck_tab_left">Pavé tactile gauche</string>
|
||||
<string name="deck_tab_right">Pavé tactile droit</string>
|
||||
<string name="deck_tab_both">Les deux</string>
|
||||
<string name="deck_close">Fermer les commandes du deuxième écran</string>
|
||||
<string name="deck_open_steam_menu">Ouvrir le menu Steam</string>
|
||||
<string name="deck_left_upper">Gauche · Haut</string>
|
||||
<string name="deck_left_lower">Gauche · Bas</string>
|
||||
<string name="deck_right_upper">Droite · Haut</string>
|
||||
<string name="deck_right_lower">Droite · Bas</string>
|
||||
<string name="deck_click">Cliquer</string>
|
||||
<string name="deck_right_trackpad">Pavé tactile droit</string>
|
||||
<string name="deck_left_trackpad">Pavé tactile gauche</string>
|
||||
<string name="second_trackpad">Pavé tactile</string>
|
||||
<string name="second_show_keyboard">Afficher le clavier</string>
|
||||
<string name="second_hide_keyboard">Masquer le clavier</string>
|
||||
<string name="second_terminal">Terminal Linux</string>
|
||||
<string name="second_terminal_not_ready">La session Linux n\'est pas prête, le terminal ne peut pas être utilisé.</string>
|
||||
<string name="rail_steam">Steam</string>
|
||||
<string name="rail_games">Jeux</string>
|
||||
<string name="rail_desktop">Bureau</string>
|
||||
<string name="rail_store">Boutique</string>
|
||||
<string name="rail_components">Composants</string>
|
||||
<string name="rail_apps">Applications</string>
|
||||
<string name="rail_setup">Configuration</string>
|
||||
<string name="rail_updates">Mises à jour</string>
|
||||
<string name="rail_percent">%1$d%%</string>
|
||||
<string name="rail_resume_named">Reprendre %1$s</string>
|
||||
<string name="roms_text">Affiché comme /root/ROMs dans chaque session. Le stockage interne se trouve dans /root/Storage.</string>
|
||||
<string name="roms_none">Aucun dossier sélectionné</string>
|
||||
<string name="roms_applies">Prendra effet à la prochaine session. Prend en charge les cartes SD.</string>
|
||||
<string name="roms_choose">Choisir un dossier</string>
|
||||
<string name="roms_change">Modifier le dossier</string>
|
||||
<string name="proton_lede">Installez une version ARM64 de Proton, puis sélectionnez-la pour chaque jeu dans Steam → Propriétés → Compatibilité.</string>
|
||||
<string name="proton_stop_first">Veuillez arrêter la session en cours avant d\'installer ou de supprimer des outils de compatibilité.</string>
|
||||
<string name="proton_available">Versions disponibles</string>
|
||||
<string name="proton_installed">%1$s installé</string>
|
||||
<string name="proton_queued">Élément en attente d\'une demande précédente</string>
|
||||
<string name="proton_not_installed">Non installé</string>
|
||||
<string name="proton_install_now">Installer maintenant</string>
|
||||
<string name="proton_cancel_queued">Annuler la file d\'attente</string>
|
||||
<string name="pckb_android">Clavier Android</string>
|
||||
<string name="pckb_hide">Masquer ✕</string>
|
||||
<string name="main_launch_named">Lancer %1$s</string>
|
||||
<string name="main_choose_screen">Choisir l\'écran. Écran secondaire : %1$s.</string>
|
||||
<string name="main_secondary_gone">L\'écran secondaire n\'est plus disponible.</string>
|
||||
<string name="main_primary">Écran principal</string>
|
||||
<string name="main_secondary">Écran secondaire</string>
|
||||
<string name="widgets_prev_tab">Onglet précédent</string>
|
||||
<string name="widgets_next_tab">Onglet suivant</string>
|
||||
<string name="widgets_on">Activé</string>
|
||||
<string name="widgets_all_n">Tout %1$d</string>
|
||||
<string name="widgets_none">Aucun</string>
|
||||
<string name="widgets_n_of_m">%1$d/%2$d</string>
|
||||
<string name="widgets_off">Désactivé</string>
|
||||
<string name="screen_bottom">Écran inférieur</string>
|
||||
<string name="game_env_applies">Prendra effet au prochain lancement du jeu. Le profil du jeu remplacera la configuration partagée.</string>
|
||||
<string name="game_env_other">Sélectionner un autre jeu par ID d\'application…</string>
|
||||
<string name="game_env_done">Terminé</string>
|
||||
<string name="game_env_default">Par défaut</string>
|
||||
<string name="game_env_off">Désactivé</string>
|
||||
<string name="game_env_change">Modifier…</string>
|
||||
<string name="game_env_change_title">Modifier la variable</string>
|
||||
<string name="game_env_restore_default">Restaurer les valeurs par défaut</string>
|
||||
<string name="game_env_eyebrow">Jeux Proton</string>
|
||||
<string name="pip_title">Picture-in-Picture (PiP)</string>
|
||||
<string name="pip_auto">Passer automatiquement en PiP</string>
|
||||
<string name="pip_suspended">En pause</string>
|
||||
<string name="pip_not_ready">Le mode PiP sera disponible une fois la session prête.</string>
|
||||
<string name="pip_permission">Veuillez autoriser DroidDeck à utiliser le mode PiP dans les paramètres Android.</string>
|
||||
<string name="pip_unavailable">Android ne peut pas ouvrir le mode PiP.</string>
|
||||
<string name="game_shortcut">Raccourci</string>
|
||||
<string name="game_shortcut_add">Ajouter à l\'écran d\'accueil</string>
|
||||
<string name="game_shortcut_choose">Choisir un jeu</string>
|
||||
<string name="game_shortcut_scanning">Analyse des jeux installés…</string>
|
||||
<string name="game_link_copy">Copier le lien de lancement</string>
|
||||
<string name="game_link_copied">Lien de lancement copié</string>
|
||||
<string name="game_shortcut_unsupported">Ce lanceur ne peut pas ajouter de raccourci. Utilisez « Copier le lien de lancement » à la place.</string>
|
||||
<string name="game_link_invalid">Lien de lancement de jeu invalide.</string>
|
||||
<string name="game_link_missing">Ce jeu n\'est plus dans votre bibliothèque DroidDeck.</string>
|
||||
<string name="game_link_session_busy">Veuillez arrêter la session en cours avant de lancer un jeu Steam.</string>
|
||||
<string name="game_link_failed">Impossible d\'envoyer le jeu à Steam. Veuillez réessayer de le lancer.</string>
|
||||
<string name="setup_retry_removal">Réessayer la suppression</string>
|
||||
<string name="runtime_removing">Suppression…</string>
|
||||
<string name="runtime_removal_incomplete">Suppression incomplète</string>
|
||||
<string name="game_file_export">Exporter les fichiers du jeu</string>
|
||||
<string name="game_file_sync">Synchroniser tous les fichiers du jeu dans un dossier</string>
|
||||
<string name="game_file_stop_sync">Arrêter la synchronisation des fichiers du jeu</string>
|
||||
<string name="game_file_folder">Choisir un dossier pour les fichiers du jeu frontal</string>
|
||||
<string name="game_file_exported">Fichiers du jeu enregistrés dans %1$s</string>
|
||||
<string name="game_frontend_files">Fichiers frontaux</string>
|
||||
</resources>
|
||||
@@ -1,960 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>При первом запуске будет загружен Steam. Это может занять несколько минут.</item>
|
||||
<item>По умолчанию при выходе из приложения Steam приостанавливается; при возвращении работа возобновляется с того же места.</item>
|
||||
<item>Ваш контроллер будет отображаться как геймпад Xbox 360. В противном случае используйте экранные элементы управления.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>При первом запуске будет настроен рабочий стол. Это может занять несколько минут.</item>
|
||||
<item>По умолчанию при выходе из приложения сессия приостанавливается; при возвращении работа возобновляется с того же места.</item>
|
||||
<item>Сенсорный ввод работает как тачпад: перетаскивайте для перемещения курсора, нажимайте для клика.</item>
|
||||
<item>Ваш контроллер будет отображаться как геймпад Xbox 360. В противном случае используйте экранные элементы управления.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Сессия</string>
|
||||
<string name="session_channel_description">Отображается при открытии сессии Steam или рабочего стола</string>
|
||||
<string name="session_notification">Steam запущен</string>
|
||||
<string name="session_notification_paused">Сессия приостановлена - нажмите, чтобы продолжить</string>
|
||||
<string name="resume_session">Продолжить</string>
|
||||
<string name="stop_session">Завершить сессию</string>
|
||||
<string name="frame_gen_title">Генерация кадров</string>
|
||||
<string name="frame_gen_hint">Выберите режим генерации кадров</string>
|
||||
<string name="frame_gen_off">Выкл.</string>
|
||||
<string name="frame_gen_winfg">Win-FG %1$d×</string>
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Адаптивный %1$d</string>
|
||||
<string name="lsfg_needs_steam">Требуется Lossless Scaling из Steam</string>
|
||||
<string name="lsfg_needs_install">Установите Lossless Scaling в Steam или импортируйте Lossless.dll</string>
|
||||
<string name="lsfg_import">Импорт Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Используется версия из Steam</string>
|
||||
<string name="lsfg_using_import">Используется импортированная версия</string>
|
||||
<string name="lsfg_pick_title">Выберите файл Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll импортирован</string>
|
||||
<string name="lsfg_import_unchanged">Этот Lossless.dll уже используется</string>
|
||||
<string name="lsfg_import_not_owned">В этой учетной записи Steam нет Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Этот файл не является Lossless.dll от Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Не удалось подготовить LSFG из этого Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">Для LSFG требуется Lossless Scaling из Steam или импортированный файл Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG не может подготовить свои шейдеры из этого Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: не поддерживается</string>
|
||||
<string name="hud_fg_failed">%1$s: сбой движка</string>
|
||||
<string name="hud_fg_needs_lossless">%1$s: требуется Lossless Scaling</string>
|
||||
<string name="hud_fg_starting">%1$s %2$s · Запуск</string>
|
||||
<string name="added_games_import_hint">Папка, содержащая несколько подпапок, каждая из которых соответствует игре Windows. Игры, которыми вы владеете в Steam, будут использовать соответствующие записи Steam после перезапуска Steam, остальные игры станут ярлыками, отличными от Steam.</string>
|
||||
<string name="second_library_import_hint">Добавьте библиотеку Steam и отсканируйте в ней игры Windows. Имеющиеся игры будут использовать соответствующие записи Steam, остальные станут ярлыками, отличными от Steam.</string>
|
||||
<string name="added_games_forget_hint">«Забыть» удалит эти ярлыки в следующей сессии. Но файлы останутся на диске.</string>
|
||||
<string name="game_env_title">Игровая среда</string>
|
||||
<string name="game_env_hint">Переменные среды для игр Proton.</string>
|
||||
<string name="game_env_edit">Изменить</string>
|
||||
<string name="game_env_shared">Все игры Proton</string>
|
||||
<string name="game_env_scope">Профиль</string>
|
||||
<string name="game_env_app_id">ID приложения Steam</string>
|
||||
<string name="game_env_open">Открыть</string>
|
||||
<string name="game_env_profile">Игра %1$s</string>
|
||||
<string name="game_env_add">Добавить переменную</string>
|
||||
<string name="game_env_name">Имя переменной</string>
|
||||
<string name="game_env_value">Значение</string>
|
||||
<string name="game_env_save">Сохранить</string>
|
||||
<string name="game_env_remove">Удалить</string>
|
||||
<string name="game_env_restore">Восстановить наследование</string>
|
||||
<string name="game_env_reset">Сбросить профиль</string>
|
||||
<string name="game_env_unset">Снять настройку для профиля</string>
|
||||
<string name="game_env_empty">Переменные не заданы.</string>
|
||||
<string name="game_env_inherited">Унаследовано</string>
|
||||
<string name="game_env_custom">Пользовательская переменная</string>
|
||||
<string name="game_env_error">Не удалось загрузить или сохранить. Проверьте свободное место и повторите попытку.</string>
|
||||
<string name="game_env_invalid">Введите допустимое имя и значение, до 8192 символов.</string>
|
||||
<string name="game_env_unused">Стандартная среда выполнения Proton не считывает эту переменную.</string>
|
||||
<string name="game_env_loading">Загрузка…</string>
|
||||
<string name="game_env_feature">Переопределение уровня функций D3D12. 12_2 сообщает о возможностях DirectX 12 Ultimate; неподдерживаемые функции могут вызвать сбой. Оставьте пустым для автоопределения.</string>
|
||||
<string name="game_env_shader">Переопределение модели шейдеров D3D12. 6_9 требует достаточно нового VKD3D и соответствующих функций GPU. Оставьте пустым для автоопределения.</string>
|
||||
<string name="game_env_cache">Поддерживать кэш шейдеров Mesa включенным для уменьшения повторной компиляции. Установите false, чтобы включить кэш.</string>
|
||||
<string name="game_env_cache_size">Максимальный размер кэша шейдеров Mesa, например 1G. Больший кэш занимает больше места.</string>
|
||||
<string name="game_env_vkd3d_config">Параметры VKD3D для D3D12. nodxr отключает трассировку лучей; используйте только при необходимости в игре.</string>
|
||||
<string name="game_env_proton_log">Установите 1 для создания диагностического журнала Proton. Ведение журнала может снизить производительность и занять место.</string>
|
||||
<string name="game_env_wined3d">Установите 1, чтобы использовать WineD3D на базе OpenGL вместо DXVK для тестирования совместимости с D3D9–11.</string>
|
||||
<string name="game_env_xalia">Установите 0, чтобы отключить помощник навигации геймпада Proton для этой игры.</string>
|
||||
<string name="game_env_hud">Оверлей DXVK для D3D9–11. fps показывает частоту кадров; снимите настройку, чтобы скрыть оверлей.</string>
|
||||
<string name="game_env_dxvk_config">Настройки DXVK, разделенные точкой с запятой. В последних версиях используется dxvk.maxFrameRate для ограничения частоты кадров; для повседневной игры рекомендуется использовать ограничитель частоты кадров сессии.</string>
|
||||
<string name="game_env_vkd3d_limit">Ограничение частоты кадров D3D12. 0 отключает ограничение.</string>
|
||||
<string name="game_env_glthread">Многопоточность Mesa OpenGL. Для игр OpenGL с ограничением CPU значение true может помочь; тестируйте отдельно для каждой игры.</string>
|
||||
<string name="fex_preset_title">Пресеты FEX</string>
|
||||
<string name="fex_next_launch">Вступит в силу при следующем запуске игры.</string>
|
||||
<string name="game_settings_title">Игра</string>
|
||||
<string name="fex_default_label">FEX по умолчанию</string>
|
||||
<string name="fex_default_detail">Использовать настройки FEX по умолчанию.</string>
|
||||
<string name="fex_stability_label">Стабильность</string>
|
||||
<string name="fex_stability_detail">Самые безопасные и медленные настройки.</string>
|
||||
<string name="fex_compatibility_label">Совместимость</string>
|
||||
<string name="fex_compatibility_detail">Полный TSO + multiblock.</string>
|
||||
<string name="fex_intermediate_label">Средний</string>
|
||||
<string name="fex_intermediate_detail">Сбалансированные настройки TSO со сниженной точностью x87.</string>
|
||||
<string name="fex_performance_label">Производительность</string>
|
||||
<string name="fex_performance_detail">Отключить все TSO; включить multiblock.</string>
|
||||
<string name="fex_performance_tso_label">Производительность + TSO</string>
|
||||
<string name="fex_performance_tso_detail">Настройки производительности с включенным основным TSO.</string>
|
||||
<string name="fex_extreme_label">Экстрим</string>
|
||||
<string name="fex_extreme_detail">Отключить проверку самомодифицирующегося кода. Игры JIT и DRM могут не работать.</string>
|
||||
<string name="fex_extreme_tso_label">Экстрим + TSO</string>
|
||||
<string name="fex_extreme_tso_detail">Настройки экстрим с включенным основным TSO.</string>
|
||||
<string name="fex_extreme_gn_label">Экстрим-gn</string>
|
||||
<string name="fex_extreme_gn_detail">Настройки производительности с включенными TSC и подсказками метаданных. Рекомендуется сначала попробовать этот режим, а затем «Экстрим».</string>
|
||||
<string name="fex_denuvo_label">Denuvo</string>
|
||||
<string name="fex_denuvo_detail">Настройки производительности с включенной полной проверкой кода и скрытием битов гипервизора.</string>
|
||||
<string name="game_env_custom_value">Пользовательское значение</string>
|
||||
<string name="game_env_select_value">Выберите значение</string>
|
||||
<string name="user_apps_section">Эмуляторы и приложения</string>
|
||||
<string name="user_apps_add">Добавить</string>
|
||||
<string name="user_apps_add_detail">Ваше приложение или игра</string>
|
||||
<string name="user_apps_kind_script">Скрипт</string>
|
||||
<string name="user_apps_kind_appimage">AppImage</string>
|
||||
<string name="user_apps_kind_flatpak">Flatpak</string>
|
||||
<string name="user_apps_progress">%1$s · %2$s</string>
|
||||
<string name="user_apps_progress_percent">%1$s · %2$s · %3$d%%</string>
|
||||
<string name="user_apps_starting">Запуск…</string>
|
||||
<string name="user_apps_added">%1$s добавлено</string>
|
||||
<string name="user_apps_removed">%1$s удалено</string>
|
||||
<string name="user_apps_back">Рабочий стол</string>
|
||||
<string name="user_apps_gone">Приложение не существует. Выберите его заново на рабочем столе.</string>
|
||||
<string name="user_apps_open">Открыть %1$s</string>
|
||||
<string name="user_apps_remove">Удалить</string>
|
||||
<string name="user_apps_remove_confirm">Нажмите еще раз для удаления</string>
|
||||
<string name="user_apps_stop_session">Сначала завершите сессию</string>
|
||||
<string name="user_apps_script_linked">Запускает %1$s из своей папки и связывает эту папку с сессией. Удаление приложения не повлияет на папку.</string>
|
||||
<string name="user_apps_script_copied">Запускает %1$s из папки, скопированной в DroidDeck. Удаление приложения удалит копию, но не оригинал.</string>
|
||||
<string name="user_apps_runtime_required">Сначала установите среду выполнения Linux</string>
|
||||
<string name="user_apps_file_gone">Файл не существует</string>
|
||||
<string name="user_apps_no_space">Недостаточно места: для копирования папки требуется %1$s</string>
|
||||
<string name="user_apps_copying">Копирование %1$s</string>
|
||||
<string name="user_apps_failed">Ошибка добавления приложения</string>
|
||||
<string name="user_apps_github_checking">Поиск выпусков %1$s</string>
|
||||
<string name="user_apps_github_unreachable">Не удалось прочитать выпуски %1$s</string>
|
||||
<string name="user_apps_github_no_appimage">%1$s не предоставляет выпуск ARM64 AppImage</string>
|
||||
<string name="user_apps_downloading">Загрузка %1$s</string>
|
||||
<string name="user_apps_download_failed">Ошибка загрузки</string>
|
||||
<string name="user_apps_update_failed">Ошибка обновления приложения</string>
|
||||
<string name="user_apps_icon_failed">Не удалось прочитать иконку</string>
|
||||
<string name="user_apps_saved">%1$s сохранено</string>
|
||||
<string name="user_apps_edit">Изменить</string>
|
||||
<string name="user_apps_check_updates">Проверить обновления</string>
|
||||
<string name="user_apps_checking_updates">Проверка обновлений…</string>
|
||||
<string name="user_apps_update_to">Обновить до %1$s</string>
|
||||
<string name="user_apps_up_to_date">Актуально · %1$s</string>
|
||||
<string name="user_apps_updated">%1$s обновлено</string>
|
||||
<string name="user_apps_github_version">%1$s · %2$s</string>
|
||||
<string name="add_app_title">Добавить приложение</string>
|
||||
<string name="add_app_tab_script">Скрипт</string>
|
||||
<string name="add_app_tab_appimage">AppImage</string>
|
||||
<string name="add_app_tab_github">GitHub</string>
|
||||
<string name="add_app_tab_flatpak">Flatpak</string>
|
||||
<string name="add_app_script_hint">Файл .sh. Запускается из своей папки и отображается в полноэкранном режиме через gamescope.</string>
|
||||
<string name="add_app_appimage_hint">ARM64 (aarch64) AppImage. Распаковывается в среду выполнения Linux при первом использовании.</string>
|
||||
<string name="add_app_github_hint">Установить ARM64 AppImage из последнего выпуска репозитория.</string>
|
||||
<string name="add_app_flatpak_hint">ID приложения Flathub или его страница Flathub. Если Flatpak не настроен, он будет настроен сначала.</string>
|
||||
<string name="add_app_file">Файл</string>
|
||||
<string name="add_app_no_file">Файл не выбран</string>
|
||||
<string name="add_app_choose_file">Выбрать файл</string>
|
||||
<string name="add_app_change_file">Изменить</string>
|
||||
<string name="add_app_pick_script">Выбрать скрипт</string>
|
||||
<string name="add_app_pick_appimage">Выбрать AppImage</string>
|
||||
<string name="add_app_pick_icon">Выбрать иконку</string>
|
||||
<string name="add_app_repository">Репозиторий</string>
|
||||
<string name="add_app_repository_placeholder">owner/repo или ссылка github.com</string>
|
||||
<string name="add_app_repository_invalid">Не является репозиторием GitHub</string>
|
||||
<string name="add_app_flatpak_id">ID приложения</string>
|
||||
<string name="add_app_flatpak_placeholder">org.ppsspp.PPSSPP</string>
|
||||
<string name="add_app_flatpak_invalid">Недействительный ID приложения Flathub</string>
|
||||
<string name="add_app_source">Источник</string>
|
||||
<string name="add_app_appearance">Показывать на рабочем столе</string>
|
||||
<string name="add_app_preview_name">Новое приложение</string>
|
||||
<string name="add_app_name">Название</string>
|
||||
<string name="add_app_name_placeholder">Из приложения</string>
|
||||
<string name="add_app_icon">Иконка</string>
|
||||
<string name="add_app_icon_default">Иконка по умолчанию</string>
|
||||
<string name="add_app_choose_icon">Выбрать иконку</string>
|
||||
<string name="add_app_clear_icon">Очистить</string>
|
||||
<string name="add_app_icon_suggestions">Из репозитория</string>
|
||||
<string name="add_app_icon_searching">Поиск иконок…</string>
|
||||
<string name="add_app_icon_reset">По умолчанию</string>
|
||||
<string name="edit_app_title">Изменить %1$s</string>
|
||||
<string name="edit_app_save">Сохранить</string>
|
||||
<string name="add_app_checking_folder">Проверка папки…</string>
|
||||
<string name="add_app_folder_linked">Папка связана с сессией: %1$s</string>
|
||||
<string name="add_app_folder_copied">Эта папка содержит программы Linux, которые не могут работать из общего хранилища, поэтому она будет скопирована в DroidDeck (%1$s).</string>
|
||||
<string name="add_app_confirm">Добавить</string>
|
||||
<string name="add_app_cancel">Отмена</string>
|
||||
<string name="add_app_runtime_required">Сначала установите среду выполнения Linux в «Настройках».</string>
|
||||
<string name="add_app_busy">Подождите, пока завершится %1$s.</string>
|
||||
<string name="common_cancel">Отмена</string>
|
||||
<string name="common_auto">Авто</string>
|
||||
<string name="common_never">Никогда</string>
|
||||
<string name="common_always">Всегда</string>
|
||||
<string name="common_uninstall">Удалить</string>
|
||||
<string name="common_check">Проверить</string>
|
||||
<string name="common_update">Обновить</string>
|
||||
<string name="common_checking">Проверка…</string>
|
||||
<string name="common_working">Обработка…</string>
|
||||
<string name="common_forget">Забыть</string>
|
||||
<string name="common_add_ellipsis">Добавить…</string>
|
||||
<string name="common_use">Использовать</string>
|
||||
<string name="common_applies_next_session">Вступит в силу в следующей сессии.</string>
|
||||
<string name="mode_steam_title">Сессия Steam</string>
|
||||
<string name="mode_desktop_title">Сессия рабочего стола</string>
|
||||
<string name="mode_display">Экран</string>
|
||||
<string name="mode_resolution">Разрешение</string>
|
||||
<string name="mode_res_720">До 720p</string>
|
||||
<string name="mode_res_900">До 900p</string>
|
||||
<string name="mode_res_1080">До 1080p</string>
|
||||
<string name="mode_res_native">Нативное</string>
|
||||
<string name="mode_res_default">%1$s (по умолчанию)</string>
|
||||
<string name="mode_res_custom_value">Пользовательское · %1$d×%2$d</string>
|
||||
<string name="mode_res_custom">Пользовательское…</string>
|
||||
<string name="mode_res_note">720p может ускорить отклик меню.</string>
|
||||
<string name="mode_ratio">Соотношение сторон</string>
|
||||
<string name="mode_ratio_custom">Задается пользовательским разрешением.</string>
|
||||
<string name="mode_ratio_auto">Автоматический режим использует не менее 16:9.</string>
|
||||
<string name="mode_fps">Ограничение частоты кадров</string>
|
||||
<string name="mode_fps_note">Ограничивает частоту кадров всей сессии. Монитор переключится на частоту обновления, кратную этому пределу.</string>
|
||||
<string name="mode_hdr">HDR</string>
|
||||
<string name="mode_hdr10">Вывод HDR10</string>
|
||||
<string name="mode_hdr_unavailable">Недоступно: %1$s.</string>
|
||||
<string name="mode_hdr_restart">Вступит в силу после перезапуска приложения.</string>
|
||||
<string name="mode_drivers">Драйверы</string>
|
||||
<string name="mode_gpu_drivers">Драйверы GPU</string>
|
||||
<string name="mode_gpu_drivers_hint">Общие для Steam и рабочего стола. Настройте на странице «Компоненты».</string>
|
||||
<string name="mode_touch_controls">Сенсорный ввод и управление</string>
|
||||
<string name="mode_touch">Сенсорный</string>
|
||||
<string name="mode_touch_touchpad">Тачпад</string>
|
||||
<string name="mode_touch_direct">Прямой</string>
|
||||
<string name="mode_touch_note">Авто: тачпад для рабочего стола, прямой сенсорный ввод для Steam.</string>
|
||||
<string name="mode_osc">Экранные элементы управления</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Автоматический режим показывает экранные элементы управления, если контроллер не подключен.</string>
|
||||
<string name="mode_controller">Контроллер</string>
|
||||
<string name="mode_controller_hint">Как Steam распознает ваш контроллер. Вступит в силу в следующей сессии.</string>
|
||||
<string name="mode_controller_deck">Контроллер Steam Deck</string>
|
||||
<string name="mode_controller_x360">Контроллер Xbox 360</string>
|
||||
<string name="mode_controller_note">Deck: кнопка быстрого доступа и гироскоп. Xbox 360: используйте Guide+A для быстрого доступа.</string>
|
||||
<string name="mode_back">Назад</string>
|
||||
<string name="mode_session">Сессия</string>
|
||||
<string name="mode_suspend">Поведение в фоне</string>
|
||||
<string name="mode_suspend_hint">Поведение при скрытии приложения или выключении экрана.</string>
|
||||
<string name="mode_suspend_manual">Вручную</string>
|
||||
<string name="mode_suspend_note">Автоматический режим приостанавливает работу в фоне и возобновляет при отображении. Ручной режим требует нажатия «Продолжить». Никогда не остается запущенным.</string>
|
||||
<string name="mode_startup">Запуск</string>
|
||||
<string name="mode_steam_startup">Запускать Steam при открытии DroidDeck</string>
|
||||
<string name="mode_steam_startup_hint">Открывает сессию Steam при запуске DroidDeck.</string>
|
||||
<string name="mode_decky">Decky</string>
|
||||
<string name="mode_decky_checking">Проверка выпусков…</string>
|
||||
<string name="mode_decky_ready">Готово к установке %1$s.</string>
|
||||
<string name="mode_decky_none">Совместимая версия не найдена. Повторите попытку позже.</string>
|
||||
<string name="mode_decky_installed">Установлено · %1$s</string>
|
||||
<string name="mode_decky_update">Доступно обновление · %1$s</string>
|
||||
<string name="mode_decky_current">Актуально · %1$s</string>
|
||||
<string name="mode_decky_loader">Загрузчик</string>
|
||||
<string name="mode_decky_install_latest">Установить последнюю версию</string>
|
||||
<string name="mode_decky_on">Запускается вместе со Steam. После включения другие приложения на этом устройстве могут управлять Steam.</string>
|
||||
<string name="mode_decky_off">Выкл. Порт удаленной отладки Steam остается закрытым.</string>
|
||||
<string name="mode_decky_remove_title">Удалить Decky Loader?</string>
|
||||
<string name="mode_decky_remove_text">Удаляет загрузчик. Ваши плагины и настройки сохранятся.</string>
|
||||
<string name="mode_client">Клиент</string>
|
||||
<string name="mode_deck_mode">Режим Steam Deck</string>
|
||||
<string name="mode_deck_mode_hint">Интерфейс Steam Deck и управление производительностью через быстрый доступ. Вступит в силу в следующей сессии.</string>
|
||||
<string name="mode_mangoapp">Оверлей производительности</string>
|
||||
<string name="mode_mangoapp_hint">Отключите, если игры падают или появляется черный экран в режиме Deck. Вступит в силу в следующей сессии.</string>
|
||||
<string name="mode_branch">Ветка клиента</string>
|
||||
<string name="mode_branch_deck">Бета-версия Steam Deck (требуется для режима Deck).</string>
|
||||
<string name="mode_branch_hint">Вступит в силу в следующей сессии. Steam может обновиться самостоятельно один раз.</string>
|
||||
<string name="mode_branch_public">Бета</string>
|
||||
<string name="mode_branch_deck_beta">Бета-версия Steam Deck</string>
|
||||
<string name="mode_branch_note">Режим Deck всегда использует бета-версию Steam Deck.</string>
|
||||
<string name="mode_added_games">Добавленные игры</string>
|
||||
<string name="mode_added_none">Папки с играми .exe не найдены</string>
|
||||
<string name="mode_games_folder">Папка с играми</string>
|
||||
<string name="mode_games_folder_another">Другая папка с играми</string>
|
||||
<string name="mode_added_art">Изображения из Steam</string>
|
||||
<string name="mode_added_art_hint">Дополняет отсутствующие изображения по имени папки. Файлы cover.jpg, hero.jpg, logo.png или icon.png в папке с игрой имеют приоритет.</string>
|
||||
<string name="mode_added_launches">Запустить %1$s</string>
|
||||
<string name="mode_added_launches_in">Запустить %1$s · в %2$s</string>
|
||||
<string name="mode_added_choose">Выбрать другой файл…</string>
|
||||
<string name="mode_added_exe_note">По умолчанию используется .exe с именем папки, иначе самый большой .exe.</string>
|
||||
<string name="mode_fill">Растянуть игру на весь экран</string>
|
||||
<string name="mode_fill_hint">Сохраняет полноэкранный режим для игр, поддерживающих изменение размера. Отключите, если игра отображается мелко. Вступит в силу в следующей сессии.</string>
|
||||
<string name="mode_stretch169">Растянуть игры 16:9</string>
|
||||
<string name="mode_stretch169_hint">На экранах с соотношением сторон менее 16:9 растягивает игру на весь экран вместо черных полос. Вступит в силу в следующей сессии.</string>
|
||||
<string name="mode_audio">Аудио</string>
|
||||
<string name="mode_directaudio">Использовать DirectAudio в игре</string>
|
||||
<string name="mode_directaudio_hint">Обходит PulseAudio для снижения задержки.</string>
|
||||
<string name="mode_client_audio">Аудио клиента Steam</string>
|
||||
<string name="mode_client_audio_hint">Вступит в силу в следующей сессии.</string>
|
||||
<string name="mode_client_audio_classic">Классический</string>
|
||||
<string name="mode_client_audio_direct">DirectAudio</string>
|
||||
<string name="mode_mic">Микрофон</string>
|
||||
<string name="mode_mic_hint">Используется для голосового чата.</string>
|
||||
<string name="mode_network">Сеть</string>
|
||||
<string name="mode_wifi_discovery">Обнаружение Wi-Fi</string>
|
||||
<string name="mode_wifi_discovery_hint">Показывает названия Wi-Fi и ближайшие сети в Steam.</string>
|
||||
<string name="mode_wifi_location_off">Службы геолокации отключены.</string>
|
||||
<string name="mode_wifi_permission_denied">Разрешение на определение местоположения не предоставлено.</string>
|
||||
<string name="mode_wifi_open_settings">Открыть настройки</string>
|
||||
<string name="mode_wifi_continue">Продолжить</string>
|
||||
<string name="mode_wifi_explain_title">Включить обнаружение Wi-Fi?</string>
|
||||
<string name="mode_wifi_explain_text">Android требует разрешение на определение местоположения для чтения имен Wi-Fi и обнаружения ближайших сетей. DroidDeck использует это разрешение для отображения этих сетей в Steam. Мы не отслеживаем ваше местоположение. Доступ в интернет возможен и без этого разрешения.</string>
|
||||
<string name="mode_storage">Хранилище игр</string>
|
||||
<string name="mode_storage_auto">Авто - Использовать SD-карту при наличии</string>
|
||||
<string name="mode_storage_auto_none">Авто - Использовать SD-карту при наличии (сейчас нет SD-карты)</string>
|
||||
<string name="mode_storage_internal">Только внутреннее хранилище</string>
|
||||
<string name="mode_storage_folder">Папка: %1$s</string>
|
||||
<string name="mode_second_library">Вторая библиотека</string>
|
||||
<string name="mode_storage_note">Игры, читающие ресурсы с SD-карты или из общего хранилища, могут подтормаживать.</string>
|
||||
<string name="mode_choose_folder">Выбрать папку…</string>
|
||||
<string name="mode_renderer">Рендерер</string>
|
||||
<string name="mode_desktop_renderer">Рендерер рабочего стола</string>
|
||||
<string name="mode_renderer_hint">Отвечает за отрисовку рабочего стола.</string>
|
||||
<string name="mode_renderer_vulkan">vulkan - GPU</string>
|
||||
<string name="mode_renderer_gles2">gles2 - GPU (экспериментально)</string>
|
||||
<string name="mode_renderer_pixman">pixman - Программный</string>
|
||||
<string name="mode_renderer_note">Vulkan использует GPU для запуска программ рабочего стола, при сбое переключается на pixman. При использовании pixman игры по-прежнему запускаются в полноэкранном режиме на GPU.</string>
|
||||
<string name="mode_custom_res_title">Пользовательское разрешение</string>
|
||||
<string name="mode_custom_res_text">Заменяет предел разрешения и соотношение сторон. Размеры, не соответствующие экрану, будут отображаться с черными полосами.</string>
|
||||
<string name="mode_width">Ширина</string>
|
||||
<string name="mode_height">Высота</string>
|
||||
<string name="mode_custom_res_range">Диапазон: от 320×240 до 3840×2160.</string>
|
||||
<plurals name="mode_added_count">
|
||||
<item quantity="one">%1$d игра</item>
|
||||
<item quantity="few">%1$d игры</item>
|
||||
<item quantity="many">%1$d игр</item>
|
||||
<item quantity="other">%1$d игр</item>
|
||||
</plurals>
|
||||
<string name="common_ok">ОК</string>
|
||||
<string name="common_delete">Удалить</string>
|
||||
<string name="common_restore">Восстановить</string>
|
||||
<string name="common_download">Скачать</string>
|
||||
<string name="common_delete_named">Удалить %1$s</string>
|
||||
<string name="common_size_mb">%1$.1f МБ</string>
|
||||
<string name="comp_runtime_driver">Драйвер среды выполнения</string>
|
||||
<string name="comp_runtime_driver_hint">Используется Steam, играми и рабочим столом. Вступит в силу в следующей сессии.</string>
|
||||
<string name="comp_import_turnip">Импорт Turnip zip…</string>
|
||||
<string name="comp_display_driver">Драйвер дисплея</string>
|
||||
<string name="comp_display_driver_hint">Отвечает за вывод изображения на экран в обоих режимах. Вступит в силу после перезапуска приложения.</string>
|
||||
<string name="comp_import_adrenotools">Импорт AdrenoTools zip…</string>
|
||||
<string name="comp_never">Никогда</string>
|
||||
<string name="comp_nightlies_checked">Nightlies проверено %1$s</string>
|
||||
<string name="comp_title">Компоненты</string>
|
||||
<string name="comp_about">О компонентах</string>
|
||||
<string name="comp_check_drivers">Проверить новые драйверы</string>
|
||||
<string name="comp_check_nightlies">Проверить новые пакеты в Nightlies</string>
|
||||
<string name="comp_proton">Proton</string>
|
||||
<string name="comp_proton_note">При обновлении Steam заменяет Proton от Valve; оригинальные файлы каждой сборки сохраняются.</string>
|
||||
<string name="comp_swapped">%1$s · заменено %2$d</string>
|
||||
<string name="comp_all_original">%1$s · все оригинальные файлы</string>
|
||||
<string name="comp_game_running_suffix">%1$s · игра запущена</string>
|
||||
<string name="comp_gpu_drivers">Драйверы GPU</string>
|
||||
<string name="comp_reapplied">%1$s · повторно применено при запуске %2$s</string>
|
||||
<string name="comp_next_queued">Далее: %1$s · после закрытия игры</string>
|
||||
<string name="comp_in_use">Используется %1$s: %2$s</string>
|
||||
<string name="comp_waits">Ожидание закрытия игры</string>
|
||||
<string name="comp_applies_next_game">Вступит в силу при следующем запуске игры</string>
|
||||
<string name="comp_import_zip">Импорт .zip</string>
|
||||
<string name="comp_reading">Чтение Proton…</string>
|
||||
<string name="comp_no_proton">Proton не установлен. Запустите Steam один раз для загрузки ARM64 Proton или добавьте GE-Proton или CachyOS в «Настройках».</string>
|
||||
<string name="comp_original">Оригинал · %1$s</string>
|
||||
<string name="comp_this_build">%1$s · текущая сборка</string>
|
||||
<string name="comp_earlier_build">%1$s · более ранняя сборка</string>
|
||||
<string name="comp_installed_count">Установлено · %1$d</string>
|
||||
<string name="comp_nothing_stored">Для %1$s пока ничего не сохранено. Файлы, поставляемые с этим Proton, будут сохранены как оригинальные.</string>
|
||||
<string name="comp_waits_long">Игра использует этот Proton, поэтому нужно дождаться ее закрытия.</string>
|
||||
<string name="comp_applies_long">Вступит в силу при следующем запуске игры.</string>
|
||||
<string name="comp_swap_title">Заменить %1$s?</string>
|
||||
<string name="comp_swap_body">Поместить %1$s в %2$s? Оригинальные файлы продолжат сохраняться. %3$s</string>
|
||||
<string name="comp_restore_title">Восстановить %1$s?</string>
|
||||
<string name="comp_restore_body">Вернуть оригинальные файлы %1$s в %2$s? %3$s</string>
|
||||
<string name="comp_delete_package_body">Удалить пакет из приложения. Его можно будет скачать снова.</string>
|
||||
<string name="comp_delete_original_title">Удалить оригинальную версию?</string>
|
||||
<string name="comp_delete_original_body">Эта оригинальная версия %1$s из более ранней сборки %2$s. Оригинальная версия текущей сборки всегда сохраняется.</string>
|
||||
<string name="comp_nightlies_count">В Nightlies · %1$d</string>
|
||||
<string name="comp_refresh_to_list">Обновить, чтобы показать пакеты в Nightlies.</string>
|
||||
<string name="comp_nothing_new">С момента последней проверки нового нет.</string>
|
||||
<string name="comp_import_wcp">Импорт .wcp</string>
|
||||
<string name="comp_restore_original">Восстановить оригинальные файлы этого Proton</string>
|
||||
<string name="comp_restore_original_body">Вернуть оригинальные файлы %2$s из %1$s?</string>
|
||||
<string name="comp_swap">Переключить</string>
|
||||
<string name="comp_about_text">FEX, DXVK и VKD3D-Proton: для каждого Proton, используемого Steam для запуска игр.\n\nВыберите установленный элемент, чтобы заменить его. Это вступит в силу при следующем запуске игры или после закрытия текущей запущенной игры.\n\nВаш выбор будет перепроверяться перед каждым запуском; если он был изменен, он будет восстановлен. Оригинальные файлы каждого Proton сохраняются, поэтому обновления Steam никогда их не потеряют.</string>
|
||||
<string name="comp_tag_original">Оригинал</string>
|
||||
<string name="comp_tag_in_use">Используется</string>
|
||||
<string name="comp_tag_new">Новый</string>
|
||||
<string name="comp_tag_stored">Сохранено</string>
|
||||
<string name="perf_title">Производительность</string>
|
||||
<string name="perf_lede">Ядра CPU, исправления сессии и имя хоста. Вступит в силу в следующей сессии.</string>
|
||||
<string name="perf_client_cores_group">Ядра клиента Steam</string>
|
||||
<string name="perf_override">Переопределить выбор ядер Steam</string>
|
||||
<string name="perf_override_hint">Закрепить Steam, помощник интерфейса и gamescope за выбранными ниже ядрами.</string>
|
||||
<string name="perf_client_cores">Ядра клиента</string>
|
||||
<string name="perf_client_cores_on">Ядра, используемые Steam.</string>
|
||||
<string name="perf_client_cores_off">Включите переопределение для выбора.</string>
|
||||
<string name="perf_game_cores_group">Ядра игры</string>
|
||||
<string name="perf_game_cores">Ядра игры</string>
|
||||
<string name="perf_game_cores_hint">Ядра, используемые играми. При выборе всех ядер Android планирует свободно.</string>
|
||||
<string name="perf_client_ui">Интерфейс клиента</string>
|
||||
<string name="perf_glthread">Многопоточность GL</string>
|
||||
<string name="perf_glthread_hint">Может ускорить отклик меню Steam.</string>
|
||||
<string name="perf_zink">Zink: отложенные дескрипторы</string>
|
||||
<string name="perf_zink_hint">Рекомендуется для драйверов без буфера дескрипторов.</string>
|
||||
<string name="perf_noglerror">Пропустить проверку ошибок GL</string>
|
||||
<string name="perf_noglerror_hint">Отключить проверку GL для каждого вызова.</string>
|
||||
<string name="perf_gsrealtime">gamescope: очередь GPU в реальном времени</string>
|
||||
<string name="perf_gsrealtime_hint">Повышает приоритет работы GPU композитора. Может улучшить стабильность времени кадра, но потребляет часть производительности игры.</string>
|
||||
<string name="perf_gpu">GPU</string>
|
||||
<string name="perf_gpuclock">Поддерживать максимальную частоту GPU</string>
|
||||
<string name="perf_gpuclock_hint">Только для Adreno. Меньше подтормаживаний, но больше энергопотребления и нагрева.</string>
|
||||
<string name="perf_fixes">Исправления сессии</string>
|
||||
<string name="perf_sysmem">Turnip: рендеринг sysmem</string>
|
||||
<string name="perf_sysmem_hint">Steam и большинство игр будут быстрее. Требуется для Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">Пропустить помощник xalia в Steam</string>
|
||||
<string name="perf_xalia_hint">Отключает помощник навигации геймпада Proton, который потребляет CPU в каждой игре.</string>
|
||||
<string name="perf_seccomp">Запускать proot без seccomp</string>
|
||||
<string name="perf_seccomp_hint">Может исправить ошибки отсутствующих системных вызовов на некоторых ядрах, но может снизить производительность.</string>
|
||||
<string name="perf_fastpath">Быстрый путь proot</string>
|
||||
<string name="perf_fastpath_needs_seccomp">Требуется фильтр seccomp для proot.</string>
|
||||
<string name="perf_fastpath_hint">Быстрый поиск файлов, меньше подтормаживаний. Отключите, если программа не находит файлы.</string>
|
||||
<string name="perf_identity">Идентификация сессии</string>
|
||||
<string name="perf_hostname">Имя хоста</string>
|
||||
<string name="perf_hostname_hint">Имя, под которым Steam видит это устройство. Оставьте пустым, чтобы вернуть %1$s.</string>
|
||||
<string name="perf_hostname_invalid">Только буквы, цифры и дефисы посередине, до 63 символов.</string>
|
||||
<string name="perf_phantom_warning">Android настроен на завершение этой сессии</string>
|
||||
<string name="driver_installed">Установлен</string>
|
||||
<string name="driver_available">Доступен для скачивания</string>
|
||||
<string name="driver_nothing_new">С момента последней проверки нового нет.</string>
|
||||
<string name="driver_restore_builtin">Восстановить встроенный драйвер</string>
|
||||
<string name="driver_delete_builtin">Встроенный драйвер приложения: удалит распакованные файлы и скроет драйвер. Используйте «Восстановить встроенный драйвер» для восстановления.</string>
|
||||
<string name="driver_delete_bundle">Половина пакета Android + Linux: обе части будут удалены. Используемый драйвер вернется к драйверу по умолчанию.</string>
|
||||
<string name="driver_delete_plain">Файлы будут удалены из приложения.</string>
|
||||
<string name="driver_delete_in_use">Файлы будут удалены. Поскольку драйвер используется, будет применен драйвер по умолчанию.</string>
|
||||
<string name="drawer_page_display">Экран</string>
|
||||
<string name="drawer_page_controls">Управление</string>
|
||||
<string name="drawer_page_components">Компоненты</string>
|
||||
<string name="drawer_page_settings">Настройки</string>
|
||||
<string name="drawer_page_desc">Страница %1$s</string>
|
||||
<string name="drawer_steam">Steam</string>
|
||||
<string name="drawer_desktop">Рабочий стол</string>
|
||||
<string name="drawer_steam_menu">Меню Steam</string>
|
||||
<string name="drawer_quick_access">Быстрый доступ</string>
|
||||
<string name="drawer_open_qam">Открыть меню быстрого доступа</string>
|
||||
<string name="drawer_prev_page">Предыдущая страница</string>
|
||||
<string name="drawer_next_page">Следующая страница</string>
|
||||
<string name="drawer_hud">HUD производительности</string>
|
||||
<string name="drawer_fill">Растянуть игру на весь экран</string>
|
||||
<string name="drawer_touch_auto">Авто (%1$s)</string>
|
||||
<string name="drawer_keyboard">Клавиатура</string>
|
||||
<string name="drawer_pc_keyboard">Клавиатура ПК</string>
|
||||
<string name="drawer_android_keyboard">Android</string>
|
||||
<string name="drawer_second_screen">Второй экран</string>
|
||||
<string name="drawer_second_screen_shows">Показывать</string>
|
||||
<string name="drawer_android_apps">Приложения Android</string>
|
||||
<string name="drawer_launch_app">Запустить приложение</string>
|
||||
<string name="common_hide">Скрыть</string>
|
||||
<string name="common_show">Показать</string>
|
||||
<string name="drawer_no_apps">Нет приложений для запуска</string>
|
||||
<string name="drawer_session_behavior">Поведение сессии</string>
|
||||
<string name="drawer_suspend_hint">Применяется сразу и действует для будущих сессий этого режима.</string>
|
||||
<string name="drawer_next_session">Следующая сессия</string>
|
||||
<string name="drawer_support">Поддержка</string>
|
||||
<string name="drawer_logs">Журналы сессии</string>
|
||||
<string name="drawer_logs_hint">Прикрепить к отчету об ошибке</string>
|
||||
<string name="drawer_share_logs">Поделиться журналами</string>
|
||||
<string name="drawer_background">Фон</string>
|
||||
<string name="drawer_stop">Остановить</string>
|
||||
<string name="drawer_stop_title">Остановить сессию?</string>
|
||||
<string name="drawer_running_now">Сейчас выполняется</string>
|
||||
<string name="drawer_no_game">Сейчас нет игр, запущенных через Proton</string>
|
||||
<string name="drawer_no_proton">Proton не установлен.</string>
|
||||
<string name="drawer_game_running">Игра запущена</string>
|
||||
<string name="drawer_reapplied">Повторно применено при запуске %1$s</string>
|
||||
<string name="drawer_original">Оригинал</string>
|
||||
<string name="drawer_components_note">Скачивайте, импортируйте и удаляйте на странице «Компоненты».</string>
|
||||
<string name="setup_check_done">Готово</string>
|
||||
<string name="setup_check_warn">Требует внимания</string>
|
||||
<string name="setup_check_busy">Обработка</string>
|
||||
<string name="setup_limit_adb_failed">Проверьте IP-адрес и порт отладки по Wi-Fi; если Android удалил устройство, выполните повторное сопряжение.</string>
|
||||
<string name="setup_install">Установить</string>
|
||||
<string name="setup_manage">Управление</string>
|
||||
<string name="setup_tab_overview">Обзор</string>
|
||||
<string name="setup_tab_controller">Контроллер</string>
|
||||
<string name="setup_tab_session">Сессия</string>
|
||||
<string name="setup_tab_launcher">Лаунчер</string>
|
||||
<string name="setup_title">Настройка</string>
|
||||
<string name="setup_all_set">● Все готово</string>
|
||||
<string name="setup_n_ready">%1$d/%2$d готово</string>
|
||||
<string name="setup_system_check">Проверка системы</string>
|
||||
<string name="setup_gpu_supported">Устройство поддерживается</string>
|
||||
<string name="setup_gpu_untested">Непроверенный GPU</string>
|
||||
<string name="setup_gpu_unsupported">GPU не поддерживается</string>
|
||||
<string name="setup_gpu_detail">%1$s · %2$s</string>
|
||||
<string name="setup_gpu_untested_detail">%1$s: %2$s</string>
|
||||
<string name="setup_gpu_unsupported_detail">Steam требует драйвер Adreno; на %1$s возможен черный экран.</string>
|
||||
<string name="setup_runtime">Среда выполнения Linux</string>
|
||||
<string name="setup_runtime_progress">%1$s · %2$d%%</string>
|
||||
<string name="setup_runtime_missing">Не установлено · около 3 ГБ, устанавливается при первом запуске игры</string>
|
||||
<string name="setup_installed">Установлено</string>
|
||||
<string name="setup_runtime_update">%1$s · доступно обновление</string>
|
||||
<string name="setup_runtime_current">%1$s · актуально</string>
|
||||
<string name="setup_limit">Ограничение дочерних процессов</string>
|
||||
<string name="setup_limit_on">Включено · Android может закрыть Steam. Отключение занимает около минуты.</string>
|
||||
<string name="setup_limit_unset">Не задано · Android может закрыть Steam. Отключение занимает около минуты.</string>
|
||||
<string name="setup_limit_unknown">Невозможно проверить · отключение занимает около минуты.</string>
|
||||
<string name="setup_fix_it">Исправить</string>
|
||||
<string name="setup_details">Подробности</string>
|
||||
<string name="setup_dev_options">Для разработчиков</string>
|
||||
<string name="setup_use_wireless">Использовать отладку по Wi-Fi</string>
|
||||
<string name="setup_check_again">Проверить снова</string>
|
||||
<string name="setup_limit_turn_on">Включить ограничение</string>
|
||||
<string name="setup_account">Аккаунт Steam</string>
|
||||
<string name="setup_signed_in_offline">Вход выполнен как %1$s · автономный режим</string>
|
||||
<string name="setup_signed_in">Вход выполнен как %1$s</string>
|
||||
<string name="setup_sign_in">Нажмите Play и войдите в Steam</string>
|
||||
<string name="setup_tools">Инструменты</string>
|
||||
<string name="setup_controller">Контроллер</string>
|
||||
<string name="setup_controller_unavailable">Настройки контроллера недоступны.</string>
|
||||
<string name="setup_session">Сессия</string>
|
||||
<string name="setup_logs">Журналы сессии</string>
|
||||
<string name="setup_logs_hint">Сохраняется после каждой сессии</string>
|
||||
<string name="setup_latest_logs">Последние журналы сессии</string>
|
||||
<string name="setup_saved_logs">Сохраненные журналы сессии</string>
|
||||
<string name="setup_saved_logs_hint">Хранить последние %1$d</string>
|
||||
<string name="setup_clear_logs">Очистить журналы</string>
|
||||
<string name="setup_offline">Автономный режим</string>
|
||||
<string name="setup_sign_in_first">Сначала войдите в Steam</string>
|
||||
<string name="setup_launcher">Лаунчер</string>
|
||||
<string name="setup_theme">Тема</string>
|
||||
<string name="setup_theme_hint">Внешний вид лаунчера</string>
|
||||
<string name="setup_home">Использовать как главный экран</string>
|
||||
<string name="setup_home_on">DroidDeck может использоваться как приложение главного экрана</string>
|
||||
<string name="setup_home_off">DroidDeck не будет доступен как приложение главного экрана</string>
|
||||
<string name="setup_fullscreen">Полноэкранный режим</string>
|
||||
<string name="setup_fullscreen_on">Скрыть строку состояния и навигации Android</string>
|
||||
<string name="setup_fullscreen_off">Показать строку состояния и навигации Android</string>
|
||||
<string name="setup_default_home">Приложение главного экрана по умолчанию</string>
|
||||
<string name="setup_choose_home">Выбрать приложение главного экрана</string>
|
||||
<string name="setup_choose">Выбрать</string>
|
||||
<string name="setup_linux_apps">Приложения Linux (бета)</string>
|
||||
<string name="setup_store">Магазин Flathub</string>
|
||||
<string name="setup_store_on">Показывается в меню. Некоторые приложения могут не запускаться; журналы в Download/DroidDeck.</string>
|
||||
<string name="setup_store_off">Устанавливать приложения и игры Linux из Flathub</string>
|
||||
<string name="setup_tool_files">Файлы</string>
|
||||
<string name="setup_tool_files_hint">Просмотр и управление файлами</string>
|
||||
<string name="setup_tool_protons">Версии Proton</string>
|
||||
<string name="setup_tool_protons_hint">Установить сборки ARM64 Proton</string>
|
||||
<string name="setup_tool_performance">Производительность</string>
|
||||
<string name="setup_tool_performance_hint">Распределение ядер CPU</string>
|
||||
<string name="setup_tool_roms">Папки ROM</string>
|
||||
<string name="setup_tool_roms_hint">Место хранения игр эмулятора</string>
|
||||
<string name="setup_card_components">Компоненты</string>
|
||||
<string name="setup_card_components_hint">FEX, DXVK, VKD3D</string>
|
||||
<string name="setup_card_controls">Управление</string>
|
||||
<string name="setup_card_controls_hint">Сопоставление клавиш</string>
|
||||
<string name="store_tab_discover">Обзор</string>
|
||||
<string name="store_tab_search">Поиск</string>
|
||||
<string name="store_tab_installed">Установлено</string>
|
||||
<string name="store_tab_count">%1$s · %2$d</string>
|
||||
<string name="store_title">Магазин</string>
|
||||
<string name="store_chip_flathub">Flathub · ARM64</string>
|
||||
<string name="store_chip_ready">● Flatpak готов</string>
|
||||
<string name="store_needs_runtime">Сначала установите среду выполнения Linux в «Настройках».</string>
|
||||
<string name="store_setup_title">Настройка Flatpak</string>
|
||||
<string name="store_setup_text">Добавление Flatpak и подключение к Flathub (около 20 МБ). Первое приложение также загрузит свою среду выполнения.</string>
|
||||
<string name="store_setting_up">Настройка…</string>
|
||||
<string name="store_flatpak">Flatpak</string>
|
||||
<string name="store_updates">Обновления</string>
|
||||
<string name="store_busy">%1$s · %2$s</string>
|
||||
<string name="store_busy_percent">%1$s · %2$s · %3$d%%</string>
|
||||
<string name="store_starting">Запуск…</string>
|
||||
<string name="store_categories">Категории</string>
|
||||
<string name="store_unreachable">Не удалось подключиться к Flathub. Проверьте подключение к сети и повторите попытку.</string>
|
||||
<string name="store_try_again">Повторить</string>
|
||||
<string name="store_search_label">Поиск в Flathub</string>
|
||||
<string name="store_search_placeholder">Firefox, игры, эмуляторы…</string>
|
||||
<string name="store_search">Поиск</string>
|
||||
<string name="store_all">Все</string>
|
||||
<string name="store_searching">Поиск…</string>
|
||||
<string name="store_search_hint">Ищите по названию или выберите категорию. Здесь перечислены только приложения ARM64.</string>
|
||||
<string name="store_no_results">В Flathub нет подходящих приложений ARM64.</string>
|
||||
<string name="store_results">Результаты</string>
|
||||
<string name="store_check_updates">Проверить обновления</string>
|
||||
<string name="store_update_all">Обновить все (%1$d)</string>
|
||||
<string name="store_all_current">● Все актуально</string>
|
||||
<string name="store_no_apps">Приложений пока нет. Ищите в «Обзоре» или «Поиске».</string>
|
||||
<string name="store_setup_first_note">Настройте Flatpak, чтобы устанавливать приложения.</string>
|
||||
<string name="store_update_available_prefix">Доступно обновление · %1$s</string>
|
||||
<string name="store_open">Открыть</string>
|
||||
<string name="store_details">Подробности</string>
|
||||
<string name="store_remove">Удалить</string>
|
||||
<string name="store_press_again">Нажмите еще раз для удаления</string>
|
||||
<string name="store_installing">Установка…</string>
|
||||
<string name="store_install">Установить</string>
|
||||
<string name="store_setup_first">Сначала настройте Flatpak</string>
|
||||
<string name="store_download_size">Скачать %1$s</string>
|
||||
<string name="store_installed_chip">● Установлено</string>
|
||||
<string name="store_details_failed">Не удалось загрузить страницу Flathub этого приложения.</string>
|
||||
<string name="store_loading">Загрузка из Flathub…</string>
|
||||
<string name="store_no_arm">В Flathub нет сборки ARM64, поэтому установка здесь невозможна.</string>
|
||||
<string name="store_screenshots">Скриншоты</string>
|
||||
<string name="store_about">О приложении</string>
|
||||
<string name="store_app_id">ID приложения</string>
|
||||
<string name="store_license">Лицензия</string>
|
||||
<string name="store_runtime">Среда выполнения</string>
|
||||
<string name="store_installed_size">Установленный размер</string>
|
||||
<string name="store_installed_size_value">%1$s (плюс общая среда выполнения)</string>
|
||||
<string name="store_website">Веб-сайт</string>
|
||||
<string name="store_verified">Проверено</string>
|
||||
<string name="upd_title">Обновления</string>
|
||||
<string name="upd_build">DroidDeck %1$s · %2$s</string>
|
||||
<string name="upd_checked">Проверено %1$s</string>
|
||||
<string name="upd_not_checked">Не проверено</string>
|
||||
<string name="upd_perm_title">Разрешить DroidDeck самообновление</string>
|
||||
<string name="upd_perm_text">Включите «Разрешить из этого источника» на следующей странице и вернитесь. Обновление продолжится автоматически.</string>
|
||||
<string name="upd_open_settings">Открыть настройки</string>
|
||||
<string name="upd_not_now">Не сейчас</string>
|
||||
<string name="upd_signed_status">Другая подпись</string>
|
||||
<string name="upd_signed_headline">Невозможно обновить на месте</string>
|
||||
<string name="upd_signed_detail">Эта копия подписана не ключом выпуска DroidDeck, поэтому ее нельзя перезаписать напрямую. Удалите и переключитесь.</string>
|
||||
<string name="upd_available">Доступно обновление</string>
|
||||
<string name="upd_blocked_status">Невозможно установить</string>
|
||||
<string name="upd_switch">Можно переключить</string>
|
||||
<string name="upd_ahead_status">Опережает Stable</string>
|
||||
<string name="upd_ahead_headline">Вы опережаете Stable</string>
|
||||
<string name="upd_ahead_detail">Эта сборка новее последней Stable. Вы переключитесь на Stable после выпуска следующей версии Stable.</string>
|
||||
<string name="upd_gone_status">Тест завершен</string>
|
||||
<string name="upd_gone_headline">Этот тест завершен</string>
|
||||
<string name="upd_gone_detail">Исправление было объединено или отменено. Следите за Preview, чтобы получать последние исправления.</string>
|
||||
<string name="upd_current_status">Актуально</string>
|
||||
<string name="upd_current_headline">У вас последняя версия %1$s</string>
|
||||
<string name="upd_dot_ago">· %1$s</string>
|
||||
<string name="upd_stage_percent">%1$s… %2$d%%</string>
|
||||
<string name="upd_stage">%1$s…</string>
|
||||
<string name="upd_update_button">Обновить %1$s</string>
|
||||
<string name="upd_install_button">Установить %1$s</string>
|
||||
<string name="upd_install_anyway">Все равно установить Stable %1$s</string>
|
||||
<string name="upd_follow_preview">Следить за Preview</string>
|
||||
<string name="upd_stop_session">Остановите текущую сессию перед обновлением.</string>
|
||||
<string name="upd_less">Свернуть</string>
|
||||
<string name="upd_more">Еще</string>
|
||||
<string name="upd_new_stable">DroidDeck %1$s</string>
|
||||
<string name="upd_new_preview">Новая сборка Preview</string>
|
||||
<string name="upd_new_test">Тестовая сборка PR #%1$d</string>
|
||||
<string name="upd_mb">%1$d МБ</string>
|
||||
<string name="upd_channel">Канал обновлений</string>
|
||||
<string name="upd_stable">Stable</string>
|
||||
<string name="upd_stable_hint">Протестированная версия, подходит большинству</string>
|
||||
<string name="upd_version_ago">%1$s · %2$s</string>
|
||||
<string name="upd_preview">Preview</string>
|
||||
<string name="upd_preview_hint">Последние исправления перед Stable</string>
|
||||
<string name="upd_preview_current">Актуально</string>
|
||||
<string name="upd_tests">Тестовые сборки</string>
|
||||
<string name="upd_tests_hint">Попробовать исправление до официального выпуска</string>
|
||||
<string name="upd_tests_none">Сейчас нет</string>
|
||||
<string name="upd_pr">PR #%1$d</string>
|
||||
<string name="upd_not_built">Не собрано для этой копии DroidDeck</string>
|
||||
<string name="upd_updated">%1$s обновлено</string>
|
||||
<string name="upd_test_name">Тестовая версия PR #%1$d</string>
|
||||
<string name="upd_while_ago">Недавно</string>
|
||||
<string name="upd_just_now">Только что</string>
|
||||
<plurals name="upd_tests_count">
|
||||
<item quantity="one">%1$d доступный тест</item>
|
||||
<item quantity="few">%1$d доступных теста</item>
|
||||
<item quantity="many">%1$d доступных тестов</item>
|
||||
<item quantity="other">%1$d доступных тестов</item>
|
||||
</plurals>
|
||||
<plurals name="upd_preview_behind">
|
||||
<item quantity="one">Изменения с момента вашей сборки · Отставание на %1$d сборку</item>
|
||||
<item quantity="few">Изменения с момента вашей сборки · Отставание на %1$d сборки</item>
|
||||
<item quantity="many">Изменения с момента вашей сборки · Отставание на %1$d сборок</item>
|
||||
<item quantity="other">Изменения с момента вашей сборки · Отставание на %1$d сборки</item>
|
||||
</plurals>
|
||||
<plurals name="upd_preview_recent">
|
||||
<item quantity="one">Недавние изменения · %1$d сборка</item>
|
||||
<item quantity="few">Недавние изменения · %1$d сборки</item>
|
||||
<item quantity="many">Недавние изменения · %1$d сборок</item>
|
||||
<item quantity="other">Недавние изменения · %1$d сборки</item>
|
||||
</plurals>
|
||||
<string name="gate_title">Одна настройка Android, которую нужно изменить</string>
|
||||
<string name="gate_eyebrow">Steam</string>
|
||||
<string name="gate_lede">Android останавливает приложения, запускающие множество фоновых процессов, а Steam запускает десятки. До изменения этой настройки игры могут закрываться без сообщения об ошибке.</string>
|
||||
<string name="gate_fix_for_me">Исправить за меня</string>
|
||||
<string name="gate_toggle_steps">Включите «Отключить ограничение дочерних процессов» и вернитесь. Оставьте параметры разработчика включенными, иначе переключатель снова отключится.</string>
|
||||
<string name="gate_open_dev">Открыть параметры разработчика</string>
|
||||
<string name="gate_no_toggle">В этой версии Android нет такого переключателя, поэтому DroidDeck внесет изменения через отладку по Wi-Fi. Это займет около минуты, компьютер не нужен.</string>
|
||||
<string name="gate_needs_wifi">Для отладки по Wi-Fi требуется Wi-Fi. Подойдет любая сеть, интернет не нужен.</string>
|
||||
<string name="gate_needs_notifications">Код сопряжения отобразится в уведомлении. Разрешите DroidDeck отправлять уведомления или используйте «Другой способ».</string>
|
||||
<string name="gate_allow_notifications">Разрешить уведомления</string>
|
||||
<string name="gate_step1">Откройте Настройки → Для разработчиков → Отладка по Wi-Fi и включите ее</string>
|
||||
<string name="gate_step2">Нажмите «Сопряжение устройства с помощью кода»</string>
|
||||
<string name="gate_step3">Введите код сопряжения в уведомлении DroidDeck</string>
|
||||
<string name="gate_waiting">Ожидание окна сопряжения…</string>
|
||||
<string name="gate_code_needed">Окно найдено. Введите код сопряжения из него в уведомление.</string>
|
||||
<string name="gate_status">Статус</string>
|
||||
<string name="gate_polling">Проверка каждые 2 секунды. После отключения этого переключателя страница закроется автоматически.</string>
|
||||
<string name="gate_other_ways">Другие способы</string>
|
||||
<string name="gate_other_toggle">Отладка по Wi-Fi, ручной ввод адреса, ADB на ПК</string>
|
||||
<string name="gate_other_no_toggle">Ручной ввод адреса, ADB на ПК, параметры разработчика</string>
|
||||
<string name="gate_use_wireless_instead">Использовать отладку по Wi-Fi</string>
|
||||
<string name="gate_some_roms">Некоторые ROM все еще предоставляют этот переключатель. Найдите «дочерние процессы» в параметрах разработчика.</string>
|
||||
<string name="gate_manual_hint">Если способ с уведомлением не работает, введите адрес и код сопряжения из окна вручную.</string>
|
||||
<string name="gate_enter_manually">Ввести адрес вручную</string>
|
||||
<string name="gate_from_computer">Использовать ADB с компьютера:</string>
|
||||
<string name="gate_copy_command">Копировать команду</string>
|
||||
<string name="gate_choose_display">Выберите экран для открытия настроек Android.</string>
|
||||
<string name="gate_main_screen">Главный экран</string>
|
||||
<string name="wadb_finding_port">Сопряжено. Поиск порта отладки по Wi-Fi…</string>
|
||||
<string name="wadb_enter_port">Сопряжено. Введите порт из настроек.</string>
|
||||
<string name="wadb_applying">Устройство найдено. Применение настроек…</string>
|
||||
<string name="wadb_apply_failed">Не удалось применить автоматически. Проверьте адрес ниже и повторите попытку. %1$s</string>
|
||||
<string name="wadb_title_wireless">Отладка по Wi-Fi</string>
|
||||
<string name="wadb_title_done">Ограничение дочерних процессов обновлено</string>
|
||||
<string name="wadb_title">Изменить ограничение дочерних процессов</string>
|
||||
<string name="wadb_lede_compact0">Если опции нет, выполните сопряжение через отладку по Wi-Fi.</string>
|
||||
<string name="wadb_lede_compact1">Сопряжено. Проверьте IP-адрес и порт в отладке по Wi-Fi.</string>
|
||||
<string name="wadb_lede_done">Ограничение дочерних процессов обновлено.</string>
|
||||
<string name="wadb_lede0">Если в параметрах разработчика нет настройки дочерних процессов, используйте шаг 2. Откройте Для разработчиков → Отладка по Wi-Fi → Сопряжение устройства с помощью кода.</string>
|
||||
<string name="wadb_lede1">Сопряжено. Используйте адрес ниже или обновите его в разделе Отладка по Wi-Fi → IP-адрес и порт.</string>
|
||||
<string name="wadb_lede_done_long">Ограничение дочерних процессов обновлено через отладку по Wi-Fi.</string>
|
||||
<string name="wadb_confirmed_on">Android подтвердил, что ограничение включено.</string>
|
||||
<string name="wadb_confirmed_off">Android подтвердил, что ограничение отключено.</string>
|
||||
<string name="wadb_pair_group">2 · Сопряжение отладки по Wi-Fi</string>
|
||||
<string name="wadb_pair_address">IP-адрес и порт из окна сопряжения</string>
|
||||
<string name="wadb_pin">Код сопряжения (PIN)</string>
|
||||
<string name="wadb_pin_placeholder">6 цифр</string>
|
||||
<string name="wadb_pair">Сопряжение</string>
|
||||
<string name="wadb_apply_group">2 · Применение через отладку по Wi-Fi</string>
|
||||
<string name="wadb_connect_address">Подключить IP-адрес и порт</string>
|
||||
<string name="wadb_pair_again">Сопряжение заново</string>
|
||||
<string name="wadb_turn_off">Отключить ограничение</string>
|
||||
<string name="wadb_other_ways">Другие способы изменения</string>
|
||||
<string name="wadb_dev_try_first">1 · Для разработчиков (попробовать первым)</string>
|
||||
<string name="wadb_restrict_on">Включите «Ограничение дочерних процессов».</string>
|
||||
<string name="wadb_restrict_off">Отключите «Ограничение дочерних процессов».</string>
|
||||
<string name="wadb_computer_last">3 · ADB на ПК (крайняя мера)</string>
|
||||
<string name="wadb_only_if">Используйте только если отладка по Wi-Fi недоступна.</string>
|
||||
<string name="wadb_computer_group">3 · ADB на ПК (крайняя мера)</string>
|
||||
<string name="ctrl_osc_hint">При показе экранных элементов управления в сессии</string>
|
||||
<string name="ctrl_color">Цвет</string>
|
||||
<string name="ctrl_color_hint">Оттенок экранных кнопок</string>
|
||||
<string name="ctrl_custom">Пользовательский</string>
|
||||
<string name="ctrl_opacity">Непрозрачность</string>
|
||||
<string name="ctrl_percent">%1$d%%</string>
|
||||
<string name="ctrl_size">Размер кнопок</string>
|
||||
<string name="ctrl_size_hint" formatted="false">100% — стандартный размер</string>
|
||||
<string name="ctrl_stick_click">Нажатие стика</string>
|
||||
<string name="ctrl_stick_click_hint">Дважды нажмите и удерживайте стик для L3 или R3</string>
|
||||
<string name="ctrl_adaptive">Адаптивный стик</string>
|
||||
<string name="ctrl_rumble">Вибрация игры</string>
|
||||
<string name="ctrl_steam_button">Кнопка Steam</string>
|
||||
<string name="ctrl_qam_button">Кнопка QAM</string>
|
||||
<string name="ctrl_keyboard_button">Кнопка клавиатуры</string>
|
||||
<string name="setup_animations">Анимации</string>
|
||||
<string name="ctrl_adaptive_hint">Стик появится в месте касания и скроется после отпускания</string>
|
||||
<string name="ctrl_layout">Раскладка</string>
|
||||
<string name="ctrl_layout_custom">Сохранена пользовательская позиция</string>
|
||||
<string name="ctrl_layout_default">Адаптировано под этот экран</string>
|
||||
<string name="ctrl_edit">Изменить</string>
|
||||
<string name="ctrl_reset">Сбросить</string>
|
||||
<string name="ctrl_mapping">Сопоставление кнопок</string>
|
||||
<string name="ctrl_mapping_default">Каждая кнопка отправляет соответствующий исходный ввод</string>
|
||||
<string name="ctrl_mapping_count">%1$d/%2$d кнопок переназначено</string>
|
||||
<string name="ctrl_configure">Настроить</string>
|
||||
<string name="ctrl_reset_all">Сбросить контроллер</string>
|
||||
<string name="ctrl_reset_all_hint">Восстановить все настройки и раскладки контроллера</string>
|
||||
<string name="ctrl_mapping_lede">Настройте ввод, отправляемый каждой экранной кнопкой в игру. «Скрыть» удалит кнопку.</string>
|
||||
<string name="ctrl_onscreen_buttons">Экранные кнопки</string>
|
||||
<string name="ctrl_defaults">По умолчанию</string>
|
||||
<string name="ctrl_reset_mapping">Сбросить сопоставление</string>
|
||||
<string name="content_android_apps">Приложения Android</string>
|
||||
<string name="content_apps_count">%1$d приложений</string>
|
||||
<string name="content_no_android_apps">Не найдено приложений Android для запуска.</string>
|
||||
<string name="content_desktop_installed">● Рабочий стол установлен</string>
|
||||
<string name="content_desktop_first_open">Устанавливается при первом открытии</string>
|
||||
<string name="content_available">Доступно для установки</string>
|
||||
<string name="content_not_installed">Не установлено.</string>
|
||||
<string name="content_not_installed_suffix">%1$s · не установлено</string>
|
||||
<string name="content_open_named">Открыть %1$s</string>
|
||||
<string name="content_games">Игры</string>
|
||||
<string name="content_choose_roms">Выберите папку ROM.</string>
|
||||
<string name="content_retroarch_roms">В RetroArch перейдите в /root/ROMs.</string>
|
||||
<string name="content_add_roms">Добавлено %1$s игр в ROMs/%2$s.</string>
|
||||
<string name="content_install_named">Установить %1$s</string>
|
||||
<string name="content_stop_to_install">Остановите сессию для установки</string>
|
||||
<string name="content_runtime_required">Требуется среда выполнения</string>
|
||||
<string name="content_loading_details">Загрузка подробностей установки…</string>
|
||||
<string name="content_details_unavailable">Подробности установки недоступны. Повторите попытку позже.</string>
|
||||
<string name="content_needs_runtime">Сначала установите среду выполнения Linux в «Настройках».</string>
|
||||
<string name="content_stop_first">Остановите текущую сессию перед установкой приложения рабочего стола.</string>
|
||||
<string name="content_install_into">Установить %1$s на рабочий стол Linux.</string>
|
||||
<string name="store_busy_percent_short">%1$s · %2$d%%</string>
|
||||
<string name="content_hide_note">Скрытие удалит его с рабочего стола. Файлы останутся в среде выполнения Linux.</string>
|
||||
<string name="content_rom_gone">Этой игры больше нет в папке ROM.</string>
|
||||
<string name="content_desktop_system">Рабочий стол · %1$s</string>
|
||||
<string name="content_launch_in">Запустить в %1$s</string>
|
||||
<string name="content_also_in">Также в %1$s</string>
|
||||
<string name="content_page_gone">Эта страница больше не существует. Выберите раздел слева.</string>
|
||||
<string name="content_open_desktop">Открыть рабочий стол</string>
|
||||
<string name="content_install_open_desktop">Установить и открыть рабочий стол</string>
|
||||
<string name="content_linux_desktop">Рабочий стол Linux</string>
|
||||
<string name="content_linux_desktop_hint">LXQt, Firefox и ваши эмуляторы</string>
|
||||
<string name="games_empty">Игры, установленные в Steam, появятся здесь после завершения сессии.</string>
|
||||
<string name="games_play_steam">Запустить Steam</string>
|
||||
<string name="games_launch_settings">Настройки запуска</string>
|
||||
<string name="games_launch">Запустить</string>
|
||||
<string name="games_files">Файлы игры</string>
|
||||
<string name="games_prefix">Префикс Proton</string>
|
||||
<string name="games_saves_looking">Поиск сохранений…</string>
|
||||
<string name="games_saves_none">Папка сохранений не найдена по имени. При экспорте будет включена вся папка пользователя.</string>
|
||||
<string name="games_saves_folders">%1$d папок сохранений</string>
|
||||
<string name="games_saves_summary">%1$s · %2$d файлов · %3$s</string>
|
||||
<string name="games_kb">%1$d КБ</string>
|
||||
<string name="games_manage_saves">Управление сохранениями</string>
|
||||
<string name="games_saves">Сохранения игры</string>
|
||||
<string name="games_import_saves">Импорт сохранений…</string>
|
||||
<string name="games_import_saves_hint">Архив GameHub или Winlator. Перед импортом текущие сохранения будут сохранены в резервной копии.</string>
|
||||
<string name="games_export_gamehub">Экспорт как архив GameHub…</string>
|
||||
<string name="games_export_gamehub_hint">Подходит для GameHub и BannerHub</string>
|
||||
<string name="games_export_winlator">Экспорт как архив Winlator…</string>
|
||||
<string name="games_export_winlator_hint">Подходит для Winlator, WinNative и Bannerlator</string>
|
||||
<string name="games_open_save_folder">Открыть папку сохранений</string>
|
||||
<string name="games_never_played">Никогда не запускалась</string>
|
||||
<string name="games_runtime_busy_percent">Среда выполнения занята · %1$d%%</string>
|
||||
<string name="games_runtime_busy">Среда выполнения занята</string>
|
||||
<string name="games_runtime_first_play">Установка среды выполнения при первом запуске игры</string>
|
||||
<string name="games_runtime_update">Доступно обновление среды выполнения</string>
|
||||
<string name="games_runtime_ready">● Среда выполнения готова</string>
|
||||
<string name="games_last_played">Последний запуск %1$s</string>
|
||||
<string name="games_internal">Внутреннее хранилище</string>
|
||||
<string name="games_added">Добавленные игры</string>
|
||||
<string name="gpu_auto_hint">Выбирает лучшую комбинацию драйверов для этого GPU и поддерживает ее в актуальном состоянии</string>
|
||||
<string name="gpu_manual_hint">Выбрать комбинацию драйверов вручную</string>
|
||||
<string name="gpu_checking">Проверка драйверов…</string>
|
||||
<string name="gpu_none_listed">Драйверы пока не перечислены. Обновите, чтобы найти драйверы.</string>
|
||||
<string name="gpu_hide_other">Скрыть драйверы других GPU</string>
|
||||
<string name="gpu_show_other">Показать драйверы других GPU</string>
|
||||
<string name="gpu_advanced">Дополнительно</string>
|
||||
<string name="gpu_set_with_display">Настраивается вместе с драйвером дисплея: %1$s включает оба.</string>
|
||||
<string name="gpu_set_with_runtime">Настраивается вместе с драйвером среды выполнения: %1$s включает оба.</string>
|
||||
<string name="gpu_runtime_hint">Используется играми и рабочим столом.</string>
|
||||
<string name="gpu_runtime_default">По умолчанию среды выполнения</string>
|
||||
<string name="gpu_display_hint">Отвечает за вывод изображения на экран. Вступит в силу после перезапуска DroidDeck.</string>
|
||||
<string name="gpu_auto_by_gpu">Авто - Выбор по GPU</string>
|
||||
<string name="gpu_manage">Скачать, импортировать или удалить…</string>
|
||||
<string name="gpu_in_use_caps">Используется</string>
|
||||
<string name="gpu_builtin">Встроенный драйвер DroidDeck</string>
|
||||
<string name="gpu_matched_pair">Драйвер среды выполнения и драйвер дисплея настраиваются вместе как совместимая пара.</string>
|
||||
<string name="gpu_recommended_for">Рекомендуется для этого GPU: %1$s.</string>
|
||||
<string name="gpu_refresh_hint">Обновите, чтобы найти драйверы, подходящие для этого GPU.</string>
|
||||
<string name="gpu_recommended_caps">Рекомендуется</string>
|
||||
<string name="gpu_unavailable">Недоступно</string>
|
||||
<string name="load_runtime">Среда выполнения Linux</string>
|
||||
<string name="load_runtime_detail">Подготовка среды выполнения Linux</string>
|
||||
<string name="load_session">Сессия</string>
|
||||
<string name="load_session_detail">Запуск дисплея и аудио</string>
|
||||
<string name="load_steam">Клиент Steam</string>
|
||||
<string name="load_steam_detail">Проверка Steam и его инструментов совместимости</string>
|
||||
<string name="load_opening_steam">Открытие Steam</string>
|
||||
<string name="load_opening_steam_detail">Ожидание первого кадра Steam</string>
|
||||
<string name="load_desktop">Рабочий стол</string>
|
||||
<string name="load_desktop_detail">Подготовка рабочего стола</string>
|
||||
<string name="load_opening">Открытие</string>
|
||||
<string name="load_opening_detail">Ожидание первого кадра</string>
|
||||
<string name="load_starting_steam">Запуск Steam</string>
|
||||
<string name="load_ended">Сессия завершена</string>
|
||||
<string name="load_step">Шаг %1$d из %2$d</string>
|
||||
<string name="load_steam_paused">Steam приостановлен</string>
|
||||
<string name="deck_tab_grips">Грипсы</string>
|
||||
<string name="deck_tab_left">Левый тачпад</string>
|
||||
<string name="deck_tab_right">Правый тачпад</string>
|
||||
<string name="deck_tab_both">Оба</string>
|
||||
<string name="deck_close">Закрыть управление вторым экраном</string>
|
||||
<string name="deck_open_steam_menu">Открыть меню Steam</string>
|
||||
<string name="deck_left_upper">Слева · Сверху</string>
|
||||
<string name="deck_left_lower">Слева · Снизу</string>
|
||||
<string name="deck_right_upper">Справа · Сверху</string>
|
||||
<string name="deck_right_lower">Справа · Снизу</string>
|
||||
<string name="deck_click">Нажать</string>
|
||||
<string name="deck_right_trackpad">Правый тачпад</string>
|
||||
<string name="deck_left_trackpad">Левый тачпад</string>
|
||||
<string name="second_trackpad">Тачпад</string>
|
||||
<string name="second_show_keyboard">Показать клавиатуру</string>
|
||||
<string name="second_hide_keyboard">Скрыть клавиатуру</string>
|
||||
<string name="second_terminal">Терминал Linux</string>
|
||||
<string name="second_terminal_not_ready">Сессия Linux не готова, терминал недоступен.</string>
|
||||
<string name="rail_steam">Steam</string>
|
||||
<string name="rail_games">Игры</string>
|
||||
<string name="rail_desktop">Рабочий стол</string>
|
||||
<string name="rail_store">Магазин</string>
|
||||
<string name="rail_components">Компоненты</string>
|
||||
<string name="rail_apps">Приложения</string>
|
||||
<string name="rail_setup">Настройка</string>
|
||||
<string name="rail_updates">Обновления</string>
|
||||
<string name="rail_percent">%1$d%%</string>
|
||||
<string name="rail_resume_named">Продолжить %1$s</string>
|
||||
<string name="roms_text">Отображается как /root/ROMs в каждой сессии. Внутреннее хранилище находится в /root/Storage.</string>
|
||||
<string name="roms_none">Папка не выбрана</string>
|
||||
<string name="roms_applies">Вступит в силу в следующей сессии. Поддерживаются SD-карты.</string>
|
||||
<string name="roms_choose">Выбрать папку</string>
|
||||
<string name="roms_change">Изменить папку</string>
|
||||
<string name="proton_lede">Установите сборку ARM64 Proton, затем выберите ее для каждой игры в Steam → Свойства → Совместимость.</string>
|
||||
<string name="proton_stop_first">Остановите текущую сессию перед установкой или удалением инструментов совместимости.</string>
|
||||
<string name="proton_available">Доступные сборки</string>
|
||||
<string name="proton_installed">%1$s установлено</string>
|
||||
<string name="proton_queued">Ожидающий элемент от предыдущего запроса</string>
|
||||
<string name="proton_not_installed">Не установлено</string>
|
||||
<string name="proton_install_now">Установить сейчас</string>
|
||||
<string name="proton_cancel_queued">Отменить очередь</string>
|
||||
<string name="pckb_android">Клавиатура Android</string>
|
||||
<string name="pckb_hide">Скрыть ✕</string>
|
||||
<string name="main_launch_named">Запустить %1$s</string>
|
||||
<string name="main_choose_screen">Выберите экран. Дополнительный экран: %1$s.</string>
|
||||
<string name="main_secondary_gone">Дополнительный экран недоступен.</string>
|
||||
<string name="main_primary">Главный экран</string>
|
||||
<string name="main_secondary">Дополнительный экран</string>
|
||||
<string name="widgets_prev_tab">Предыдущая вкладка</string>
|
||||
<string name="widgets_next_tab">Следующая вкладка</string>
|
||||
<string name="widgets_on">Вкл.</string>
|
||||
<string name="widgets_all_n">Все %1$d</string>
|
||||
<string name="widgets_none">Нет</string>
|
||||
<string name="widgets_n_of_m">%1$d/%2$d</string>
|
||||
<string name="widgets_off">Выкл.</string>
|
||||
<string name="screen_bottom">Нижний экран</string>
|
||||
<string name="game_env_applies">Вступит в силу при следующем запуске игры. Профиль игры переопределит общие настройки.</string>
|
||||
<string name="game_env_other">Выбрать другую игру по ID приложения…</string>
|
||||
<string name="game_env_done">Готово</string>
|
||||
<string name="game_env_default">По умолчанию</string>
|
||||
<string name="game_env_off">Выкл.</string>
|
||||
<string name="game_env_change">Изменить…</string>
|
||||
<string name="game_env_change_title">Изменить переменную</string>
|
||||
<string name="game_env_restore_default">Восстановить по умолчанию</string>
|
||||
<string name="game_env_eyebrow">Игры Proton</string>
|
||||
<string name="pip_title">Картинка в картинке</string>
|
||||
<string name="pip_auto">Автоматически переходить в режим PiP</string>
|
||||
<string name="pip_suspended">Приостановлено</string>
|
||||
<string name="pip_not_ready">PiP станет доступен после готовности сессии.</string>
|
||||
<string name="pip_permission">Разрешите DroidDeck использовать PiP в настройках Android.</string>
|
||||
<string name="pip_unavailable">Android не может открыть PiP.</string>
|
||||
<string name="game_shortcut">Ярлык</string>
|
||||
<string name="game_shortcut_add">Добавить на главный экран</string>
|
||||
<string name="game_shortcut_choose">Выбрать игру</string>
|
||||
<string name="game_shortcut_scanning">Сканирование установленных игр…</string>
|
||||
<string name="game_link_copy">Копировать ссылку запуска</string>
|
||||
<string name="game_link_copied">Ссылка запуска скопирована</string>
|
||||
<string name="game_shortcut_unsupported">Этот лаунчер не может добавлять ярлыки. Используйте «Копировать ссылку запуска».</string>
|
||||
<string name="game_link_invalid">Недействительная ссылка запуска игры.</string>
|
||||
<string name="game_link_missing">Этой игры больше нет в вашей библиотеке DroidDeck.</string>
|
||||
<string name="game_link_session_busy">Остановите текущую сессию перед запуском игры Steam.</string>
|
||||
<string name="game_link_failed">Не удалось отправить игру в Steam. Попробуйте запустить снова.</string>
|
||||
<string name="setup_retry_removal">Повторить удаление</string>
|
||||
<string name="runtime_removing">Удаление</string>
|
||||
<string name="runtime_removal_incomplete">Удаление не завершено</string>
|
||||
<string name="game_file_export">Экспорт файлов игры</string>
|
||||
<string name="game_file_sync">Синхронизировать все файлы игры в папку</string>
|
||||
<string name="game_file_stop_sync">Остановить синхронизацию файлов игры</string>
|
||||
<string name="game_file_folder">Выбрать папку для файлов игры фронтенда</string>
|
||||
<string name="game_file_exported">Файлы игры сохранены в %1$s</string>
|
||||
<string name="game_frontend_files">Файлы фронтенда</string>
|
||||
</resources>
|
||||
@@ -74,21 +74,11 @@
|
||||
<string name="game_env_vkd3d_config">D3D12 的 VKD3D 选项。nodxr 禁用光线追踪;仅供需要它的游戏使用。</string>
|
||||
<string name="game_env_proton_log">设为 1 可生成 Proton 诊断日志。记录日志会降低性能并占用存储。</string>
|
||||
<string name="game_env_wined3d">设为 1 可对 D3D9–11 使用基于 OpenGL 的 WineD3D 代替 DXVK 进行兼容性测试。</string>
|
||||
<string name="game_env_no_ntsync">设为 1 可让此游戏禁用 ntsync(droiddeck-ntsync 或内核驱动);存在对应包时使用 droiddeck-esync,否则使用 droiddeck-fsync。</string>
|
||||
<string name="game_env_no_esync">设为 1 可为此游戏禁用 droiddeck-esync;改用 droiddeck-fsync,若 fsync 也已禁用则使用 droiddeck-ntsync。</string>
|
||||
<string name="game_env_no_fsync">设为 1 可让此游戏禁用 droiddeck-fsync;存在对应包时使用 droiddeck-esync,否则使用 droiddeck-ntsync。</string>
|
||||
<string name="game_env_fsync_first">设为 1 可让此游戏使用 droiddeck-fsync;设为 0 则在有匹配其 Proton 的包时优先使用 droiddeck-esync。</string>
|
||||
<string name="game_env_xalia">设为 0 可为此游戏禁用 Proton 的手柄导航助手。</string>
|
||||
<string name="game_env_hud">针对 D3D9–11 的 DXVK 覆盖层。fps 显示帧率;不设置则隐藏。</string>
|
||||
<string name="game_env_dxvk_config">以英文分号(;)分隔的 DXVK 设置。新版本使用 dxvk.maxFrameRate 限制帧率;日常游戏建议优先使用会话帧率限制。</string>
|
||||
<string name="game_env_vkd3d_limit">D3D12 帧率限制。0 表示不限制。</string>
|
||||
<string name="game_env_glthread">Mesa OpenGL 多线程。true 可能有助于受 CPU 限制的 OpenGL 游戏;请逐个游戏测试。</string>
|
||||
<string name="sync_backend_title">Wine 同步</string>
|
||||
<string name="sync_backend_hint">游戏保持线程同步的方式。将在下次会话生效。</string>
|
||||
<string name="sync_backend_esync">esync</string>
|
||||
<string name="sync_backend_ntsync">ntsync</string>
|
||||
<string name="sync_backend_fsync">fsync</string>
|
||||
<string name="sync_backend_wineserver">wineserver</string>
|
||||
<string name="fex_preset_title">FEX 预设</string>
|
||||
<string name="fex_next_launch">将在下次启动游戏时生效。</string>
|
||||
<string name="game_settings_title">游戏</string>
|
||||
@@ -161,15 +151,6 @@
|
||||
<string name="add_app_script_hint">一个 .sh 文件。它在自己的文件夹中运行,全屏显示在 gamescope 下。</string>
|
||||
<string name="add_app_appimage_hint">ARM64(aarch64)AppImage。只会解包一次到 Linux 运行时中。</string>
|
||||
<string name="add_app_github_hint">从仓库的最新发布版本安装 ARM64 AppImage。</string>
|
||||
<string name="app_fex_title">使用 FEX</string>
|
||||
<string name="app_fex_auto">自动</string>
|
||||
<string name="app_fex_on">开启</string>
|
||||
<string name="app_fex_off">关闭</string>
|
||||
<string name="app_fex_hint">FEX 在此 ARM64 设备上运行 x86 Linux 程序。自动模式会在程序为 x86 构建时启用。</string>
|
||||
<string name="app_fex_x86">%1$s 经由 FEX</string>
|
||||
<string name="app_fex_not_ready">此程序面向 %1$s PC 构建,需经由 FEX 运行,而 FEX 尚未配置。请在登录状态下打开一次 Steam:DroidDeck 会让其下载 FEX 及所需的 Steam Linux Runtime,之后即可打开。</string>
|
||||
<string name="session_end_program">此程序</string>
|
||||
<string name="session_end_fex_missing">%1$s 面向 x86 PC 构建,需经由 FEX 运行,而 FEX 尚未安装。请在登录状态下启动一次 Steam,让其下载 FEX 与 Steam Linux Runtime,然后重新启动。</string>
|
||||
<string name="add_app_flatpak_hint">一个 Flathub 应用 ID 或其 Flathub 页面。若尚未设置 Flatpak 会先进行设置。</string>
|
||||
<string name="add_app_file">文件</string>
|
||||
<string name="add_app_no_file">未选择文件</string>
|
||||
@@ -205,9 +186,6 @@
|
||||
<string name="add_app_cancel">取消</string>
|
||||
<string name="add_app_runtime_required">请先在“配置”中安装 Linux 运行时。</string>
|
||||
<string name="add_app_busy">请等待 %1$s 完成。</string>
|
||||
<string name="steam_compat_label">兼容</string>
|
||||
<string name="proton_compatible_note">在 Steam 兼容性菜单中标记为“%1$s”的构建带有 DroidDeck 的前缀修复,可在此设备启动游戏。默认为 Proton Experimental ARM64(%1$s),安装更新构建后则为 Proton 11.0 ARM64(%1$s)。未带标记的 Valve 官方 Proton 条目无法在此设备启动游戏。</string>
|
||||
<string name="proton_installed_compatible">已安装 %1$s · %2$s</string>
|
||||
<string name="common_cancel">取消</string>
|
||||
<string name="common_auto">自动</string>
|
||||
<string name="common_never">从不</string>
|
||||
@@ -330,8 +308,6 @@
|
||||
<string name="mode_storage_folder">文件夹:%1$s</string>
|
||||
<string name="mode_second_library">第二库</string>
|
||||
<string name="mode_storage_note">从 SD 卡或共享存储流式读取资源的游戏可能出现卡顿。</string>
|
||||
<string name="mode_storage_diagnostics">存储诊断</string>
|
||||
<string name="mode_storage_diagnostics_hint">在分享日志中记录分配结果和存储采样耗时。启用期间可能减慢安装。将在下次会话生效。</string>
|
||||
<string name="mode_choose_folder">选择文件夹…</string>
|
||||
<string name="mode_renderer">渲染器</string>
|
||||
<string name="mode_desktop_renderer">桌面渲染器</string>
|
||||
@@ -368,16 +344,9 @@
|
||||
<string name="comp_check_nightlies">检查 Nightlies 上的新软件包</string>
|
||||
<string name="comp_proton">Proton</string>
|
||||
<string name="comp_proton_note">Steam 更新时会替换 Valve 的 Proton;每个构建的原件都会保留。</string>
|
||||
<string name="comp_default_live">%1$s 现在将运行所有未在 Steam 中单独选择 Proton 的游戏。</string>
|
||||
<string name="comp_default_next">从下次 Steam 启动起,%1$s 将运行所有未单独选择 Proton 的游戏。</string>
|
||||
<string name="comp_default_not_runnable">%1$s 无法在此设备启动游戏,因此不能设为默认。</string>
|
||||
<string name="comp_default_failed">无法保存默认 Proton:%1$s</string>
|
||||
<string name="comp_swapped">%1$s · 已替换 %2$d 项</string>
|
||||
<string name="comp_all_original">%1$s · 全部为原件</string>
|
||||
<string name="comp_game_running_suffix">%1$s · 游戏运行中</string>
|
||||
<string name="comp_esync_pack">%1$s · droiddeck-esync 包</string>
|
||||
<string name="comp_esync_wanted">%1$s · 尚无 droiddeck-esync 包</string>
|
||||
<string name="comp_esync_builtin">%1$s · 内置 esync,无需包</string>
|
||||
<string name="comp_gpu_drivers">GPU 驱动</string>
|
||||
<string name="comp_reapplied">%1$s · 于启动 %2$s 时重新应用</string>
|
||||
<string name="comp_next_queued">下一个:%1$s · 在游戏关闭后</string>
|
||||
@@ -440,12 +409,6 @@
|
||||
<string name="perf_sysmem">Turnip:sysmem 渲染</string>
|
||||
<string name="perf_sysmem_hint">对 Steam 和大多数游戏更快。Adreno 710/720/722 必需。</string>
|
||||
<string name="perf_xalia">跳过 Steam 的 xalia 助手</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync(实验性)</string>
|
||||
<string name="perf_fastsync_hint">Linux ntsync 驱动的用户态替代品,供测试使用。开启时,Proton 使用它代替 droiddeck-esync 和 droiddeck-fsync。适用于 Proton Experimental ARM64、GE-Proton 和 proton-cachyos。将在下次会话生效。</string>
|
||||
<string name="perf_esync">droiddeck-esync</string>
|
||||
<string name="perf_fsync">droiddeck-fsync 优先</string>
|
||||
<string name="perf_fsync_hint">在原始 Proton 文件上运行 Proton 自带的 fsync,由用户态提供 futex_waitv,因此无需任何包,且 Steam 更新 Proton 后立即继续可用。开启时,除 Proton 自身禁用 fsync 的少数游戏外,各游戏优先使用它而非 droiddeck-esync。将在下次会话生效。</string>
|
||||
<string name="perf_esync_hint">游戏的 Windows 线程通过 eventfd 和共享内存相互等待,而非经由 wineserver 往返。使用为该 Proton 构建精确制作的 droiddeck-esync 包;包会自动获取。在新 Proton 构建尚无对应包之前,由 droiddeck-fsync 顶替。将在下次会话生效。</string>
|
||||
<string name="perf_xalia_hint">禁用 Proton 的手柄导航助手,它会在每个游戏中消耗 CPU。</string>
|
||||
<string name="perf_seccomp">不启用 seccomp 运行 proot</string>
|
||||
<string name="perf_seccomp_hint">可能修复某些内核上的缺失系统调用错误。可能降低性能。</string>
|
||||
@@ -466,7 +429,6 @@
|
||||
<string name="driver_delete_plain">它的文件会从应用中移除。</string>
|
||||
<string name="driver_delete_in_use">文件将被移除。该驱动正在使用,将由默认驱动接管。</string>
|
||||
<string name="drawer_page_display">显示</string>
|
||||
<string name="drawer_page_effects">画面效果</string>
|
||||
<string name="drawer_page_controls">控制</string>
|
||||
<string name="drawer_page_components">组件</string>
|
||||
<string name="drawer_page_settings">设置</string>
|
||||
@@ -480,30 +442,6 @@
|
||||
<string name="drawer_next_page">下一页</string>
|
||||
<string name="drawer_hud">性能 HUD</string>
|
||||
<string name="drawer_fill">拉伸游戏填满屏幕</string>
|
||||
<string name="drawer_scaling">缩放模式</string>
|
||||
<string name="drawer_scaling_sharpness">缩放锐度</string>
|
||||
<string name="drawer_effects">屏幕效果</string>
|
||||
<string name="drawer_effects_hint">实时生效。任何效果开启期间会占用少量 GPU 时间。</string>
|
||||
<string name="drawer_look">观感</string>
|
||||
<string name="drawer_look_custom">自定义</string>
|
||||
<string name="drawer_cas">锐化(CAS)</string>
|
||||
<string name="drawer_cas_level">锐化级别</string>
|
||||
<string name="drawer_fake_hdr">伪 HDR</string>
|
||||
<string name="drawer_deband">去色带</string>
|
||||
<string name="drawer_deband_strength">去色带强度</string>
|
||||
<string name="drawer_brightness">亮度</string>
|
||||
<string name="drawer_contrast">对比度</string>
|
||||
<string name="drawer_gamma">伽马</string>
|
||||
<string name="drawer_saturation">饱和度</string>
|
||||
<string name="drawer_fxaa">FXAA(边缘平滑)</string>
|
||||
<string name="drawer_toon">卡通描边</string>
|
||||
<string name="drawer_crt">CRT</string>
|
||||
<string name="drawer_ntsc">NTSC</string>
|
||||
<string name="drawer_texture">纹理过滤</string>
|
||||
<string name="drawer_texture_hint">DirectX 9–11 游戏,下次启动时生效。</string>
|
||||
<string name="drawer_anisotropy">各向异性过滤</string>
|
||||
<string name="drawer_texture_sharpness">纹理锐度</string>
|
||||
<string name="drawer_texture_sharpness_note">负 mipmap 偏移:纹理更锐利,可能有轻微闪烁。自动模式会匹配会话放大到屏幕的程度。</string>
|
||||
<string name="drawer_touch_auto">自动(%1$s)</string>
|
||||
<string name="drawer_keyboard">键盘</string>
|
||||
<string name="drawer_pc_keyboard">PC 键盘</string>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="settings_title">Settings</string>
|
||||
</resources>
|
||||
@@ -203,10 +203,10 @@
|
||||
<string name="add_app_folder_copied">Its folder holds Linux programs, which shared storage cannot run, so it is copied into DroidDeck (%1$s).</string>
|
||||
<string name="add_app_confirm">Add</string>
|
||||
<string name="add_app_cancel">Cancel</string>
|
||||
<string name="add_app_runtime_required">Install the Linux runtime from Setup first.</string>
|
||||
<string name="add_app_runtime_required">Install the Linux runtime from Settings → Support & diagnostics first.</string>
|
||||
<string name="add_app_busy">Wait for %1$s to finish.</string>
|
||||
<string name="steam_compat_label">Compatible</string>
|
||||
<string name="proton_compatible_note">Builds marked “%1$s” in Steam’s Compatibility menu have DroidDeck’s prefix fixes and start games here. The default is Proton Experimental ARM64 (%1$s), or Proton 11.0 ARM64 (%1$s) once that newer build is installed. Valve’s own Proton entries without the mark cannot start a game on this device.</string>
|
||||
<string name="proton_compatible_note">In Steam’s Compatibility menu, choose a build marked “%1$s”. Unmarked Valve builds cannot launch games here.</string>
|
||||
<string name="proton_installed_compatible">Installed %1$s · %2$s</string>
|
||||
<string name="common_cancel">Cancel</string>
|
||||
<string name="common_auto">Auto</string>
|
||||
@@ -291,10 +291,6 @@
|
||||
<string name="mode_branch_public">Public beta</string>
|
||||
<string name="mode_branch_deck_beta">Steam Deck public beta</string>
|
||||
<string name="mode_branch_note">Deck mode always uses Steam Deck public beta.</string>
|
||||
<string name="mode_steam_repair">Repair Steam client</string>
|
||||
<string name="mode_steam_repair_hint">Downloads the Steam client again the next time Steam starts. Use it if Steam stays on its loading screen. Games, sign-in and settings are kept.</string>
|
||||
<string name="mode_steam_repair_queued">The Steam client will be downloaded again the next time Steam starts.</string>
|
||||
<string name="mode_steam_repair_button">Repair</string>
|
||||
<string name="mode_added_games">Added games</string>
|
||||
<string name="mode_added_none">no game folders with a .exe found</string>
|
||||
<string name="mode_games_folder">Games folder</string>
|
||||
@@ -391,7 +387,7 @@
|
||||
<string name="comp_applies_next_game">Applies the next time a game starts</string>
|
||||
<string name="comp_import_zip">Import .zip</string>
|
||||
<string name="comp_reading">Reading Protons…</string>
|
||||
<string name="comp_no_proton">No Proton installed yet. Start Steam once to download its ARM64 Proton, or add GE-Proton or CachyOS from Setup.</string>
|
||||
<string name="comp_no_proton">No Proton installed yet. Start Steam once to download its ARM64 Proton, or add GE-Proton or CachyOS from Settings → Compatibility & performance → Proton versions.</string>
|
||||
<string name="comp_original">Original · %1$s</string>
|
||||
<string name="comp_this_build">%1$s · this build</string>
|
||||
<string name="comp_earlier_build">%1$s · earlier build</string>
|
||||
@@ -474,7 +470,6 @@
|
||||
<string name="drawer_page_effects">Effects</string>
|
||||
<string name="drawer_page_controls">Controls</string>
|
||||
<string name="drawer_page_components">Components</string>
|
||||
<string name="drawer_page_controller">Controller</string>
|
||||
<string name="drawer_page_settings">Settings</string>
|
||||
<string name="drawer_page_desc">%1$s page</string>
|
||||
<string name="drawer_steam">Steam</string>
|
||||
@@ -490,11 +485,8 @@
|
||||
<string name="drawer_scaling_sharpness">Scaling sharpness</string>
|
||||
<string name="drawer_effects">Screen effects</string>
|
||||
<string name="drawer_effects_hint">Live. Costs a little GPU time while any effect is on.</string>
|
||||
<string name="drawer_look">Presets</string>
|
||||
<string name="drawer_look">Look</string>
|
||||
<string name="drawer_look_custom">Custom</string>
|
||||
<string name="drawer_effects_advanced">Advanced</string>
|
||||
<string name="widgets_expanded">Expanded</string>
|
||||
<string name="widgets_collapsed">Collapsed</string>
|
||||
<string name="drawer_cas">Sharpening (CAS)</string>
|
||||
<string name="drawer_cas_level">Sharpening level</string>
|
||||
<string name="drawer_fake_hdr">Fake HDR</string>
|
||||
@@ -518,7 +510,6 @@
|
||||
<string name="drawer_pc_keyboard">PC keyboard</string>
|
||||
<string name="drawer_android_keyboard">Android</string>
|
||||
<string name="drawer_second_screen">Second screen</string>
|
||||
<string name="drawer_second_screen_mode">Mode</string>
|
||||
<string name="drawer_second_screen_shows">Shows</string>
|
||||
<string name="drawer_android_apps">Android apps</string>
|
||||
<string name="drawer_launch_app">Launch an app</string>
|
||||
@@ -595,9 +586,6 @@
|
||||
<string name="setup_offline">Offline mode</string>
|
||||
<string name="setup_sign_in_first">Sign in to Steam first</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_app_scale">App scale</string>
|
||||
<string name="setup_app_scale_hint">DroidDeck text and controls</string>
|
||||
<string name="setup_app_scale_default">%1$d%% (Default)</string>
|
||||
<string name="setup_theme">Theme</string>
|
||||
<string name="setup_theme_hint">Launcher appearance</string>
|
||||
<string name="setup_home">Use as Home screen</string>
|
||||
@@ -632,7 +620,7 @@
|
||||
<string name="store_title">Store</string>
|
||||
<string name="store_chip_flathub">Flathub · ARM64</string>
|
||||
<string name="store_chip_ready">● Flatpak ready</string>
|
||||
<string name="store_needs_runtime">Install the Linux runtime from Setup first.</string>
|
||||
<string name="store_needs_runtime">Install the Linux runtime from Settings → Support & diagnostics first.</string>
|
||||
<string name="store_setup_title">Set up Flatpak</string>
|
||||
<string name="store_setup_text">Adds Flatpak and connects it to Flathub (about 20 MB). The first app also downloads its runtime.</string>
|
||||
<string name="store_setting_up">Setting up…</string>
|
||||
@@ -852,7 +840,7 @@
|
||||
<string name="content_runtime_required">Runtime required</string>
|
||||
<string name="content_loading_details">Loading install details…</string>
|
||||
<string name="content_details_unavailable">Install details are unavailable. Try again later.</string>
|
||||
<string name="content_needs_runtime">Install the Linux runtime from Setup first.</string>
|
||||
<string name="content_needs_runtime">Install the Linux runtime from Settings → Support & diagnostics first.</string>
|
||||
<string name="content_stop_first">Stop the running session to install desktop apps.</string>
|
||||
<string name="content_install_into">Installs %1$s into the Linux desktop.</string>
|
||||
<string name="store_busy_percent_short">%1$s · %2$d%%</string>
|
||||
@@ -1023,31 +1011,4 @@
|
||||
<string name="game_file_folder">Choose a folder for frontend game files</string>
|
||||
<string name="game_file_exported">Game files saved to %1$s</string>
|
||||
<string name="game_frontend_files">Frontend files</string>
|
||||
<string name="display_session">Session display</string>
|
||||
<string name="display_resolution">Resolution</string>
|
||||
<string name="display_game_fit">16:9 game fit</string>
|
||||
<string name="display_game_fit_hint">How 16:9 games fit this display. Next session.</string>
|
||||
<string name="display_game_fit_unavailable">Choose Match screen or a custom size narrower than 16:9.</string>
|
||||
<string name="display_preserve">Keep proportions</string>
|
||||
<string name="display_stretch">Stretch to display</string>
|
||||
<string name="display_image_scaling">Image scaling</string>
|
||||
<string name="display_filter">Scaling filter</string>
|
||||
<string name="display_filter_hint">Shared by Steam and Desktop.</string>
|
||||
<string name="display_filter_live">Applies live. Shared by Steam and Desktop.</string>
|
||||
<string name="display_filter_note">FSR, GSR and NIS apply when enlarging the session image. Sharpen only also works without enlargement.</string>
|
||||
<string name="display_sharpness">Filter sharpness</string>
|
||||
<string name="display_frame_rate">Frame rate</string>
|
||||
<string name="display_window_compatibility">Game window compatibility</string>
|
||||
<string name="display_force_fullscreen">Force game windows fullscreen</string>
|
||||
<string name="display_force_fullscreen_hint">Makes every game window the size of the screen. Turn on if a game comes back small or in a corner after switching apps; leave off if a game flickers between sizes. Applies live during a session.</string>
|
||||
<string name="display_force_fullscreen_live">Turn on if a game comes back small after switching; off if it flickers. Applies live.</string>
|
||||
<string name="display_look_filter">%1$s Sets scaling to %2$s.</string>
|
||||
<string name="display_match_screen">Match screen (%1$d×%2$d)</string>
|
||||
<string name="mode_tab_steam">Steam</string>
|
||||
<string name="device_info_show">Show device details</string>
|
||||
<string name="device_info_hide">Hide device details</string>
|
||||
<string name="device_info_loading">Reading the device…</string>
|
||||
<string name="device_info_copy">Copy</string>
|
||||
<string name="device_info_copy_hint">Copy these details into a bug report.</string>
|
||||
<string name="device_info_copied">Copied.</string>
|
||||
</resources>
|
||||
@@ -4,8 +4,4 @@
|
||||
<locale android:name="en" />
|
||||
<locale android:name="es" />
|
||||
<locale android:name="zh" />
|
||||
<locale android:name="ko" />
|
||||
<locale android:name="fr" />
|
||||
<locale android:name="ja" />
|
||||
<locale android:name="ru" />
|
||||
</locale-config>
|
||||
</locale-config>
|
||||
@@ -27,7 +27,6 @@ class GameFileSyncTest {
|
||||
}
|
||||
val folder = File(context.filesDir, "exports").apply { mkdirs() }
|
||||
GameFileSync.enable(context, folder)
|
||||
assertEquals("8400", File(folder, "Geometry Wars.steam").readText())
|
||||
assertEquals(folder.path, GameFileSync.folder(context))
|
||||
assertEquals(1, folder.listFiles()!!.count { it.extension == GameFiles.EXTENSION })
|
||||
// An unavailable source must leave the existing export intact.
|
||||
@@ -36,8 +35,6 @@ class GameFileSyncTest {
|
||||
assertThrows(IllegalStateException::class.java) { GameFileSync.syncConfigured(context) }
|
||||
assertEquals(1, folder.listFiles()!!.count { it.extension == GameFiles.EXTENSION })
|
||||
assertTrue(unavailable.renameTo(steamapps))
|
||||
GameFileSync.syncConfigured(context)
|
||||
assertTrue(File(folder, "Geometry Wars.steam").exists())
|
||||
// A genuine uninstall removes the owned export at the next tick.
|
||||
assertTrue(manifest.delete())
|
||||
GameFileSync.syncConfigured(context)
|
||||
@@ -47,7 +44,6 @@ class GameFileSyncTest {
|
||||
manifest.writeText("\"name\" \"Geometry Wars\"\n\"StateFlags\" \"4\"")
|
||||
GameFileSync.syncConfigured(context)
|
||||
assertNull(GameFileSync.folder(context))
|
||||
assertFalse(File(folder, "Geometry Wars.steam").exists())
|
||||
assertEquals(0, folder.listFiles()!!.count { it.extension == GameFiles.EXTENSION })
|
||||
}
|
||||
}
|
||||
@@ -28,8 +28,8 @@ class GameFilesTest {
|
||||
@Test fun exportsPortableFilesAndAcceptsFileUriRawPathAndContentUri() {
|
||||
val folder = tmp.newFolder()
|
||||
val file = GameFiles.export(folder, game("18446744073709551615", "A/B: C"))
|
||||
assertEquals("A_B_ C.steam", file.name)
|
||||
assertEquals("18446744073709551615", file.readText())
|
||||
assertEquals("A_B_ C (18446744073709551615).droiddeck", file.name)
|
||||
assertEquals("droiddeck://game/18446744073709551615\n", file.readText())
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
listOf(Uri.fromFile(file), Uri.parse(file.path)).forEach { uri ->
|
||||
assertEquals("18446744073709551615", GameFiles.readIntent(context, Intent(Intent.ACTION_VIEW, uri)))
|
||||
@@ -44,15 +44,15 @@ class GameFilesTest {
|
||||
|
||||
@Test fun rejectsCommandsMalformedIdsLargeFilesAndUnsupportedIntents() {
|
||||
listOf("", "0", "01", "-1", "18446744073709551616", "steam://rungameid/8400",
|
||||
"8400\n8401", "droiddeck://game/8400", "droiddeck://game/8400?command=quit", "x".repeat(129)).forEach { value ->
|
||||
"8400\n8401", "droiddeck://game/8400?command=quit", "x".repeat(129)).forEach { value ->
|
||||
assertNull(value, GameFiles.read(ByteArrayInputStream(value.toByteArray())))
|
||||
}
|
||||
assertEquals("8400", GameFiles.read(ByteArrayInputStream("8400\n".toByteArray())))
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
assertNull(GameFiles.readIntent(context, Intent(Intent.ACTION_SEND, Uri.parse("droiddeck://game/8400"))))
|
||||
assertNull(GameFiles.readIntent(context, Intent(Intent.ACTION_VIEW, Uri.parse("https://example.com/8400.steam"))))
|
||||
assertNull(GameFiles.readIntent(context, Intent(Intent.ACTION_VIEW, Uri.parse("file://remote/game.steam"))))
|
||||
assertNull(GameFiles.readIntent(context, Intent(Intent.ACTION_VIEW, Uri.fromFile(File(tmp.root, "missing.steam")))))
|
||||
assertNull(GameFiles.readIntent(context, Intent(Intent.ACTION_VIEW, Uri.parse("https://example.com/8400.droiddeck"))))
|
||||
assertNull(GameFiles.readIntent(context, Intent(Intent.ACTION_VIEW, Uri.parse("file://remote/game.droiddeck"))))
|
||||
assertNull(GameFiles.readIntent(context, Intent(Intent.ACTION_VIEW, Uri.fromFile(File(tmp.root, "missing.droiddeck")))))
|
||||
assertEquals("8400", GameFiles.readIntent(context, Intent(Intent.ACTION_VIEW, Uri.parse("droiddeck://game/8400"))))
|
||||
}
|
||||
|
||||
@@ -71,8 +71,7 @@ class GameFilesTest {
|
||||
assertEquals("custom artwork", image.readText())
|
||||
GameFiles.sync(folder, emptyList())
|
||||
assertEquals("custom artwork", image.readText())
|
||||
assertEquals("8400", File(folder, GameFiles.filename(game)).readText())
|
||||
assertEquals(1, folder.listFiles { f -> f.extension == GameFiles.EXTENSION }!!.size)
|
||||
assertEquals(0, folder.listFiles { f -> f.extension == GameFiles.EXTENSION }!!.size)
|
||||
icon.delete()
|
||||
val fallback = tmp.newFolder()
|
||||
GameFiles.export(fallback, game)
|
||||
@@ -81,7 +80,7 @@ class GameFilesTest {
|
||||
|
||||
@Test fun syncAddsRenamesAndRemovesOwnedFilesAndPreservesUnrelatedAndEditedFiles() {
|
||||
val folder = tmp.newFolder()
|
||||
val unrelated = File(folder, "manual.steam").apply { writeText("1") }
|
||||
val unrelated = File(folder, "manual.droiddeck").apply { writeText("droiddeck://game/1\n") }
|
||||
val note = File(folder, "notes.txt").apply { writeText("Keep me") }
|
||||
val first = game()
|
||||
val second = game("620", "Portal 2")
|
||||
@@ -111,12 +110,10 @@ class GameFilesTest {
|
||||
GameFiles.sync(folder, listOf(first))
|
||||
val second = game("620", "Portal 2")
|
||||
val collision = File(folder, GameFiles.filename(second)).apply { writeText("personal file") }
|
||||
val fallback = File(folder, GameFiles.filename(second, disambiguate = true)).apply { writeText("another personal file") }
|
||||
assertThrows(IllegalArgumentException::class.java) { GameFiles.sync(folder, listOf(second)) }
|
||||
assertEquals("personal file", collision.readText())
|
||||
assertTrue(File(folder, GameFiles.filename(first)).isFile)
|
||||
collision.delete()
|
||||
fallback.delete()
|
||||
GameFiles.sync(folder, listOf(second))
|
||||
assertFalse(File(folder, GameFiles.filename(first)).exists())
|
||||
assertTrue(collision.isFile)
|
||||
@@ -135,10 +132,10 @@ class GameFilesTest {
|
||||
@Test fun refusesSymlinksLeavingTheExportFolder() {
|
||||
val folder = tmp.newFolder()
|
||||
val outside = tmp.newFile()
|
||||
outside.writeText("8400")
|
||||
outside.writeText("droiddeck://game/8400\n")
|
||||
java.nio.file.Files.createSymbolicLink(File(folder, GameFiles.filename(game())).toPath(), outside.toPath())
|
||||
assertThrows(IllegalArgumentException::class.java) { GameFiles.export(folder, game()) }
|
||||
assertEquals("8400", outside.readText())
|
||||
assertEquals("droiddeck://game/8400\n", outside.readText())
|
||||
}
|
||||
|
||||
@Test fun caseOnlyRenameKeepsTheLiveExportOnCaseInsensitiveStorage() {
|
||||
@@ -151,8 +148,6 @@ class GameFilesTest {
|
||||
assertTrue(file.isFile)
|
||||
assertEquals("8400", file.inputStream().use(GameFiles::read))
|
||||
assertEquals(1, folder.listFiles()!!.count { it.extension == GameFiles.EXTENSION })
|
||||
GameFiles.sync(folder, emptyList())
|
||||
assertFalse(file.exists())
|
||||
}
|
||||
|
||||
@Test fun unrelatedInventoryIsPreserved() {
|
||||
@@ -163,52 +158,6 @@ class GameFilesTest {
|
||||
assertEquals(0, folder.listFiles()!!.count { it.extension == GameFiles.EXTENSION })
|
||||
}
|
||||
|
||||
@Test fun steamExportContainsOnlyIdForSteamAndAddedGames() {
|
||||
val folder = tmp.newFolder()
|
||||
val file = GameFiles.export(folder, game("620", "Portal 2"))
|
||||
assertEquals("Portal 2.steam", file.name)
|
||||
assertEquals("620", file.readText())
|
||||
assertEquals("620", GameFiles.readIntent(RuntimeEnvironment.getApplication(), Intent(Intent.ACTION_VIEW, Uri.fromFile(file))))
|
||||
val added = Library.SteamGame(1, "Added Game", null, Library.ADDED, -1L)
|
||||
val addedFile = GameFiles.export(folder, added)
|
||||
assertEquals("Added Game.steam", addedFile.name)
|
||||
assertEquals("18446744073709551615", addedFile.readText())
|
||||
}
|
||||
|
||||
@Test fun steamSyncDisambiguatesTitlesAndPreservesEditedAndForeignFiles() {
|
||||
val folder = tmp.newFolder()
|
||||
val first = game("620", "A/B")
|
||||
val second = game("8400", "A:B")
|
||||
val foreign = File(folder, "Existing.steam").apply { writeText("1") }
|
||||
val existing = game("1", "Existing")
|
||||
GameFiles.sync(folder, listOf(first, second, existing))
|
||||
val owned = File(folder, "A_B (620).steam")
|
||||
assertEquals("620", owned.readText())
|
||||
assertEquals("8400", File(folder, "A_B (8400).steam").readText())
|
||||
owned.writeText("user edit")
|
||||
GameFiles.sync(folder, listOf(first, second, existing))
|
||||
assertEquals("user edit", owned.readText())
|
||||
GameFiles.sync(folder, emptyList())
|
||||
assertEquals("user edit", owned.readText())
|
||||
assertEquals("1", foreign.readText())
|
||||
assertFalse(File(folder, "A_B (8400).steam").exists())
|
||||
}
|
||||
|
||||
@Test fun steamCollisionFallbackDoesNotClaimAnExistingFile() {
|
||||
val folder = tmp.newFolder()
|
||||
val collision = File(folder, "Geometry Wars.steam").apply { writeText("other file") }
|
||||
val existing = File(folder, "Geometry Wars (8400).steam").apply { writeText("8400") }
|
||||
GameFiles.sync(folder, listOf(game()))
|
||||
GameFiles.sync(folder, emptyList())
|
||||
assertEquals("other file", collision.readText())
|
||||
assertEquals("8400", existing.readText())
|
||||
existing.writeText("another file")
|
||||
assertThrows(IllegalArgumentException::class.java) {
|
||||
GameFiles.sync(folder, listOf(game()))
|
||||
}
|
||||
assertEquals("another file", existing.readText())
|
||||
}
|
||||
|
||||
private class LaunchFileProvider(private val file: File) : ContentProvider() {
|
||||
override fun onCreate() = true
|
||||
override fun openFile(uri: Uri, mode: String): ParcelFileDescriptor = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY)
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.droiddeck.launcher.frontend
|
||||
|
||||
import android.content.Intent
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [33])
|
||||
class GameLaunchIntentTest {
|
||||
@Test fun acceptsNativeAndExplicitlyRetargetedGameNativeProfiles() {
|
||||
listOf(GameLaunchIntent.ACTION, "app.gamenative.LAUNCH_GAME").forEach { action ->
|
||||
val request = Intent(action).putExtra("app_id", 620).putExtra("game_source", "STEAM")
|
||||
assertEquals("620", GameLaunchIntent.read(RuntimeEnvironment.getApplication(), request))
|
||||
assertEquals("8400", GameLaunchIntent.readId(Intent(action).putExtra("app_id", "8400")))
|
||||
assertEquals("620", GameLaunchIntent.readId(request.putExtra("game_source", "steam")))
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun stringIdsPreserveUnsignedShortcutIds() {
|
||||
listOf("2147483648", "18446744073709551615").forEach { id ->
|
||||
assertEquals(id, GameLaunchIntent.readId(Intent(GameLaunchIntent.ACTION).putExtra("app_id", id)))
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun rejectsUnsupportedSourcesTypesAndIdsWithoutFallingBackToData() {
|
||||
listOf("", "0", "01", "+1", "-1", "18446744073709551616", "620\n", "steam://rungameid/620").forEach { id ->
|
||||
assertNull(id, GameLaunchIntent.readId(Intent(GameLaunchIntent.ACTION).putExtra("app_id", id)))
|
||||
}
|
||||
listOf("EPIC", "GOG", "CUSTOM_GAME", "", "STEAM ").forEach { source ->
|
||||
assertNull(GameLaunchIntent.readId(Intent(GameLaunchIntent.ACTION).putExtra("app_id", 620).putExtra("game_source", source)))
|
||||
}
|
||||
assertNull(GameLaunchIntent.readId(Intent(GameLaunchIntent.ACTION).putExtra("app_id", 620L)))
|
||||
assertNull(GameLaunchIntent.readId(Intent(GameLaunchIntent.ACTION).putExtra("app_id", -1)))
|
||||
assertNull(GameLaunchIntent.readId(Intent(GameLaunchIntent.ACTION).putExtra("app_id", 620).putExtra("game_source", 1)))
|
||||
assertNull(GameLaunchIntent.readId(Intent(Intent.ACTION_MAIN).putExtra("app_id", 620)))
|
||||
assertNull(GameLaunchIntent.read(RuntimeEnvironment.getApplication(), Intent(GameLaunchIntent.ACTION,
|
||||
android.net.Uri.parse("droiddeck://game/620"))))
|
||||
}
|
||||
|
||||
@Test fun deepLinksStillAcceptUnsignedShortcutIds() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
assertEquals("18446744073709551615", GameLaunchIntent.read(context,
|
||||
Intent(Intent.ACTION_VIEW, android.net.Uri.parse("droiddeck://game/18446744073709551615"))))
|
||||
assertFalse(GameLaunchIntent.accepts(Intent.ACTION_SEND))
|
||||
assertTrue(GameLaunchIntent.accepts(GameLaunchIntent.ACTION))
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.droiddeck.launcher.gpu
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class GpuModelFallbackTest {
|
||||
@Test fun aPlatformCodeNameGivesItsAdreno() {
|
||||
// AYANEO's Pocket FIT: KGSL says "Adreno33v2", the platform says pineapple.
|
||||
assertEquals(750, GpuInfo.platformModel("pineapple"))
|
||||
assertEquals(740, GpuInfo.platformModel("KALAMA"))
|
||||
assertEquals(830, GpuInfo.platformModel("sun"))
|
||||
assertEquals(0, GpuInfo.platformModel("somethingelse"))
|
||||
assertEquals(GpuInfo.Family.A7XX, GpuInfo.familyOf(true, GpuInfo.platformModel("pineapple")))
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.droiddeck.launcher.gpu
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
|
||||
class SocNamesTest {
|
||||
private fun props(vararg pairs: Pair<String, String>): (String) -> String = { pairs.toMap()[it].orEmpty() }
|
||||
|
||||
@Test fun theModelIsFoundWhereVendorsPutIt() {
|
||||
// AYANEO Pocket FIT: ro.soc.model blank, the vendor property set, ro.fota.platform a branch name.
|
||||
assertEquals("SG8350P", SocNames.model(props("ro.vendor.qti.soc_model" to "SG8350P", "ro.fota.platform" to "MSM_13.0")))
|
||||
assertEquals("QCS8550", SocNames.model(props("ro.soc.model" to "QCS8550", "ro.vendor.qti.soc_model" to "other")))
|
||||
assertEquals("", SocNames.model(props("ro.fota.platform" to "MSM_13.0")))
|
||||
}
|
||||
|
||||
@Test fun knownModelsAndPlatformsGetTheirNames() {
|
||||
assertEquals("Snapdragon 8 Gen 2", SocNames.name("QCS8550", ""))
|
||||
assertEquals("Snapdragon 8 Gen 3 family", SocNames.name("SG8350P", "pineapple"))
|
||||
assertNull(SocNames.name("XYZ123", "nowhere"))
|
||||
assertEquals("Snapdragon 8 Gen 2 (QCS8550)", SocNames.label("QCS8550", ""))
|
||||
assertEquals("Snapdragon 8 Gen 3 family (SG8350P)", SocNames.label("SG8350P", "pineapple"))
|
||||
assertEquals("XYZ123", SocNames.label("XYZ123", ""))
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
import org.junit.After
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* The ring paths handed to the guest (FAKE_EVDEV_MEMFD_PATHS) must keep the spelling the session
|
||||
* tree is bound under. On ColorOS 16 /data/user/0 resolves to /data/data, the guest only has the
|
||||
* first bound, and a canonical export left every pad dead (#166). A symlinked directory stands in
|
||||
* for that here.
|
||||
*/
|
||||
class FakeInputRingPathTest {
|
||||
private lateinit var base: File
|
||||
private lateinit var real: File
|
||||
private lateinit var link: File
|
||||
|
||||
@Before fun setUp() {
|
||||
base = Files.createTempDirectory("ring-path").toFile()
|
||||
real = File(base, "data-data").apply { mkdirs() }
|
||||
link = File(base, "data-user-0")
|
||||
Files.createSymbolicLink(link.toPath(), real.toPath())
|
||||
}
|
||||
|
||||
@After fun tearDown() {
|
||||
base.deleteRecursively()
|
||||
}
|
||||
|
||||
@Test fun ringsSitBesideTheFakeInputNodes() {
|
||||
val fakeInputDir = File(link, "files/session/dev/input")
|
||||
assertEquals(File(link, "files/session/dev/fakeinput-rings/ring2"), FakeInputRingPaths.ringFile(fakeInputDir, 2))
|
||||
}
|
||||
|
||||
@Test fun theExportKeepsTheBoundSpellingThroughALinkedDataDirectory() {
|
||||
val fakeInputDir = File(link, "files/session/dev/input").apply { mkdirs() }
|
||||
val ring = FakeInputRingPaths.ringFile(fakeInputDir, 0)!!.apply { parentFile!!.mkdirs(); writeText("") }
|
||||
// The link really does resolve elsewhere, as /data/user/0 does on the affected devices.
|
||||
assertTrue(ring.canonicalPath.startsWith(real.canonicalPath + "/"))
|
||||
val exported = FakeInputRingPaths.exportPath(ring)
|
||||
assertEquals(File(link, "files/session/dev/fakeinput-rings/ring0").path, exported)
|
||||
assertFalse("$exported resolved through the link", exported.startsWith(real.path + "/"))
|
||||
assertTrue("$exported does not open", File(exported).isFile)
|
||||
}
|
||||
|
||||
@Test fun aRelativeInputDirIsExportedAbsolute() {
|
||||
val exported = FakeInputRingPaths.exportPath(FakeInputRingPaths.ringFile(File("session/dev/input"), 1)!!)
|
||||
assertTrue(exported, File(exported).isAbsolute)
|
||||
assertTrue(exported, exported.endsWith("/session/dev/fakeinput-rings/ring1"))
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.BatteryManager
|
||||
import java.io.File
|
||||
import org.junit.After
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.Shadows.shadowOf
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [28], manifest = Config.NONE)
|
||||
class BatteryComponentTest {
|
||||
@get:Rule val tmp = TemporaryFolder()
|
||||
private var battery: BatteryComponent? = null
|
||||
|
||||
@After fun stop() { battery?.stop() }
|
||||
|
||||
@Test fun oneAggregateBatteryKeepsOverlayPowerAndLifetimeConsistentWithQam() {
|
||||
val supplies = tmp.newFolder("power_supply")
|
||||
val vpower = tmp.newFolder("vpower")
|
||||
start(supplies, vpower, -2_000_000L)
|
||||
assertTelemetry(supplies, vpower)
|
||||
}
|
||||
|
||||
@Test fun upgradingRemovesTheDuplicateRatherThanLeavingItForOverlayDiscovery() {
|
||||
val supplies = tmp.newFolder("power_supply")
|
||||
val vpower = tmp.newFolder("vpower")
|
||||
val legacy = File(supplies, "BAT0").apply { mkdirs() }
|
||||
File(legacy, "power_now").writeText("8000000\n")
|
||||
File(legacy, "charge_now").writeText("4000000\n")
|
||||
start(supplies, vpower, 2_000_000L)
|
||||
assertFalse(legacy.exists())
|
||||
assertTelemetry(supplies, vpower)
|
||||
}
|
||||
|
||||
private fun start(supplies: File, vpower: File, currentUa: Long) {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
context.sendStickyBroadcast(Intent(Intent.ACTION_BATTERY_CHANGED).apply {
|
||||
putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_DISCHARGING)
|
||||
putExtra(BatteryManager.EXTRA_LEVEL, 50)
|
||||
putExtra(BatteryManager.EXTRA_SCALE, 100)
|
||||
putExtra(BatteryManager.EXTRA_VOLTAGE, 4000)
|
||||
})
|
||||
shadowOf(context.getSystemService(BatteryManager::class.java)).apply {
|
||||
setLongProperty(BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER, 4_000_000L)
|
||||
setLongProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW, currentUa)
|
||||
setLongProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_AVERAGE, currentUa)
|
||||
}
|
||||
battery = BatteryComponent(supplies, vpower).also { it.attach(context); it.start() }
|
||||
}
|
||||
|
||||
private fun assertTelemetry(supplies: File, vpower: File) {
|
||||
val discovered = supplies.listFiles()!!.filter { it.name.contains("BAT") }
|
||||
assertEquals(listOf("BAT1"), discovered.map { it.name })
|
||||
fun read(name: String) = File(discovered.single(), name).readText().trim().toLong()
|
||||
// One 4 Ah battery at 4 V drawing 2 A: 8 W and two hours, regardless of vendor current sign.
|
||||
assertEquals(8_000_000L, read("power_now"))
|
||||
assertEquals(16_000_000L, read("energy_now"))
|
||||
assertEquals(7200L, read("time_to_empty_now"))
|
||||
assertEquals("7200", File(vpower, "secs_until_shutdown_request").readText().trim())
|
||||
assertEquals("50.00", File(vpower, "battery_percent").readText().trim())
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import android.os.Looper
|
||||
import android.os.Vibrator
|
||||
import android.os.VibratorManager
|
||||
import com.droiddeck.launcher.input.ControllerPrefs
|
||||
import com.droiddeck.launcher.input.PadBridge
|
||||
import java.io.IOException
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
@@ -69,74 +68,12 @@ class RumbleComponentTest {
|
||||
assertTrue(shadowOf(vibrator).isVibrating)
|
||||
}
|
||||
|
||||
@Test fun aControllerWithMotorsGetsTheEffectInsteadOfThePhone() {
|
||||
val pad = FakeMotors()
|
||||
rumble.controllerMotors = { id -> if (id == PAD_ID) pad else null }
|
||||
activeController(PAD_ID)
|
||||
effect(strong = 40000, weak = 1000)
|
||||
assertEquals(listOf(Triple(40000, 1000, 5000L)), pad.played)
|
||||
assertFalse("the phone buzzed as well", shadowOf(vibrator).isVibrating)
|
||||
private fun effect() {
|
||||
// Inject a decoded force-feedback packet; transport is outside this preference test.
|
||||
RumbleComponent::class.java.getDeclaredMethod("buzz", Int::class.javaPrimitiveType, Int::class.javaPrimitiveType)
|
||||
.apply { isAccessible = true }.invoke(rumble, 65535, 5000)
|
||||
}
|
||||
|
||||
@Test fun aControllerWithoutMotorsFallsBackToThePhone() {
|
||||
rumble.controllerMotors = { null }
|
||||
activeController(PAD_ID)
|
||||
effect()
|
||||
assertTrue(shadowOf(vibrator).isVibrating)
|
||||
}
|
||||
|
||||
@Test fun theOnScreenPadTakingOverMovesTheEffectBackToThePhone() {
|
||||
val pad = FakeMotors()
|
||||
rumble.controllerMotors = { pad }
|
||||
activeController(PAD_ID)
|
||||
effect()
|
||||
assertTrue(pad.vibrating)
|
||||
activeController(PadBridge.NO_CONTROLLER)
|
||||
effect()
|
||||
assertFalse("the controller kept rumbling after the switch", pad.vibrating)
|
||||
assertTrue(shadowOf(vibrator).isVibrating)
|
||||
}
|
||||
|
||||
@Test fun aStopPacketDisablingAndStoppingAllEndTheControllersEffect() {
|
||||
val pad = FakeMotors()
|
||||
rumble.controllerMotors = { pad }
|
||||
activeController(PAD_ID)
|
||||
effect()
|
||||
effect(strong = 0, weak = 0)
|
||||
assertFalse(pad.vibrating)
|
||||
effect()
|
||||
ControllerPrefs.setRumble(context, false)
|
||||
shadowOf(Looper.getMainLooper()).idle()
|
||||
assertFalse(pad.vibrating)
|
||||
ControllerPrefs.setRumble(context, true)
|
||||
shadowOf(Looper.getMainLooper()).idle()
|
||||
effect()
|
||||
rumble.stop()
|
||||
assertFalse(pad.vibrating)
|
||||
}
|
||||
|
||||
@After fun clearActiveController() { activeController(PadBridge.NO_CONTROLLER) }
|
||||
|
||||
private fun activeController(id: Int) {
|
||||
PadBridge::class.java.getDeclaredField("activeControllerId").apply { isAccessible = true }.setInt(null, id)
|
||||
}
|
||||
|
||||
private fun effect(strong: Int = 65535, weak: Int = 65535) {
|
||||
// Inject a decoded force-feedback packet; transport is outside these tests.
|
||||
RumbleComponent::class.java.getDeclaredMethod("buzz", Int::class.javaPrimitiveType, Int::class.javaPrimitiveType, Int::class.javaPrimitiveType)
|
||||
.apply { isAccessible = true }.invoke(rumble, strong, weak, 5000)
|
||||
}
|
||||
|
||||
private class FakeMotors : RumbleComponent.Motors {
|
||||
override val name = "fake pad"
|
||||
val played = mutableListOf<Triple<Int, Int, Long>>()
|
||||
var vibrating = false
|
||||
override fun play(strong: Int, weak: Int, ms: Long) { played += Triple(strong, weak, ms); vibrating = true }
|
||||
override fun cancel() { vibrating = false }
|
||||
}
|
||||
|
||||
private companion object { const val PAD_ID = 7 }
|
||||
|
||||
@Implements(LocalServerSocket::class)
|
||||
class NoPacketsSocket {
|
||||
@Implementation fun __constructor__(name: String) = Unit
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
|
||||
class SessionDisplayTest {
|
||||
@Test fun explicitPresetsAndMatchScreenResolveWithoutAnyAspectSetting() {
|
||||
assertEquals(1280 to 720, SessionDisplay.resolveChoice(1440 to 1080, "1280x720"))
|
||||
assertEquals(1600 to 900, SessionDisplay.resolveChoice(1280 to 720, "1600x900"))
|
||||
assertEquals(1440 to 1080, SessionDisplay.resolveChoice(1080 to 1440, SessionDisplay.MATCH_SCREEN))
|
||||
assertEquals(2400 to 1080, SessionDisplay.resolveChoice(1080 to 2400, SessionDisplay.MATCH_SCREEN))
|
||||
}
|
||||
|
||||
@Test fun panelOptionReplacesTheIdenticalPresetAndTracksPanelChanges() {
|
||||
val thor = SessionDisplay.resolutionOptions(1920 to 1080)
|
||||
assertEquals(listOf("1280x720", "1600x900", SessionDisplay.MATCH_SCREEN), thor)
|
||||
val small = SessionDisplay.resolutionOptions(1280 to 720)
|
||||
assertFalse(small.contains("1280x720"))
|
||||
assertEquals(1280 to 720, SessionDisplay.resolveChoice(1280 to 720, SessionDisplay.MATCH_SCREEN))
|
||||
assertEquals(2560 to 1440, SessionDisplay.resolveChoice(2560 to 1440, SessionDisplay.MATCH_SCREEN))
|
||||
}
|
||||
|
||||
@Test fun resolutionCapsPreserveTheSelectedShapeWithoutExceedingPanelHeight() {
|
||||
assertEquals(1280 to 720, SessionDisplay.resolve(1920 to 1080, 720, SessionPrefs.SHAPE_AUTO))
|
||||
assertEquals(960 to 720, SessionDisplay.resolve(1440 to 1080, 720, SessionPrefs.SHAPE_EXACT))
|
||||
assertEquals(1280 to 720, SessionDisplay.resolve(1440 to 1080, 720, SessionPrefs.SHAPE_AUTO))
|
||||
assertEquals(1280 to 720, SessionDisplay.resolve(1280 to 720, 1080, SessionPrefs.SHAPE_AUTO))
|
||||
}
|
||||
|
||||
@Test fun noCapUsesPanelHeightWhileCustomOverridesBothCapAndAspect() {
|
||||
assertEquals(1440 to 1080, SessionDisplay.resolve(1440 to 1080, 0, SessionPrefs.SHAPE_EXACT))
|
||||
assertEquals(1920 to 1080, SessionDisplay.resolve(1440 to 1080, 0, SessionPrefs.SHAPE_WIDE))
|
||||
assertEquals(1024 to 768, SessionDisplay.resolve(1920 to 1080, 720, SessionPrefs.SHAPE_WIDE, 1024 to 768))
|
||||
}
|
||||
|
||||
@Test fun orientationAndOddDimensionsKeepTheExistingEvenLandscapeDisplay() {
|
||||
assertEquals(1920 to 1080, SessionDisplay.resolve(1081 to 1921, 0, SessionPrefs.SHAPE_EXACT))
|
||||
assertEquals(1600 to 720, SessionDisplay.resolve(2400 to 1080, 720, SessionPrefs.SHAPE_AUTO))
|
||||
}
|
||||
|
||||
@Test fun gameStretchAvailabilityMatchesTheRuntimeIncludingRounding() {
|
||||
assertTrue(SessionDisplay.canStretch16x9(960 to 720))
|
||||
assertFalse(SessionDisplay.canStretch16x9(1280 to 720))
|
||||
assertFalse(SessionDisplay.canStretch16x9(1600 to 720))
|
||||
val wide = SessionDisplay.resolve(1440 to 1080, 0, SessionPrefs.SHAPE_WIDE)
|
||||
assertFalse(SessionDisplay.canStretch16x9(wide))
|
||||
}
|
||||
|
||||
@Test fun removedFilterAliasesRetainTheirEquivalentBehavior() {
|
||||
assertEquals(0, SessionPrefs.canonicalUpscaler(1))
|
||||
assertEquals(4, SessionPrefs.canonicalUpscaler(5))
|
||||
assertEquals(0, SessionPrefs.canonicalUpscaler(99))
|
||||
assertFalse(SessionPrefs.upscalerHasSharpness(0))
|
||||
assertFalse(SessionPrefs.upscalerHasSharpness(1))
|
||||
assertFalse(SessionPrefs.upscalerHasSharpness(2))
|
||||
for (mode in 3..8) assertTrue(SessionPrefs.upscalerHasSharpness(mode))
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import android.content.Context
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [28], manifest = Config.NONE)
|
||||
class SessionScalingPrefsTest {
|
||||
@Before fun clearSettings() {
|
||||
RuntimeEnvironment.getApplication().getSharedPreferences("session", Context.MODE_PRIVATE).edit().clear().commit()
|
||||
}
|
||||
|
||||
@Test fun explicitLegacyAspectAndCapKeepTheirSizeUntilAResolutionIsPicked() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
val prefs = context.getSharedPreferences("session", Context.MODE_PRIVATE)
|
||||
prefs.edit().putString("shape", SessionPrefs.SHAPE_EXACT).putInt("resolutionCap.steam", 900).commit()
|
||||
assertEquals("1200x900", SessionPrefs.resolutionChoice(context, "steam", 1440 to 1080))
|
||||
SessionPrefs.setResolutionChoice(context, "steam", "1600x900")
|
||||
prefs.edit().putString("shape", SessionPrefs.SHAPE_WIDE).commit()
|
||||
assertEquals("1600x900", SessionPrefs.resolutionChoice(context, "steam", 1440 to 1080))
|
||||
assertTrue(SessionPrefs.resolutionChosen(context, "steam"))
|
||||
}
|
||||
|
||||
@Test fun matchScreenOverridesLegacyCustomAndAspectWithoutAffectingTheOtherMode() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
val prefs = context.getSharedPreferences("session", Context.MODE_PRIVATE)
|
||||
prefs.edit().putString("shape", SessionPrefs.SHAPE_WIDE).putString("customRes.steam", "1024x768")
|
||||
.putString("customRes.lxqt", "800x600").commit()
|
||||
assertEquals("1024x768", SessionPrefs.resolutionChoice(context, "steam", 1440 to 1080))
|
||||
SessionPrefs.setResolutionChoice(context, "steam", SessionDisplay.MATCH_SCREEN)
|
||||
val choice = SessionPrefs.resolutionChoice(context, "steam", 1440 to 1080)
|
||||
assertEquals(1440 to 1080, SessionDisplay.resolveChoice(1440 to 1080, choice))
|
||||
assertEquals("800x600", SessionPrefs.resolutionChoice(context, "lxqt", 1440 to 1080))
|
||||
}
|
||||
|
||||
@Test fun freshSettingsUseTheConcreteDefaultAndCustomSizesAreNormalized() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
assertEquals("1280x720", SessionPrefs.resolutionChoice(context, "steam", 2400 to 1080))
|
||||
SessionPrefs.setResolutionChoice(context, "steam", "1025×769")
|
||||
assertEquals("1024x768", SessionPrefs.resolutionChoice(context, "steam", 2400 to 1080))
|
||||
}
|
||||
|
||||
@Test fun legacySavedFiltersStillResolveToAVisibleEquivalentChoice() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
val prefs = context.getSharedPreferences("session", Context.MODE_PRIVATE)
|
||||
prefs.edit().putInt("upscaler", 1).putInt("upscaleSharpness", 65).commit()
|
||||
assertEquals(0, SessionPrefs.upscaler(context))
|
||||
prefs.edit().putInt("upscaler", 5).commit()
|
||||
assertEquals(4, SessionPrefs.upscaler(context))
|
||||
assertEquals(65, SessionPrefs.upscaleSharpness(context))
|
||||
SessionPrefs.setUpscaler(context, 5)
|
||||
assertEquals(4, prefs.getInt("upscaler", -1))
|
||||
SessionPrefs.setUpscaler(context, 1)
|
||||
assertEquals(0, prefs.getInt("upscaler", -1))
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.ui.unit.Density
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.droiddeck.launcher.core.AppUiPrefs
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [28], manifest = Config.NONE)
|
||||
class AppScaleTest {
|
||||
private val context get() = RuntimeEnvironment.getApplication()
|
||||
|
||||
@Before fun clearScale() {
|
||||
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().clear().commit()
|
||||
}
|
||||
|
||||
@Test fun defaultsToSystemDensityAndCanRestoreItAfterChoosingAnotherScale() {
|
||||
assertEquals(100, AppUiPrefs.scale(context))
|
||||
AppUiPrefs.setScale(context, 75)
|
||||
assertEquals(75, AppUiPrefs.scale(context))
|
||||
AppUiPrefs.setScale(context, 100)
|
||||
assertEquals(100, AppUiPrefs.scale(context))
|
||||
val density = Density(2f, 1.3f)
|
||||
val configuration = Configuration(context.resources.configuration)
|
||||
assertSame(density, scaledAppDensity(density, 100))
|
||||
assertSame(configuration, scaledAppConfiguration(configuration, 100))
|
||||
}
|
||||
|
||||
@Test fun invalidStoredOrRequestedScaleFallsBackToTheDefault() {
|
||||
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().putInt("scale", 0).commit()
|
||||
assertEquals(100, AppUiPrefs.scale(context))
|
||||
AppUiPrefs.setScale(context, 1000)
|
||||
assertEquals(100, AppUiPrefs.scale(context))
|
||||
}
|
||||
|
||||
@Test fun scalingDoesNotModifySessionPreferencesOrAndroidDisplayMetrics() {
|
||||
val session = context.getSharedPreferences("session", Context.MODE_PRIVATE)
|
||||
session.edit().putString("resolution.steam", "1280x720").putInt("upscaler", 2).commit()
|
||||
val before = session.all.toMap()
|
||||
val density = context.resources.displayMetrics.density
|
||||
val configuration = Configuration(context.resources.configuration)
|
||||
AppUiPrefs.setScale(context, 150)
|
||||
scaledAppConfiguration(context.resources.configuration, AppUiPrefs.scale(context))
|
||||
assertEquals(before, session.all)
|
||||
assertEquals(density, context.resources.displayMetrics.density, 0f)
|
||||
assertEquals(configuration, context.resources.configuration)
|
||||
}
|
||||
|
||||
@Test fun textAndControlsScaleTogetherWhilePreservingAccessibilityFontScale() {
|
||||
val base = Density(2f, 1.3f)
|
||||
for (percent in AppUiPrefs.scales) {
|
||||
val scaled = scaledAppDensity(base, percent)
|
||||
assertEquals(1.3f, scaled.fontScale, 0f)
|
||||
assertEquals(base.run { 44.dp.toPx() } * percent / 100f, scaled.run { 44.dp.toPx() }, 0.001f)
|
||||
assertEquals(base.run { 16.sp.toPx() } * percent / 100f, scaled.run { 16.sp.toPx() }, 0.001f)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun responsiveWidthAndPopupHeightFitTheSamePhysicalWindowAtEveryScale() {
|
||||
val base = Configuration().apply {
|
||||
densityDpi = 320
|
||||
screenWidthDp = 960
|
||||
screenHeightDp = 540
|
||||
smallestScreenWidthDp = 540
|
||||
fontScale = 1.3f
|
||||
orientation = Configuration.ORIENTATION_LANDSCAPE
|
||||
}
|
||||
for (percent in AppUiPrefs.scales) {
|
||||
val scaled = scaledAppConfiguration(base, percent)
|
||||
val density = scaledAppDensity(Density(2f, 1.3f), percent).density
|
||||
assertEquals(1920f, scaled.screenWidthDp * density, 2f)
|
||||
assertEquals(1080f, scaled.screenHeightDp * density, 2f)
|
||||
assertEquals(1080f, scaled.smallestScreenWidthDp * density, 2f)
|
||||
assertEquals(1.3f, scaled.fontScale, 0f)
|
||||
assertEquals(base.orientation, scaled.orientation)
|
||||
}
|
||||
assertEquals(960, base.screenWidthDp)
|
||||
assertEquals(540, base.screenHeightDp)
|
||||
assertEquals(320, base.densityDpi)
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
|
||||
class SessionDrawerPageTest {
|
||||
@Test fun singleScreenNavigationStartsWithControllerAndSkipsSecondScreen() {
|
||||
val pages = sessionDrawerPages(false)
|
||||
assertEquals(SessionDrawerPage.CONTROLLER, pages.first())
|
||||
assertFalse(SessionDrawerPage.SECOND_SCREEN in pages)
|
||||
assertEquals(SessionDrawerPage.DISPLAY, pages.step(SessionDrawerPage.CONTROLLER, 1))
|
||||
assertEquals(SessionDrawerPage.SESSION, pages.step(SessionDrawerPage.CONTROLLER, -1))
|
||||
assertEquals(SessionDrawerPage.CONTROLLER, pages.step(SessionDrawerPage.SESSION, 1))
|
||||
}
|
||||
|
||||
@Test fun connectedSecondaryDisplayAddsItsPageAfterControllerAndPreservesOtherPages() {
|
||||
val connected = sessionDrawerPages(true)
|
||||
assertEquals(SessionDrawerPage.SECOND_SCREEN, connected.step(SessionDrawerPage.CONTROLLER, 1))
|
||||
assertEquals(SessionDrawerPage.DISPLAY, connected.step(SessionDrawerPage.SECOND_SCREEN, 1))
|
||||
assertEquals(sessionDrawerPages(false), connected.filter { it != SessionDrawerPage.SECOND_SCREEN })
|
||||
for (pages in listOf(connected, sessionDrawerPages(false))) {
|
||||
assertEquals(SessionDrawerPage.EFFECTS, pages.step(SessionDrawerPage.DISPLAY, 1))
|
||||
assertEquals(SessionDrawerPage.GAMES, pages.step(SessionDrawerPage.EFFECTS, 1))
|
||||
assertEquals(SessionDrawerPage.SESSION, pages.step(SessionDrawerPage.GAMES, 1))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class SettingsCatalogTest {
|
||||
private fun targets(query: String) = SettingsCatalog.search(query).map { it.target }.toSet()
|
||||
|
||||
@Test fun allEightCategoriesAreRepresentedAndEveryDestinationIsUnique() {
|
||||
assertEquals(SettingsCategory.entries.toSet(), SettingsCatalog.entries.map { it.category }.toSet())
|
||||
val targetIds = SettingsCatalog.entries.map { it.target }
|
||||
assertEquals("Each search result must have one unambiguous route", targetIds.size, targetIds.toSet().size)
|
||||
}
|
||||
|
||||
@Test fun searchTrimsAndMatchesAliasesWithoutReturningResultsForBlankQueries() {
|
||||
assertTrue(SettingsCatalog.search(" ").isEmpty())
|
||||
assertEquals(setOf("theme"), targets(" COLORS "))
|
||||
assertTrue(targets("wireless debugging").contains("phantom-process"))
|
||||
assertTrue(targets("anisotropic filtering").contains("textures-anisotropy"))
|
||||
}
|
||||
|
||||
@Test fun protonDefaultsInstalledBuildsAndComponentNamesRouteToTheirOwnPages() {
|
||||
assertEquals(setOf("default-proton"), targets("default proton"))
|
||||
assertEquals(setOf("editing-proton"), targets("component editing target"))
|
||||
assertEquals(setOf("protons"), targets("installed proton"))
|
||||
assertTrue(targets("DXVK").contains("components"))
|
||||
assertTrue(targets("VKD3D").contains("components"))
|
||||
assertFalse(SettingsCatalog.entries.any { it.target == "steam-menu" || it.target == "open-qam" })
|
||||
}
|
||||
|
||||
@Test fun routesPreserveDestinationCategoryAndMode() {
|
||||
val resolution = SettingsCatalog.entries.single { it.target == "res" }
|
||||
assertEquals(SettingsCategory.DISPLAY, resolution.category)
|
||||
assertEquals("steam", resolution.mode)
|
||||
|
||||
val renderer = SettingsCatalog.entries.single { it.target == "renderer" }
|
||||
assertEquals(SettingsCategory.SESSIONS, renderer.category)
|
||||
assertEquals(com.droiddeck.launcher.session.SessionService.MODE_DESKTOP, renderer.mode)
|
||||
|
||||
val overlay = SettingsCatalog.entries.single { it.target == "mangoapp" }
|
||||
assertEquals(SettingsCategory.DISPLAY, overlay.category)
|
||||
assertEquals("steam", overlay.mode)
|
||||
}
|
||||
|
||||
@Test fun commonSearchTermsRouteToTheirSettingsPages() {
|
||||
assertEquals(setOf("res"), targets("resolution"))
|
||||
assertEquals(setOf("gpu-drivers"), targets("driver"))
|
||||
assertTrue(targets("Proton").contains("protons"))
|
||||
assertTrue(targets("Proton").contains("components"))
|
||||
assertTrue(targets("microphone").contains("mic"))
|
||||
assertTrue(targets("ROM").contains("roms"))
|
||||
|
||||
val updates = SettingsCatalog.entries.filter { it.target == "updates" }.single()
|
||||
assertEquals(SettingsCategory.SUPPORT, updates.category)
|
||||
}
|
||||
|
||||
@Test fun controllerKeyboardButtonRemainsSearchableAsASetting() {
|
||||
assertTrue(targets("keyboard button").contains("controller-keyboard"))
|
||||
assertFalse(SettingsCatalog.entries.any { it.target == "keyboard" || it.target == "second-screen" })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
|
||||
class SettingsHistoryTest {
|
||||
@Test fun sessionTabsUseTheRuntimeModeIdentifiers() {
|
||||
assertEquals(listOf("steam", "lxqt"), settingsSessionModes.map { it.first })
|
||||
assertEquals(settingsSessionModes.last().first, SettingsCatalog.search("Desktop renderer").single().mode)
|
||||
}
|
||||
|
||||
@Test fun specialistBackRestoresCategoryAndMode() {
|
||||
val category = SettingsDestination.Category(SettingsCategory.SESSIONS, com.droiddeck.launcher.session.SessionService.MODE_DESKTOP, "renderer")
|
||||
val history = SettingsHistory().open(category).open(SettingsDestination.Components("gpu"))
|
||||
assertEquals(category, history.back().current)
|
||||
assertNull(history.back().back().current)
|
||||
}
|
||||
|
||||
@Test fun changingModeReplacesCurrentPage() {
|
||||
val category = SettingsDestination.Category(SettingsCategory.DISPLAY)
|
||||
val history = SettingsHistory().open(category).replace(category.copy(mode = com.droiddeck.launcher.session.SessionService.MODE_DESKTOP))
|
||||
assertEquals(com.droiddeck.launcher.session.SessionService.MODE_DESKTOP, (history.current as SettingsDestination.Category).mode)
|
||||
assertNull(history.back().current)
|
||||
}
|
||||
|
||||
@Test fun repeatedDestinationsDoNotAddBackSteps() {
|
||||
val destination = SettingsDestination.Performance()
|
||||
val history = SettingsHistory().open(destination).open(destination)
|
||||
assertEquals(1, history.destinations.size)
|
||||
assertNull(history.back().back().current)
|
||||
}
|
||||
|
||||
@Test fun specialistSearchesReturnToTheirCategoryLaunchControl() {
|
||||
assertEquals("performance", settingsCategoryTarget("performance:gameCores"))
|
||||
assertEquals("components", settingsCategoryTarget("default-proton"))
|
||||
assertEquals("components", settingsCategoryTarget("editing-proton"))
|
||||
assertEquals("controller-mapping", settingsCategoryTarget("controller-mapping"))
|
||||
assertEquals("res", settingsCategoryTarget("res"))
|
||||
assertNull(settingsCategoryTarget(null))
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
Thor SD storage investigation: selected saved evidence
|
||||
Recorded 2026-10-04; event timestamps are EDT.
|
||||
These are excerpts, not complete logs or a continuous attribution profile.
|
||||
See ../thor-sd-storage-investigation.md for context and live-only observations.
|
||||
|
||||
=== Reporter unsupported allocation ===
|
||||
Source: Reporter diagnostic storage.log
|
||||
volume_removable=true
|
||||
filesystem=fuse
|
||||
allocation pid=29062 comm=steam api=fallocate result=-1 api_error=95 errno_after=95 flags=0x0 offset=0 length=374272 elapsed_us=212
|
||||
|
||||
=== Thor unsupported allocation ===
|
||||
Source: candidate-storage.log
|
||||
volume_removable=true
|
||||
filesystem=fuse
|
||||
allocation pid=9810 comm=steam api=fallocate result=-1 api_error=95 errno_after=95 flags=0x0 offset=0 length=650752 elapsed_us=310
|
||||
|
||||
=== Native-path allocation diagnostics ===
|
||||
Source: direct-storage-completed.log / session 64
|
||||
DroidDeck storage diagnostics v1
|
||||
selected_library=secondary
|
||||
volume_removable=true
|
||||
filesystem=exfat
|
||||
truncate_allocation_probe=passed
|
||||
block_size_bytes=131072
|
||||
total_bytes=393855500288
|
||||
available_bytes=101076697088
|
||||
native_observation=enabled
|
||||
public_symbol_interposition=enabled
|
||||
direct_syscalls_and_libc_internal_calls=not_observed
|
||||
pwrite_timing=sampled_1_in_32
|
||||
per_process_allocation_detail_limit=64
|
||||
storage_log_limit_bytes=524288
|
||||
summary pid=26725 comm=python3 allocation_calls=0 allocation_failures=0 allocation_total_us=0 pwrite_sample_every=32 pwrite_samples=0 pwrite_bytes=0 pwrite_failures=0 pwrite_sample_total_us=0 pwrite_sample_max_us=0 ftruncate_calls=0 ftruncate_failures=0 ftruncate_total_us=0 ftruncate_max_us=0 fstat_calls=1 fstat_total_us=0 fstat_max_us=0 fsync_calls=0 fsync_failures=0 fsync_total_us=0 fsync_max_us=0
|
||||
allocation pid=26825 comm=steam api=fallocate_ftruncate result=0 api_error=0 errno_after=0 flags=0x0 offset=0 length=667648 elapsed_us=387
|
||||
allocation pid=26825 comm=steam api=fallocate_ftruncate result=0 api_error=0 errno_after=0 flags=0x0 offset=0 length=39 elapsed_us=32
|
||||
allocation pid=26825 comm=steam api=fallocate_ftruncate result=0 api_error=0 errno_after=0 flags=0x0 offset=0 length=156 elapsed_us=25
|
||||
allocation pid=26825 comm=steam api=fallocate_ftruncate result=0 api_error=0 errno_after=0 flags=0x0 offset=0 length=457428 elapsed_us=351
|
||||
allocation pid=26825 comm=steam api=fallocate_ftruncate result=0 api_error=0 errno_after=0 flags=0x0 offset=0 length=901928 elapsed_us=864
|
||||
allocation pid=26825 comm=steam api=fallocate_ftruncate result=0 api_error=0 errno_after=0 flags=0x0 offset=0 length=15041920 elapsed_us=15292
|
||||
allocation pid=26825 comm=steam api=fallocate_ftruncate result=0 api_error=0 errno_after=0 flags=0x0 offset=0 length=337563 elapsed_us=2783
|
||||
|
||||
=== Fresh real Steam install ===
|
||||
Source: direct-content-completed.log / session 64
|
||||
[2026-10-04 17:31:20] AppID 1675830 App update changed : Running Update,Preallocating,
|
||||
[2026-10-04 17:38:04] AppID 1675830 preallocated 2216 files (7626 MB)
|
||||
[2026-10-04 17:38:06] AppID 1675830 App update changed : Running Update,Downloading,Staging,
|
||||
[2026-10-04 17:45:25] AppID 1675830 App update changed : Running Update,Committing,
|
||||
[2026-10-04 17:45:25] AppID 1675830 starting commit from "/mnt/droiddeck-sd/steamapps/downloading/1675830" to "/mnt/droiddeck-sd/steamapps/common/1000xRESIST" : 2230 updated, 0 moved, 0 deleted files
|
||||
[2026-10-04 17:47:55] AppID 1675830 state changed : Fully Installed,Update Queued,Update Running,
|
||||
[2026-10-04 17:47:55] AppID 1675830 finished update, 1 mounted depots (BuildID 21498291) : 1675831 (3663189783241284849),
|
||||
[2026-10-04 17:47:56] AppID 1675830 state changed : Fully Installed,Update Queued,
|
||||
[2026-10-04 17:47:56] AppID 1675830 state changed : Fully Installed,
|
||||
[2026-10-04 17:47:56] AppID 1675830 scheduler finished : removed from schedule (result No Error, state 0xc)
|
||||
|
||||
=== Normal-app native/FUSE directory read ===
|
||||
Source: app-raw-probe-session.log / session 62
|
||||
APP_RAW_PROBE uid=10195 path=/mnt/media_rw/FF7F-F56A/Android/data/com.droiddeck.launcher/files/steam/steamapps/downloading/1675830-fuse-control/1000xRESIST_Data/StreamingAssets/aa/StandaloneWindows64 seconds=0.002288 calls=2 bytes=154920 read_error=0
|
||||
APP_RAW_PROBE uid=10195 path=/storage/FF7F-F56A/Android/data/com.droiddeck.launcher/files/steam/steamapps/downloading/1675830-fuse-control/1000xRESIST_Data/StreamingAssets/aa/StandaloneWindows64 seconds=0.501306 calls=112 bytes=154872 read_error=0
|
||||
|
||||
=== Binding regression: bind-probe-before.log ===
|
||||
Source: bind-probe-before.log
|
||||
BIND_PROBE index=0 pass=1 errno=0 bytes=17 path=/mnt/droiddeck-sd/steamapps/common/SteamLinuxRuntime_4-arm64/.droiddeck-bind-probe
|
||||
BIND_PROBE index=1 pass=1 errno=0 bytes=17 path=/mnt/droiddeck-sd/steamapps/common/steamlinuxruntime_4-arm64/.droiddeck-bind-probe
|
||||
BIND_PROBE index=2 pass=0 errno=2 bytes=-1 path=/mnt/droiddeck-sd/steamapps/common/proton experimental (arm64)/.droiddeck-bind-probe
|
||||
BIND_PROBE index=3 pass=0 errno=2 bytes=-1 path=/mnt/bannerlator-sd/steamapps/shadercache/.droiddeck-bind-probe
|
||||
|
||||
=== Binding regression: bind-probe-after.log ===
|
||||
Source: bind-probe-after.log
|
||||
BIND_PROBE index=0 pass=1 errno=0 bytes=17 path=/mnt/droiddeck-sd/steamapps/common/SteamLinuxRuntime_4-arm64/.droiddeck-bind-probe
|
||||
BIND_PROBE index=1 pass=1 errno=0 bytes=17 path=/mnt/droiddeck-sd/steamapps/common/steamlinuxruntime_4-arm64/.droiddeck-bind-probe
|
||||
BIND_PROBE index=2 pass=1 errno=0 bytes=17 path=/mnt/droiddeck-sd/steamapps/common/proton experimental (arm64)/.droiddeck-bind-probe
|
||||
BIND_PROBE index=3 pass=1 errno=0 bytes=17 path=/mnt/bannerlator-sd/steamapps/shadercache/.droiddeck-bind-probe
|
||||
|
||||
=== Root metadata/mount experiment: metadata-mount-comparison.log ===
|
||||
Source: metadata-mount-comparison.log
|
||||
original_mount
|
||||
/dev/block/vold/public:179,1 /mnt/media_rw/FF7F-F56A exfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,iocharset=utf8,errors=remount-ro 0 0
|
||||
files=64 bytes_per_file=262144 open_seconds=6.707435 truncate_seconds=0.084806 wall_seconds=6.794807 error=0
|
||||
mount: '/dev/block/vold/public:179,1'->'/mnt/media_rw/FF7F-F56A': Invalid argument
|
||||
mount: '/dev/block/vold/public:179,1'->'/mnt/media_rw/FF7F-F56A': Invalid argument
|
||||
|
||||
=== Root metadata/mount experiment: metadata-syscall-comparison.log ===
|
||||
Source: metadata-syscall-comparison.log
|
||||
original_mount
|
||||
/dev/block/vold/public:179,1 /mnt/media_rw/FF7F-F56A exfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,iocharset=utf8,errors=remount-ro 0 0
|
||||
files=64 bytes_per_file=262144 open_seconds=25.181255 truncate_seconds=0.309577 wall_seconds=25.493210 error=0
|
||||
temporary_mount
|
||||
/dev/block/vold/public:179,1 /mnt/media_rw/FF7F-F56A exfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,iocharset=utf8,errors=remount-ro 0 0
|
||||
files=64 bytes_per_file=262144 open_seconds=2.013194 truncate_seconds=0.095924 wall_seconds=2.112288 error=0
|
||||
|
||||
=== Post-install Android low-memory exit ===
|
||||
Source: game-launch-exit-info.txt
|
||||
ApplicationExitInfo #0:
|
||||
timestamp=2026-10-04 18:13:48.454 pid=14709 realUid=10195 packageUid=10195 definingUid=10195 user=0
|
||||
process=com.droiddeck.launcher reason=3 (LOW_MEMORY) subreason=0 (UNKNOWN) status=0
|
||||
importance=100 pss=227MB rss=344MB description=null state=empty trace=null
|
||||
|
||||
=== Combined release unit-test completion ===
|
||||
Source: combined-233-tests.log
|
||||
> Task :app:testReleaseUnitTest
|
||||
BUILD SUCCESSFUL in 10s
|
||||
|
||||
=== Combined release build completion ===
|
||||
Source: combined-233-build.log
|
||||
BUILD SUCCESSFUL in 25s
|
||||
APK: /Users/danhimebauch/.codex/worktrees/steam-sd-preallocation/DroidDeck/app/build/outputs/apk/release/app-release.apk
|
||||
@@ -5,11 +5,6 @@ games should keep running under proot, run directly on glibc, or a mix of the tw
|
||||
fastest correct setup is. Everything below was measured on a Snapdragon 8 Elite Gen 5 (SM8850, kernel
|
||||
6.12.38-android16, Android 16) over adb, unless it says otherwise.
|
||||
|
||||
For Steam SD allocation measurements on AYN Thor (Android 13), see the
|
||||
[Thor storage investigation](thor-sd-storage-investigation.md). It separates
|
||||
observed allocation-wrapper time, FUSE directory access and native exFAT metadata
|
||||
waits; it does not establish a full-install PRoot overhead percentage.
|
||||
|
||||
## Short answer
|
||||
|
||||
- **Don't drop proot.** On Android it does two jobs. It translates paths. It also answers every
|
||||
|
||||
@@ -1,379 +0,0 @@
|
||||
# Steam SD allocation on Thor
|
||||
|
||||
Investigation recorded on 2026-10-04. Device measurements and PR states below are a
|
||||
snapshot of that day's work. All event times are EDT (UTC−04:00).
|
||||
|
||||
A fresh 1000xRESIST install on the Thor SD card completed with the native-path and
|
||||
allocation-fallback patches: 2,216 files preallocated in **6m44s**, followed by a
|
||||
successful download and commit, **16m36s total**. The observed allocation wrappers
|
||||
reported zero failures and roughly 7.1 seconds of aggregate execution time.
|
||||
That wrapper measurement does **not** account for the entire preallocation phase.
|
||||
|
||||
Native directory access was substantially faster than Android's FUSE view in a
|
||||
small controlled probe. Kernel samples during the remaining delay showed exFAT
|
||||
file-creation and size-update waits. This supports further investigation of SD
|
||||
metadata writes. It does not establish that PRoot is free, that `dirsync` alone
|
||||
causes the delay, or that SD now matches internal-storage install speed.
|
||||
|
||||
Selected source-log excerpts are preserved in
|
||||
[the evidence file](evidence/thor-sd-storage-2026-10-04.txt). The original full logs
|
||||
contain unrelated sessions and are not needed to interpret those excerpts.
|
||||
|
||||
## Device and storage
|
||||
|
||||
| Item | Observed configuration |
|
||||
|---|---|
|
||||
| Device | AYN Thor, Android 13, kernel 5.15.123, 12 GB RAM and 8 GB swap |
|
||||
| App | Production-signed `com.droiddeck.launcher`, normal app UID 10195 |
|
||||
| Configured SD library | `/storage/FF7F-F56A/Android/data/com.droiddeck.launcher/files/steam` |
|
||||
| Native view of the same library | `/mnt/media_rw/FF7F-F56A/Android/data/com.droiddeck.launcher/files/steam` |
|
||||
| Guest content aliases | `/mnt/droiddeck-sd` and legacy `/mnt/bannerlator-sd` |
|
||||
| SD filesystem | Native exFAT; its Android `/storage` view reports FUSE |
|
||||
| Native filesystem magic | `0x2011BAB0`, matching the NDK Linux header |
|
||||
| Internal comparison location | App-private cache under `/data` |
|
||||
|
||||
The native SD mount was observed with these options:
|
||||
|
||||
```text
|
||||
rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,iocharset=utf8,errors=remount-ro
|
||||
```
|
||||
|
||||
The device already had root and SELinux Permissive. Neither state was introduced
|
||||
by this investigation. Root was used for inspection and temporary experiments.
|
||||
The validated Steam session ran with the app's normal UID and existing groups,
|
||||
without a root launcher or an app-specific Magisk root grant.
|
||||
|
||||
This distinction does not prove the native path works on an unrooted device with
|
||||
enforcing SELinux. The production change tests access in the app and retains the
|
||||
configured path when verification fails.
|
||||
|
||||
## Initial report and allocation failure
|
||||
|
||||
The [linked Discord report](https://discord.com/channels/1552707793247539220/1555632840388116491/1556271955076710560)
|
||||
included a newer diagnostic ZIP with `storage.log`. Unlike the earlier capture
|
||||
that lacked allocation instrumentation, this capture established:
|
||||
|
||||
- The selected secondary library was removable and its exposed filesystem was
|
||||
FUSE.
|
||||
- Steam called mode-zero `fallocate` and received `EOPNOTSUPP` (errno 95).
|
||||
- That observed failure returned in 212 microseconds. It was not itself a
|
||||
multi-minute blocked call.
|
||||
|
||||
A Thor baseline capture likewise showed `fallocate` failing with errno 95 in
|
||||
310 microseconds. These establish an unsupported allocation API on the tested
|
||||
paths. They do not attribute the later Steam delay to any particular fallback.
|
||||
|
||||
The suggestion that glibc's `posix_fallocate` emulation accounts for the whole
|
||||
hang was not established by those logs. The tested Steam calls included
|
||||
`fallocate`; directory operations and other calls occur outside that wrapper.
|
||||
|
||||
## Published patches and the tested build
|
||||
|
||||
The main base was `26cb9e2f038cdbab4cdc8670d2f64c18d1d90875`. These heads were
|
||||
checked again while preparing this report; all three storage PRs were open with
|
||||
successful Build APK checks and clean merge states. This is a dated snapshot,
|
||||
not a statement about their future merge status.
|
||||
|
||||
| PR | Tested head | Behavior |
|
||||
|---|---|---|
|
||||
| [#221](https://github.com/Droid-Deck/DroidDeck/pull/221) | `7962c19283bfb0f18a5c7672e08a879814a3d5a1` | Verify a native SD content alias and handle safe case aliases in the path fast path |
|
||||
| [#229](https://github.com/Droid-Deck/DroidDeck/pull/229) | `4628ae4c92cc5813013537165a0e95886e6de904` | Use a verified truncate fallback for unsupported selected-library allocation |
|
||||
| [#233](https://github.com/Droid-Deck/DroidDeck/pull/233) | `5c6765233ae5405d7bd4c1b29f20c9e8343a1fed` | Preserve the complete fast-path binding table, including later private overrides |
|
||||
| [#225](https://github.com/Droid-Deck/DroidDeck/pull/225) | `0b5908d6d63080f625b51bab3439e2e68466631e` | Repair repeated failed Steam client starts; reviewed separately, excluded from this storage build |
|
||||
|
||||
### Native content path and case handling: #221
|
||||
|
||||
For a configured `/storage/...` library, the launcher checks the corresponding
|
||||
`/mnt/media_rw/...` candidate. It requires usable directory permissions and
|
||||
performs a write/read/delete identity probe through both views. Failure keeps
|
||||
the original configured path.
|
||||
|
||||
Only the shared SD content bindings change. The configured path remains the
|
||||
library's identity for private prefixes, migrations and other private storage.
|
||||
This avoids moving existing saves or runtime state when selecting a faster view.
|
||||
Removable-volume detection also uses the original configured path because
|
||||
Android's volume API need not recognize the native alias.
|
||||
|
||||
The C fast path permits case-only canonical-parent differences on known
|
||||
FUSE/FAT/exFAT filesystems only after checking directory components without
|
||||
following symlinks. It also handles the supported `F_OK` plus
|
||||
`AT_SYMLINK_NOFOLLOW` case. Ambiguous paths still fall back to PRoot.
|
||||
|
||||
The final #221 diff was four files, 98 insertions and 20 deletions, including
|
||||
28 new test lines. The experimental directory cache was removed from that diff.
|
||||
|
||||
### Allocation fallback: #229
|
||||
|
||||
The launcher first creates a temporary 1 MiB file on the selected content path,
|
||||
extends it, and checks that `st_blocks` reports at least 2,048 512-byte blocks.
|
||||
The file must also be cleaned up successfully. The fallback is enabled only for
|
||||
a removable library that passes this reservation probe.
|
||||
|
||||
For file descriptors on the selected library device, the wrapper tries the real
|
||||
allocation API. On mode-zero `fallocate` returning `EOPNOTSUPP`, it extends the
|
||||
file with `ftruncate`. It validates the range, detects overflow and avoids
|
||||
shrinking an existing file. Other modes and other errors retain their normal
|
||||
behavior. The POSIX wrapper tries kernel allocation first to avoid unnecessary
|
||||
libc emulation and preserves POSIX error-return and `errno` semantics.
|
||||
|
||||
This is a capability-tested fallback, not unconditional successful allocation
|
||||
reporting. A failed extension still returns an error. The optimization operates
|
||||
independently of the optional diagnostic toggle.
|
||||
|
||||
The reservation probe and one successful full install do not replace separate
|
||||
future tests for ENOSPC, interrupted installs or other devices/filesystems.
|
||||
|
||||
### Complete binding table: #233
|
||||
|
||||
The real Steam session had **96 bindings**. The old C limit of 64 silently
|
||||
dropped later mappings. Several of those were private overrides inside the
|
||||
shared SD root, so truncation could send an operation to the wrong location or
|
||||
return `ENOENT`.
|
||||
|
||||
#233 raises capacity to 256 and makes both the launcher and C implementation
|
||||
disable the fast path if a complete table cannot be represented. Overlong paths
|
||||
also cause fallback rather than partial mapping. This is a correctness fix as
|
||||
well as a requirement for trusting the storage fast path.
|
||||
|
||||
Marker files existed only in private directories. A normal app-process probe
|
||||
read them through these guest paths:
|
||||
|
||||
| Guest path under the library | Before #233 | After #233 |
|
||||
|---|---|---|
|
||||
| `SteamLinuxRuntime_4-arm64` | Correct private marker | Correct private marker |
|
||||
| `steamlinuxruntime_4-arm64` | Correct private marker | Correct private marker |
|
||||
| `proton experimental (arm64)` | `ENOENT` | Correct private marker |
|
||||
| Legacy `steamapps/shadercache` | `ENOENT` | Correct private marker |
|
||||
|
||||
Each successful read returned the 17-byte `private-override\n` marker. The
|
||||
temporary markers and helper executable were removed afterward.
|
||||
|
||||
### Deployment and checks
|
||||
|
||||
The full fresh install used #221 plus #229. #233 was then integrated locally,
|
||||
tested, built and installed for the binding regression and game-launch check.
|
||||
It was not merged on GitHub during this investigation.
|
||||
|
||||
The combined integration commit was
|
||||
`f5d3e93b8eb8912ca3834f7447a6498c95250177`. The production-signed APK was installed
|
||||
in place with `adb install -r`; its SHA-256 was:
|
||||
|
||||
```text
|
||||
099a0d7e76b9462b3b238c6f1abeb03570ec9708ace3092adf178ec2bee63e2a
|
||||
```
|
||||
|
||||
`tools/build_local.sh` completed for the combined build. The release unit tests
|
||||
for `SecondaryLibraryTest` and `ProotFastPathTest` passed. The latter covers
|
||||
96/256 bindings, exceeding capacity, and overlong paths. #225 was reviewed for
|
||||
scope; its tests were not run as part of this storage validation.
|
||||
|
||||
## Fresh real Steam install
|
||||
|
||||
Game: **1000xRESIST**, app 1675830, depot 1675831, BuildID 21498291. Steam reported
|
||||
6,582,351,824 download bytes and 7,997,085,707 staging bytes, approximately 8 GB.
|
||||
|
||||
| Event | Time | Evidence |
|
||||
|---|---|---|
|
||||
| Fresh preallocation began | 17:31:20 | Steam entered `Preallocating` |
|
||||
| Preallocation completed | 17:38:04 | 2,216 files, 7,626 MB in Steam's log |
|
||||
| Download/staging began | 17:38:06 | `Downloading,Staging` |
|
||||
| Commit began | 17:45:25 | 2,230 updated files |
|
||||
| Fully installed | 17:47:55 | `Fully Installed`, BuildID 21498291 |
|
||||
| Scheduler completed | 17:47:56 | `No Error` |
|
||||
|
||||
Preallocation took **404 seconds**. Start to scheduler completion took
|
||||
**996 seconds**. Live counters showed 2,216 allocation calls, zero allocation
|
||||
failures and about **7.1 seconds aggregate allocation-wrapper time**. The saved
|
||||
diagnostic detail log is capped at the first 64 allocation details per process;
|
||||
that file alone cannot reproduce the live aggregate counter observation.
|
||||
|
||||
The final manifest had `StateFlags=4`, `UpdateResult=0`, all expected download
|
||||
and staging bytes completed, and `SizeOnDisk=7997085707`. The completed executable
|
||||
was under `steamapps/common/1000xRESIST`; the active staging directory was gone.
|
||||
|
||||
Transfer rates were mostly 117–132 Mbps, about 15–16.5 MB/s. Two root metadata
|
||||
experiments ran during downloading, so this is not a clean network/card
|
||||
throughput benchmark. No matched full internal-storage install was performed.
|
||||
|
||||
The run's `storage.log` reported native exFAT and a passed truncate reservation
|
||||
probe. Recorded allocation details used `api=fallocate_ftruncate`, with
|
||||
`result=0` and `api_error=0`.
|
||||
|
||||
## What the metadata measurements show
|
||||
|
||||
Metadata is filesystem bookkeeping: names, directory entries, sizes and space
|
||||
allocation. Steam's `Preallocating` phase includes work outside the observed
|
||||
allocation wrappers, including creating and locating files.
|
||||
|
||||
### Directory reads through native and FUSE paths
|
||||
|
||||
A helper ran in a normal app process and listed the same stable asset directory
|
||||
from a saved staging tree through both host paths. It used the existing fast-path
|
||||
syscall trampoline to bypass PRoot path translation while retaining the app's
|
||||
Android permissions. The read buffer was 128 KiB.
|
||||
|
||||
| View | Elapsed | Successful `getdents64` calls | Directory bytes |
|
||||
|---|---|---|---|
|
||||
| Native exFAT | About 2.3 ms | 2 | 154,920 |
|
||||
| Android FUSE | About 501 ms | 112 | 154,872 |
|
||||
|
||||
The views returned slightly different byte counts. This was a single
|
||||
native-first pass, not a repeated benchmark with fully controlled cache state.
|
||||
It demonstrates a large cost difference for that directory read, not a
|
||||
corresponding multiplier for a full Steam install.
|
||||
|
||||
An earlier root listing during concurrent file creation measured roughly
|
||||
5.56 seconds through FUSE and 9.25 milliseconds native. Its directory was
|
||||
changing, so it is weaker evidence and is not used as a controlled comparison.
|
||||
|
||||
### File creation and size updates
|
||||
|
||||
During the fresh native-path Steam run, sampled kernel stacks included:
|
||||
|
||||
```text
|
||||
__sync_dirty_buffer -> exfat_update_bh -> exfat_init_ext_entry
|
||||
-> exfat_add_entry -> exfat_create -> path_openat
|
||||
|
||||
__wait_on_buffer -> exfat_update_bhs -> exfat_free_dentry_set
|
||||
-> __exfat_write_inode -> exfat_truncate -> do_sys_ftruncate
|
||||
```
|
||||
|
||||
These were live samples, not a continuous attribution profile. They show time
|
||||
waiting in the native filesystem's creation/update paths during the delay.
|
||||
|
||||
A root-only helper created a temporary directory, then 64 long-named files using
|
||||
`open(O_CREAT|O_EXCL|O_WRONLY, 0600)`, `ftruncate(fd, 262144)` and `close`. It timed
|
||||
the creation and truncate calls separately and removed its files afterward.
|
||||
|
||||
| Location/run | Sum of open times | Sum of truncate times | Whole loop |
|
||||
|---|---|---|---|
|
||||
| Native SD, original mount | 6.707435 s | 0.084806 s | 6.794807 s |
|
||||
| Native SD, later repeat | 25.181255 s | 0.309577 s | 25.493210 s |
|
||||
| Internal app cache, live observation | About 7.88 ms | About 0.498 ms | About 9.1 ms |
|
||||
|
||||
The SD results varied substantially, and these root probes do not reproduce the
|
||||
normal app's complete Steam workload. The measured internal probe is not a full
|
||||
internal-install benchmark. Within these probes, file creation cost far more
|
||||
than the observed truncate calls.
|
||||
|
||||
### `dirsync` and the failed remount comparison
|
||||
|
||||
The [Linux mount documentation](https://man7.org/linux/man-pages/man2/mount.2.html)
|
||||
defines `MS_DIRSYNC` as synchronous directory changes. Combined with the observed
|
||||
exFAT buffer waits, this makes synchronous SD metadata updates a strong lead.
|
||||
It remains an inference about the remaining overall delay.
|
||||
|
||||
A toybox remount attempt returned `Invalid argument`. A direct mount-syscall
|
||||
experiment changed the root view, but Steam's observed mount table still showed
|
||||
`dirsync`. A subsequent 64-file probe took 2.112288 seconds; because the effective
|
||||
flag change was not established and timings were variable, this is **not proof
|
||||
that removing `dirsync` improves Steam allocation**. The Linux documentation also
|
||||
notes that attempts to change `MS_DIRSYNC` during a remount are silently ignored.
|
||||
|
||||
Original effective options were restored and checked in root and app/process
|
||||
views. No remount or root-launch behavior is included in the production patches.
|
||||
|
||||
### What remains attributable to PRoot
|
||||
|
||||
One sampled Steam worker was executing an `openat` through the fast-path
|
||||
trampoline at `0xffff00020`, with an absolute native host path. That establishes
|
||||
that some operations bypassed PRoot's path translation in the actual session.
|
||||
Other syscalls still use PRoot.
|
||||
|
||||
There was no matched PRoot-versus-direct full preallocation comparison. The
|
||||
fraction of the 404 seconds attributable to PRoot is therefore unknown. The
|
||||
earlier [PRoot performance notes](proot-performance.md) concern different hardware
|
||||
and workloads and cannot supply that missing percentage.
|
||||
|
||||
Seven seconds in public allocation wrappers does not mean the remaining
|
||||
397 seconds are unrelated to allocation: libc-internal/direct-syscall bypasses,
|
||||
explicit size changes and file-creation work may occur outside those counters.
|
||||
|
||||
## Experiments that did not become the fix
|
||||
|
||||
- **Directory caching:** eager scans held up directory open; creation-driven
|
||||
invalidation repeatedly reread growing directories. The capped design could
|
||||
also read and discard a large directory before rereading it. A lazy variant
|
||||
still left 182 files taking 4m49s while the allocation wrappers accounted for
|
||||
only 0.879 seconds. These were interrupted/resumed runs, not a matched A/B
|
||||
benchmark. The final #221 snapshot removes the cache entirely.
|
||||
- **Allocation fallback alone:** a FUSE-path attempt was still slow after
|
||||
unsupported allocation calls were handled. A later eager-cache resumed run
|
||||
accumulated roughly 8.36 seconds in 1,435 successful allocation calls over
|
||||
about 36 minutes of wall time. Successful wrappers alone were insufficient.
|
||||
- **Launching Steam through root:** experimental wrappers failed compositor
|
||||
startup. They did not produce allocation measurements and were reverted.
|
||||
- **Changing mount flags:** effective removal of `dirsync` from Steam's view was
|
||||
not demonstrated. The apparent probe speedup is not a validated fix.
|
||||
- **Replacing PRoot or reformatting storage:** no such replacement, adoptable
|
||||
storage conversion or ext4 loop-image deployment was validated here.
|
||||
|
||||
The early FUSE runs used partial staging state. Their file counts and durations
|
||||
must not be compared to the fresh 2,216-file run as a precise speedup ratio.
|
||||
|
||||
## Post-install launch and separate memory failure
|
||||
|
||||
After deploying #221 + #229 + #233, the installed SD game was launched through
|
||||
Steam. First-run Proton prefix initialization preceded the game window.
|
||||
|
||||
At **18:10:45**, the compositor changed from Steam Big Picture to **1000xRESIST**
|
||||
and received the game's 1280×720 GPU frames. A screenshot showed the game loading
|
||||
screen and spinner. A main menu or sustained gameplay was not validated.
|
||||
|
||||
At **18:13:48.454**, Android recorded the foreground app's exit as reason 3,
|
||||
`LOW_MEMORY`, with main-app PSS 227 MB and RSS 344 MB. Those figures describe that
|
||||
process, not the complete native process tree or its peak memory use. Subsequent
|
||||
gamescope/reaper shutdown messages followed the parent being killed.
|
||||
|
||||
This was after the install had completed. It is a separate unresolved launch/
|
||||
memory issue and does not undo the successful allocation/download result.
|
||||
Post-kill free-memory readings cannot establish peak memory pressure.
|
||||
|
||||
## Remaining questions and next useful tests
|
||||
|
||||
1. Run the same fresh game install on internal and secondary storage with the
|
||||
same manifest, awake device and no competing benchmarks. Compare preallocation,
|
||||
download/staging and commit separately.
|
||||
2. Match the file-creation/extension workload through PRoot and through the normal
|
||||
app's direct syscall path. Keep UID, filesystem, names and sizes identical,
|
||||
repeat runs and record background I/O. This can quantify the remaining tracer
|
||||
contribution without changing storage semantics.
|
||||
3. Establish an actual controlled difference in synchronous directory behavior
|
||||
before attributing a speedup to mount flags. A remount return code alone is
|
||||
insufficient; this is separate from a portable app patch.
|
||||
4. Validate native-path fallback under enforcing SELinux and on unrooted devices,
|
||||
plus allocation behavior near ENOSPC and after interruption. Preserve the
|
||||
configured-path fallback if either access or reservation verification fails.
|
||||
5. Investigate the low-memory exit with process-tree/cgroup memory and Android
|
||||
kill evidence during loading. Treat it separately from install performance.
|
||||
|
||||
At this point, one fresh SD install and the binding regression are validated.
|
||||
Internal-speed parity, the exact PRoot share, a `dirsync` remedy, broad device
|
||||
coverage and stable gameplay remain unproven.
|
||||
|
||||
## Evidence inventory and handoff state
|
||||
|
||||
The device captures used for the final measurements were:
|
||||
|
||||
- `2026-10-04-62-app-raw-probe`: normal-app native/FUSE directory probe.
|
||||
- `2026-10-04-64-steam`: fresh complete allocation/download/commit.
|
||||
- Probe sessions before and after #233: private binding markers.
|
||||
- `2026-10-04-67-steam`: combined-build launch, followed by Android's low-memory
|
||||
kill; the exit reason was obtained separately with `dumpsys activity exit-info`.
|
||||
|
||||
Local originals during the investigation were under
|
||||
`/tmp/droiddeck-storage-live/`: `direct-content-completed.log`,
|
||||
`direct-storage-completed.log`, `app-raw-probe-session.log`,
|
||||
`bind-probe-before.log`, `bind-probe-after.log`,
|
||||
`metadata-mount-comparison.log`, `metadata-syscall-comparison.log`,
|
||||
`game-launch-exit-info.txt`, `combined-233-build.log` and
|
||||
`combined-233-tests.log`. The repository evidence file preserves the selected
|
||||
excerpts even if those temporary local files disappear. Live-only counters,
|
||||
kernel samples and the internal metadata timing are identified above rather
|
||||
than represented as saved continuous traces.
|
||||
|
||||
The combined signed build and completed SD install remained on Thor. Storage
|
||||
diagnostics remained enabled. Temporary probe files, executables and obsolete
|
||||
partial staging were removed after validation. Original effective mount options
|
||||
were restored; no app-specific Magisk root policy remained. The primary checkout's
|
||||
unrelated `SessionService.kt` modification was preserved.
|
||||
@@ -1,62 +0,0 @@
|
||||
# DroidDeck 0.3.1
|
||||
|
||||
### Steam
|
||||
|
||||
- Decky plugins can be imported from ZIP files, with remote binaries verified and installed copies of the same plugin replaced. (@xXJSONDeruloXx, [#79](https://github.com/Droid-Deck/DroidDeck/pull/79))
|
||||
- Steam's Internet page shows Android Wi-Fi and cellular connections. Optional Wi-Fi discovery adds network names and nearby networks with Android's Location permission. (@xXJSONDeruloXx, [#150](https://github.com/Droid-Deck/DroidDeck/pull/150))
|
||||
- Paste text from the Android clipboard into Steam sessions. (@xXJSONDeruloXx, [#151](https://github.com/Droid-Deck/DroidDeck/pull/151))
|
||||
- The Proton selected in Components stays in sync with Steam's default compatibility tool, and runnable builds are marked **Compatible**. Windows titles with a Valve recommendation use that default unless you choose another compatible tool for the game. (@maxjivi05, [#197](https://github.com/Droid-Deck/DroidDeck/pull/197), [#224](https://github.com/Droid-Deck/DroidDeck/pull/224))
|
||||
|
||||
### Compatibility and performance
|
||||
|
||||
- Choose **esync**, **fsync**, experimental **ntsync**, or **wineserver** for Proton games. These sync options work around Android's missing kernel support, with esync as the default for fresh installs and existing choices preserved. (@maxjivi05, [#197](https://github.com/Droid-Deck/DroidDeck/pull/197), [#223](https://github.com/Droid-Deck/DroidDeck/pull/223))
|
||||
- droiddeck-esync packs are matched to the exact Valve, GE-Proton or CachyOS Proton build and fetched automatically. droiddeck-fsync stands in when a pack is not available. (@maxjivi05, [#189](https://github.com/Droid-Deck/DroidDeck/pull/189), [#197](https://github.com/Droid-Deck/DroidDeck/pull/197))
|
||||
- Linux-only x86 Steam titles can run through FEX using Steam's FEX and Steam Linux Runtime, with controller input and the device's graphics drivers. Missing dependencies are requested through Steam. (@maxjivi05, [#197](https://github.com/Droid-Deck/DroidDeck/pull/197))
|
||||
- .NET and Godot games get automatic launch fixes under FEX, including the settings needed for Slay the Spire 2. Per-game overrides are kept. (@magarto, [#168](https://github.com/Droid-Deck/DroidDeck/pull/168))
|
||||
|
||||
### Display and effects
|
||||
|
||||
- Live image scaling with AMD FSR 1, Snapdragon GSR and GSR quality, NVIDIA NIS, linear and nearest filtering, plus sharpening. (@magarto, @The412Banner, [#128](https://github.com/Droid-Deck/DroidDeck/pull/128), [#198](https://github.com/Droid-Deck/DroidDeck/pull/198))
|
||||
- An **Effects** page adds presets, FXAA, Toon, CRT, NTSC and Fake HDR. Advanced controls cover sharpening, debanding, brightness, contrast, gamma and saturation, with choices saved between sessions. (@The412Banner, @xXJSONDeruloXx, [#198](https://github.com/Droid-Deck/DroidDeck/pull/198), [#247](https://github.com/Droid-Deck/DroidDeck/pull/247))
|
||||
- Anisotropic filtering and texture sharpness for DirectX 9–11 games, applied on the next game launch. (@The412Banner, [#198](https://github.com/Droid-Deck/DroidDeck/pull/198))
|
||||
- One **Resolution** menu before starting a session, with preset dimensions, Custom and **Match screen**. Resolution, image scaling and fullscreen compatibility have separate controls. (@xXJSONDeruloXx, [#247](https://github.com/Droid-Deck/DroidDeck/pull/247))
|
||||
|
||||
### Controls and sessions
|
||||
|
||||
- Standard Android picture-in-picture, opened manually or automatically when leaving a ready session, with second-screen controls restored when you return. (@xXJSONDeruloXx, [#156](https://github.com/Droid-Deck/DroidDeck/pull/156), [#195](https://github.com/Droid-Deck/DroidDeck/pull/195))
|
||||
- A quick toggle hides or restores on-screen controls. **Touch Off** ignores touches on the game picture while keeping Android controls usable. (@xXJSONDeruloXx, [#147](https://github.com/Droid-Deck/DroidDeck/pull/147), [#196](https://github.com/Droid-Deck/DroidDeck/pull/196))
|
||||
- Optional game vibration and on-screen Steam, Quick Access and keyboard buttons. (@xXJSONDeruloXx, [#194](https://github.com/Droid-Deck/DroidDeck/pull/194))
|
||||
- Steam session settings use tabs for Display, Controls, Games, Audio, Session and Steam. The session menu starts with Controller, gives second-screen modes their own page, and groups live display changes separately from settings for the next game launch. (@xXJSONDeruloXx, [#247](https://github.com/Droid-Deck/DroidDeck/pull/247))
|
||||
- Compact Steam Home and Quick Access shortcuts beside Stop. Switching to Desktop stays in Steam's own menu. (@xXJSONDeruloXx, [#188](https://github.com/Droid-Deck/DroidDeck/pull/188), [#196](https://github.com/Droid-Deck/DroidDeck/pull/196))
|
||||
- Back's double-press window is back to 500 ms, making Quick Access easier to open. (@xXJSONDeruloXx, [#193](https://github.com/Droid-Deck/DroidDeck/pull/193))
|
||||
|
||||
### Apps and launcher
|
||||
|
||||
- Android home-screen shortcuts for installed Steam games and added games. (@xXJSONDeruloXx, [#157](https://github.com/Droid-Deck/DroidDeck/pull/157))
|
||||
- Export per-game `.droiddeck` launch files and Steam icons for Android frontends, with optional automatic folder sync as the library changes. (@xXJSONDeruloXx, [#179](https://github.com/Droid-Deck/DroidDeck/pull/179))
|
||||
- Import x86 AppImages and run x86 Linux scripts and programs through FEX. Added apps have a **Use FEX** Auto/On/Off choice, and GitHub imports can use an x86_64 AppImage when no ARM64 build is available. (@maxjivi05, [#197](https://github.com/Droid-Deck/DroidDeck/pull/197))
|
||||
- Vulkan Qt Quick AppImages such as OpenNOW use Wayland to avoid X11 startup failures. (@maxjivi05, [#197](https://github.com/Droid-Deck/DroidDeck/pull/197))
|
||||
- Preview updates show recent published changes and how many builds behind you are when the installed Preview can be matched. (@xXJSONDeruloXx, [#159](https://github.com/Droid-Deck/DroidDeck/pull/159))
|
||||
- A new empty-library intro and DroidDeck wordmark on the Steam page, plus an option to reduce app animations. (@xXJSONDeruloXx, [#182](https://github.com/Droid-Deck/DroidDeck/pull/182), [#194](https://github.com/Droid-Deck/DroidDeck/pull/194))
|
||||
- The Linux file manager bookmarks the selected game library automatically. (@xXJSONDeruloXx, [#194](https://github.com/Droid-Deck/DroidDeck/pull/194))
|
||||
|
||||
### Languages and logs
|
||||
|
||||
- Simplified Chinese. (@Dantalian-dev, [#202](https://github.com/Droid-Deck/DroidDeck/pull/202))
|
||||
- Japanese, Korean and Traditional Chinese for Taiwan, Hong Kong and Macau. (@starwishHi, [#216](https://github.com/Droid-Deck/DroidDeck/pull/216))
|
||||
- Optional **Storage diagnostics** include allocation and storage timing in shared session logs to help investigate slow Steam installs. (@xXJSONDeruloXx, [#158](https://github.com/Droid-Deck/DroidDeck/pull/158))
|
||||
- Session logs retain their final output and include more detail when an AppImage or FEX program fails to start or crashes. (@maxjivi05, [#197](https://github.com/Droid-Deck/DroidDeck/pull/197))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Steam's Deck controller not being found on handhelds with older kernels. (@xXJSONDeruloXx, [#146](https://github.com/Droid-Deck/DroidDeck/pull/146))
|
||||
- Physical and on-screen controllers doing nothing on ColorOS devices with linked app data directories. (@maxjivi05, [#242](https://github.com/Droid-Deck/DroidDeck/pull/242))
|
||||
- Game vibration going to the phone instead of the active physical controller. The device vibrator remains the fallback for on-screen controls or controllers without motors. (@maxjivi05, [#242](https://github.com/Droid-Deck/DroidDeck/pull/242))
|
||||
- A physical mouse stopping camera movement at the screen edge. Games that request a pointer lock now use Android's relative pointer capture, released while menus or PiP are open. (@maxjivi05, [#242](https://github.com/Droid-Deck/DroidDeck/pull/242))
|
||||
- Steam remaining on a black screen after idle sleep or Android session resume. (@xXJSONDeruloXx, @jmarti326, [#155](https://github.com/Droid-Deck/DroidDeck/pull/155), [#172](https://github.com/Droid-Deck/DroidDeck/pull/172))
|
||||
- Steam stuck at **Waiting for Steam** after an interrupted client update. After two starts without a frame, DroidDeck fetches the client again while preserving games, settings and user data; **Repair Steam client** also queues a manual repair. (@maxjivi05, [#225](https://github.com/Droid-Deck/DroidDeck/pull/225))
|
||||
- Play racing runtime removal. Removal now shows progress and verifies completion, and first-run setup respects the selected Steam channel and saved UI scaling. (@xXJSONDeruloXx, [#185](https://github.com/Droid-Deck/DroidDeck/pull/185))
|
||||
- GE-Proton and CachyOS Proton failing their protonfixes checks because Android blocks `/proc/sys/fs/file-max`. (@magarto, [#169](https://github.com/Droid-Deck/DroidDeck/pull/169))
|
||||
- DirectAudio not being selected correctly, mismatched FEX helpers surviving component swaps, and FEX or its runtime not being executable from an SD-card Steam library. (@maxjivi05, [#197](https://github.com/Droid-Deck/DroidDeck/pull/197))
|
||||
|
||||
[Full changelog](https://github.com/Droid-Deck/DroidDeck/compare/0.3.0...0.3.1)
|
||||
@@ -0,0 +1,94 @@
|
||||
# Settings layout
|
||||
|
||||
DroidDeck configuration now lives in a searchable Settings hub. Updates remains a
|
||||
separate launcher tab. The hub links to the existing managers and uses the existing
|
||||
preference stores and callbacks; there is no preference migration.
|
||||
|
||||
## Where controls moved
|
||||
|
||||
| Previous location | New home | Reason |
|
||||
| --- | --- | --- |
|
||||
| Setup → Launcher | General | Appearance and Android Home behavior are launcher settings. |
|
||||
| Steam/Desktop settings → Display and HDR | Display & graphics | Resolution, frame limits, scaling and real HDR output belong together. Resolution, HDR and frame limit keep their mode-specific scope; aspect ratio and scaling remain shared. |
|
||||
| Setup → Session → Frame generation | Display & graphics | Frame generation is a graphics choice rather than a startup behavior. Existing import and availability checks remain. |
|
||||
| Session menu → Effects and texture filtering | Display & graphics, with the session controls retained | Saved defaults are discoverable before a session starts. The session menu still applies its live effects using the same controls. Simulated HDR is labeled separately from HDR10 output. |
|
||||
| Setup → Controller; Steam/Desktop settings → Touch controls | Controls & input | Controller appearance, mapping, rumble, touch behavior, Steam controller identity and Back action order have one configuration home. |
|
||||
| Steam settings → Audio | Audio & microphone | Game audio and Steam-menu audio have different backends; naming the target prevents a toggle from appearing to affect both. |
|
||||
| Steam settings → Storage and Added games; Setup tools → ROMs and Files | Library & storage | An additional Steam library differs from importing an existing game directory. Folder and executable selectors remain available alongside artwork controls. |
|
||||
| Steam/Desktop settings → Session, Startup, Client, Network, Decky and Desktop renderer; Setup → Offline | Sessions | These options determine how sessions start, suspend and integrate with Android. Steam-only controls remain Steam-only. |
|
||||
| Launcher rail → Components; Setup tools → Protons and Performance; Steam settings → Game settings | Compatibility & performance | GPU drivers, Proton builds, component swaps and execution tuning are related troubleshooting tools. Specialist pages keep their own operations and progress indicators. |
|
||||
| Setup → Overview and logs; Steam settings → Storage diagnostics | Support & diagnostics | Runtime readiness, child-process repair, logging and storage diagnostics are actionable troubleshooting controls. |
|
||||
| Launcher rail → Updates | Updates, unchanged | Releases, test builds, update channels and build information remain directly accessible. Support links to this tab. |
|
||||
|
||||
Advanced FEX, synchronization, environment, effects, texture and storage diagnostic
|
||||
controls stay in expandable groups. Searching can open these groups automatically;
|
||||
users can still collapse them.
|
||||
|
||||
## Control and workflow inventory against `main`
|
||||
|
||||
This inventory compares the six pre-hub screens on `main` with the category
|
||||
content and specialist pages. It includes controls that appear only for a
|
||||
supported device, Steam mode, an installed runtime, or an active session.
|
||||
|
||||
| Previous source | Controls and workflows in the old screen | Current home and retained workflow |
|
||||
| --- | --- | --- |
|
||||
| `FrontEndSetup.kt` | Launcher theme; Android home-app enablement and conditional default-home picker; launcher fullscreen and animation; Flathub visibility; controller layout/mapping controls; Back-button action order; offline-account toggle; frame-generation mode and Lossless Scaling import; session-log enable/share/clear; Files and ROM-folder tools; Proton and Performance shortcuts; system checks for GPU support, runtime readiness/update/removal, phantom-process limit and sign-in. | General keeps launcher appearance/home/store controls; Controls keeps controller settings and Back order; Sessions keeps offline mode; Display & graphics keeps frame generation/import; Library & storage keeps Files and ROM folders; Compatibility & performance opens Components, Proton and Performance managers; Support & diagnostics keeps GPU/runtime/process-limit checks, developer-options and wireless-ADB recovery, account status and log controls. The Updates action links to the existing Updates tab. The process-limit repair/detail buttons, runtime progress and enabled/disabled states remain conditional. |
|
||||
| `ModeSettingsDialog.kt` | Per-mode resolution presets plus custom width/height entry, aspect ratio, FPS cap, scaler and sharpness, HDR10, GPU-driver shortcut, touch mode, Steam on-screen-controller mode and controller identity, Back order, suspend policy, automatic PiP and PiP shortcut, Steam startup, Decky check/install/update/uninstall/enable/plugin-ZIP workflows, Steam Deck mode and branch, MangoHud, Wi-Fi discovery with permission explanation/system-settings route, imported game folders and forget action, artwork, per-folder executable selection/import, game-storage location/import, storage diagnostics, FEX, synchronization backend, per-game environment, fill/16:9 and Desktop renderer. | Display & graphics owns resolution/custom dialog, ratio, FPS, scaling/sharpness, HDR10, fill/16:9 and MangoHud; Steam/Desktop selection still scopes mode-specific values while ratio/scaler defaults remain shared. Controls owns touch and Steam controller identity, with Back order alongside controller setup. Audio & microphone owns direct game audio, separately labeled Steam-menu audio and microphone. Library & storage owns game imports/executable choices/artwork and second-library selection/folder import; storage diagnostics is under Support. Sessions owns suspend, PiP auto-entry, startup, Decky management, Steam Deck mode/branch, Wi-Fi discovery and Desktop renderer. Compatibility & performance owns the GPU-driver shortcut plus FEX, sync backend and game environment in an expandable group. Steam-only, Desktop-only, permission-dependent and Decky/runtime/session-running gates remain in place. |
|
||||
| `ComponentsPage.kt` | GPU-driver tabs and Android/Linux driver management; release refresh, download/import, selection/removal and bundled Android-driver restore; Proton/component selectors; per-Proton FEX, DXVK and VKD3D original/package status; next-game queued swaps and cancellation; catalog refresh/download; WCP import; restore-original and delete confirmations; in-use/game-running status and About dialog. | Compatibility & performance opens the existing Components manager. GPU search opens its GPU view directly. The manager retains its tabs, progress, confirmation dialogs, queued-operation state, per-Proton view and driver import/restore actions. |
|
||||
| `ProtonPage.kt` | Available Proton build list; install, remove and cancel-queued operations; runtime-not-ready explanation; install/remove/session-running availability gates and progress. | Compatibility & performance → Proton versions opens the same manager; runtime requirements, queue cancellation and operation gates remain there. |
|
||||
| `PerformanceDialog.kt` | Client CPU-core override and client-core selection; game-core selection; GL threading, Zink, GL-error handling and Gamescope real-time priority; GPU-clock pinning; Turnip system-memory behavior; Xalia; esync fallback, fsync-first and fast sync; proot seccomp and dependent fast path; guest-hostname validation/edit; phantom-process warning. | Compatibility & performance → Performance opens the existing specialist page. Core multi-selects, conditional controls, hostname validation and warning remain on that page. FEX and the game synchronization selector are also discoverable directly in the expandable Compatibility group; their specialist workflows remain intact. |
|
||||
| `SessionOverlay.kt` | Live HUD/fill/scaling/sharpness/frame-generation controls; effects preset, CAS/strength, fake HDR, debanding/strength, brightness, contrast, gamma, saturation, FXAA, toon, CRT and NTSC; texture anisotropy and LOD bias; live component selection/queued-swap cancellation; touch/OSC and virtual-controller rumble/Steam/QAM/keyboard buttons; Back order; physical/Android keyboard launch; second-screen mode/display; Android app launch; suspend policy, ratio, FEX/game environment, log sharing, PiP entry/auto-entry, background and stop-session confirmation; Steam-menu and QAM shortcuts. | SessionOverlay retains live HUD, launch-image controls, menus, component swaps, device routing, app launch and session actions. Display & graphics now also edits saved screen-effects and texture-filtering defaults. Those preference-backed values are used at session/game launch; the drawer continues applying screen effects live and keeps texture choices in its own controls. Look presets that select a scaler update the shared scaler state. Keyboard display, second-screen routing, QAM/Steam actions, app/session actions and stop confirmation remain exclusive to the live drawer; only the virtual-controller keyboard-button preference is in Controls. |
|
||||
|
||||
**Loss found:** none in this source-to-destination inventory. The old Setup tool cards
|
||||
and Updates entry have become category/search destinations, while the Components,
|
||||
Proton and Performance operations remain in their specialist screens. Session-only
|
||||
actions remain in the drawer rather than becoming persistent settings.
|
||||
|
||||
## Navigation and scope
|
||||
|
||||
- Back returns from a specialist manager to its category, then to the hub or the
|
||||
contextual Steam/Desktop/game page that opened settings. Selecting another rail
|
||||
item closes the settings history.
|
||||
- Category and hub scroll state is retained when a manager opens over them. Search
|
||||
targets have stable IDs and request focus on the corresponding actionable control.
|
||||
- Steam/Desktop selectors expose existing mode-specific defaults. Shared values do
|
||||
not become separate preferences when the selected mode changes.
|
||||
- GPU shortcuts open the GPU view directly. Automatic/manual driver selection,
|
||||
effective selections, imports, downloads, deletion and bundled restore are retained.
|
||||
- **Default Proton** changes Steam's synchronized default through `ProtonDefault`.
|
||||
**Editing components for** selects the build whose components are displayed and
|
||||
does not change the default. Proton installations remain a separate manager;
|
||||
per-game Proton overrides remain in Steam's Properties → Compatibility.
|
||||
- Keyboard display, second-screen routing, Steam menu/QAM actions, session restart
|
||||
and stop stay exclusively in the session menu. Controller settings can still
|
||||
configure the presence of a keyboard button without opening the live keyboard.
|
||||
- Runtime prerequisites, active-session restrictions, Android permissions,
|
||||
confirmations, downloads, queued operations and legacy synchronization switches
|
||||
retain their existing behavior.
|
||||
|
||||
## Feedback behind the changes
|
||||
|
||||
These are qualitative reports, some from earlier builds, rather than a claim that
|
||||
every reported runtime issue remains in the current version:
|
||||
|
||||
- [Driver navigation](https://discord.com/channels/1552707793247539220/1552707794430459916/1555132174364315729)
|
||||
exposed confusion about being sent to Components and changing its view with RB.
|
||||
The driver shortcut now chooses the GPU view directly.
|
||||
- [Proton selection](https://discord.com/channels/1552707793247539220/1552707794430459916/1555965564621562008)
|
||||
highlighted several selection concepts. Separate default, installation and editing
|
||||
controls make each operation explicit while retaining Steam synchronization.
|
||||
- [Audio targets](https://discord.com/channels/1552707793247539220/1556195514322780160/1556272336393478195)
|
||||
motivated separating game audio from Steam-menu audio labels.
|
||||
- [Storage paths](https://discord.com/channels/1552707793247539220/1556195514322780160/1556224196395270225)
|
||||
motivated putting library paths beside game imports and file access.
|
||||
|
||||
## Verification boundaries
|
||||
|
||||
Navigation history and catalog routing have JVM tests, alongside the existing
|
||||
preference and workflow regression tests. The complete APK build uses
|
||||
`DROIDDECK_BUILD_VARIANT=debug tools/build_local.sh` to include native assets.
|
||||
|
||||
Device acceptance still requires checking controller focus and Back restoration,
|
||||
search scrolling, narrow layouts, permission dialogs and the session-menu boundary
|
||||
on an Android handheld. No Android device was connected during this implementation;
|
||||
successful compilation and unit tests do not establish on-device rendering or input.
|
||||
@@ -16,11 +16,6 @@ export QT_QPA_PLATFORMTHEME=lxqt
|
||||
# The prefs for this are only advisory and a profile can override them; the environment is not.
|
||||
export MOZ_DISABLE_CONTENT_SANDBOX=1 MOZ_DISABLE_GMP_SANDBOX=1 MOZ_DISABLE_RDD_SANDBOX=1
|
||||
export MOZ_DISABLE_SOCKET_PROCESS_SANDBOX=1 MOZ_DISABLE_UTILITY_SANDBOX=1
|
||||
# Firefox seals the size of the shared memory it hands a tab; on Android 16 (Galaxy S25/S26,
|
||||
# RedMagic) adding the seal fails, Firefox only warns, and the tab refuses the unsealed memory
|
||||
# ("Shared memory PlatformHandle is not safe to map") and dies on signal 11 - every page. Firefox's
|
||||
# own switch skips the seals.
|
||||
export MOZ_SHM_NO_SEALS=1
|
||||
# pixman composites in software and gives programs shm buffers only, so a Vulkan program on it
|
||||
# fails at its swapchain. vulkan (or gles2) composite on the GPU and give programs DMA-BUFs, but
|
||||
# stock wlroots allocates through gbm on a real DRM node and the KGSL stand-in is not one ("unable
|
||||
|
||||
@@ -24,8 +24,6 @@ fi
|
||||
# X11, which it picks from the session type.
|
||||
export MOZ_DISABLE_CONTENT_SANDBOX=1 MOZ_DISABLE_GMP_SANDBOX=1 MOZ_DISABLE_RDD_SANDBOX=1
|
||||
export MOZ_DISABLE_SOCKET_PROCESS_SANDBOX=1 MOZ_DISABLE_UTILITY_SANDBOX=1
|
||||
# Android 16 refuses Firefox the size seal on a tab's shared memory; see droiddeck-desktop.
|
||||
export MOZ_SHM_NO_SEALS=1
|
||||
# sharun images start the app through their own ld.so, patched not to read /etc/ld.so.preload, and
|
||||
# drop LD_PRELOAD unless allowed: without this the app never gets the session's pads.
|
||||
if [ -s /etc/ld.so.preload ]; then
|
||||
|
||||
@@ -18,8 +18,6 @@ from gi.repository import Gio, GLib # noqa: E402
|
||||
NAME = "org.freedesktop.login1"
|
||||
ROOT = "/org/freedesktop/login1"
|
||||
INTERFACE = NAME + ".Manager"
|
||||
UPOWER = "org.freedesktop.UPower"
|
||||
UPOWER_ROOT = "/org/freedesktop/UPower"
|
||||
INTROSPECTION = """
|
||||
<node>
|
||||
<interface name="org.freedesktop.login1.Manager">
|
||||
@@ -31,13 +29,6 @@ INTROSPECTION = """
|
||||
</interface>
|
||||
</node>
|
||||
"""
|
||||
UPOWER_INTROSPECTION = """
|
||||
<node>
|
||||
<interface name="org.freedesktop.UPower">
|
||||
<method name="Suspend"/>
|
||||
</interface>
|
||||
</node>
|
||||
"""
|
||||
|
||||
|
||||
class LoginManager:
|
||||
@@ -46,15 +37,10 @@ class LoginManager:
|
||||
self.directory = Path(directory)
|
||||
self.request = self.directory / "steam-sleep"
|
||||
self.state = self.directory / "steam-sleep-state"
|
||||
self.wake = self.directory / "steam-wake"
|
||||
self.pending = None
|
||||
self.timeout = None
|
||||
info = Gio.DBusNodeInfo.new_for_xml(INTROSPECTION).interfaces[0]
|
||||
self.registration = bus.register_object(ROOT, info, self.method, self.property, None)
|
||||
# Steam can issue its suspend command through the legacy UPower service even
|
||||
# while listening to login1's sleep/resume notifications. Use one handshake.
|
||||
upower_info = Gio.DBusNodeInfo.new_for_xml(UPOWER_INTROSPECTION).interfaces[0]
|
||||
self.upower_registration = bus.register_object(UPOWER_ROOT, upower_info, self.method, None, None)
|
||||
self.monitor = Gio.File.new_for_path(str(self.directory)).monitor_directory(Gio.FileMonitorFlags.NONE, None)
|
||||
self.monitor.connect("changed", self.changed)
|
||||
|
||||
@@ -83,7 +69,7 @@ class LoginManager:
|
||||
reply.return_value(None)
|
||||
# Flush the signal and method reply without blocking this D-Bus callback. Once both are
|
||||
# on the wire, publishing the request lets the host safely freeze this service.
|
||||
self.bus.flush(None, self.publish_after_flush, None)
|
||||
self.bus.flush_async(None, self.publish_after_flush, None)
|
||||
|
||||
def publish_after_flush(self, connection, result, _data):
|
||||
try:
|
||||
@@ -106,10 +92,6 @@ class LoginManager:
|
||||
return False
|
||||
|
||||
def changed(self, monitor, file, other, event):
|
||||
if file.get_basename() == self.wake.name or (other and other.get_basename() == self.wake.name):
|
||||
if self.wake.exists():
|
||||
self.wake.unlink(missing_ok=True)
|
||||
self.resume(force=True)
|
||||
if file.get_basename() == self.state.name or (other and other.get_basename() == self.state.name):
|
||||
self.check_state()
|
||||
|
||||
@@ -131,13 +113,8 @@ class LoginManager:
|
||||
self.resume()
|
||||
return False
|
||||
|
||||
def resume(self, force=False):
|
||||
def resume(self):
|
||||
if self.pending is None:
|
||||
if force:
|
||||
# A missed suspend command leaves Steam without the first half of
|
||||
# the handshake. Replay both notifications, without pausing again.
|
||||
self.notify(True)
|
||||
self.bus.flush(None, self.finish_recovery, None)
|
||||
return
|
||||
self.pending = None
|
||||
if self.timeout is not None:
|
||||
@@ -145,14 +122,6 @@ class LoginManager:
|
||||
self.timeout = None
|
||||
self.notify(False)
|
||||
|
||||
def finish_recovery(self, connection, result, _data):
|
||||
try:
|
||||
connection.flush_finish(result)
|
||||
except GLib.Error as error:
|
||||
print("== login1: cannot flush wake recovery: " + str(error), file=sys.stderr)
|
||||
if self.pending is None:
|
||||
self.notify(False)
|
||||
|
||||
|
||||
def main():
|
||||
directory = os.environ.get("BL_LAUNCH_DIR")
|
||||
@@ -162,29 +131,23 @@ def main():
|
||||
ready.unlink(missing_ok=True)
|
||||
loop = GLib.MainLoop()
|
||||
manager = []
|
||||
acquired_names = set()
|
||||
|
||||
def connected(bus, name):
|
||||
if not manager:
|
||||
manager.append(LoginManager(bus, directory))
|
||||
manager.append(LoginManager(bus, directory))
|
||||
|
||||
def acquired(bus, name):
|
||||
acquired_names.add(name)
|
||||
if acquired_names == {NAME, UPOWER}:
|
||||
ready.write_text("ready\n")
|
||||
ready.write_text("ready\n")
|
||||
|
||||
def lost(bus, name):
|
||||
ready.unlink(missing_ok=True)
|
||||
loop.quit()
|
||||
|
||||
owners = [Gio.bus_own_name(Gio.BusType.SYSTEM, name, Gio.BusNameOwnerFlags.NONE, connected, acquired, lost)
|
||||
for name in (NAME, UPOWER)]
|
||||
owner = Gio.bus_own_name(Gio.BusType.SYSTEM, NAME, Gio.BusNameOwnerFlags.NONE, connected, acquired, lost)
|
||||
try:
|
||||
loop.run()
|
||||
finally:
|
||||
ready.unlink(missing_ok=True)
|
||||
for owner in owners:
|
||||
Gio.bus_unown_name(owner)
|
||||
Gio.bus_unown_name(owner)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -162,7 +162,7 @@ if [ -z "${BL_INSIDE:-}" ]; then
|
||||
fi
|
||||
fi
|
||||
args=(--backend wayland --expose-wayland -f -W "$width" -H "$height" -w "$nested" -h "$height")
|
||||
[ "$nested" != "$width" ] && args+=(-S stretch) && export BL_STRETCHED=1
|
||||
[ "$nested" != "$width" ] && args+=(-S stretch)
|
||||
# -r is what gamescope advertises as the refresh rate, and what a game reads as the display's.
|
||||
# Left unset it defaults to 60, so a 120 Hz panel offers only 60 Hz in game settings. The FPS
|
||||
# limiter wins when it is on (it is a deliberate cap); otherwise use the panel's own rate.
|
||||
@@ -179,10 +179,9 @@ if [ -z "${BL_INSIDE:-}" ]; then
|
||||
[ "$mode" = steam ] && args+=(--default-touch-mode 4)
|
||||
# A game that resizes its own window when it loses focus (the Steam menu opening over it) comes
|
||||
# back smaller, and gamescope draws a window that is not flagged fullscreen at its own size in
|
||||
# the top-left corner. Forcing every window to the output's size keeps it filling the screen,
|
||||
# but a game running at a resolution other than the screen's fights it and flickers, so it is
|
||||
# off unless the app asks for it: BL_GAMESCOPE_FORCE_FULLSCREEN=1 turns it on.
|
||||
[ "$mode" = steam ] && [ "${BL_GAMESCOPE_FORCE_FULLSCREEN:-0}" = 1 ] && args+=(--force-windows-fullscreen)
|
||||
# the top-left corner. Forcing every window to the output's size keeps it filling the screen.
|
||||
# BL_GAMESCOPE_FORCE_FULLSCREEN=0 turns it off.
|
||||
[ "$mode" = steam ] && [ "${BL_GAMESCOPE_FORCE_FULLSCREEN:-1}" = 1 ] && args+=(--force-windows-fullscreen)
|
||||
# HDR10: the app opened its compositor's colour-management gate for this session (BL_HDR=1);
|
||||
# gamescope then offers HDR to its clients through the same wp_color_manager_v1 it binds on ours.
|
||||
[ "${BL_HDR:-0}" = 1 ] && args+=(--hdr-enabled)
|
||||
@@ -446,7 +445,7 @@ case $mode in
|
||||
# the root window, which it watches. What gamescope was started with is where this begins.
|
||||
# Not on the desktop (BL_DESKTOP): no gamescope there, and the loop would outlive the client.
|
||||
[ -z "${BL_DESKTOP:-}" ] && (
|
||||
last=${BL_GAMESCOPE_FORCE_FULLSCREEN:-0}
|
||||
last=${BL_GAMESCOPE_FORCE_FULLSCREEN:-1}
|
||||
while :; do
|
||||
nap 1
|
||||
want=
|
||||
@@ -459,19 +458,6 @@ case $mode in
|
||||
fi
|
||||
done
|
||||
) &
|
||||
# With the 16:9 stretch on, the client's own scaler must not undo it: in Deck mode it sets
|
||||
# GAMESCOPE_NEW_SCALING_SCALER to Auto (0), which fits the 16:9 picture with bars and outranks -S.
|
||||
# Auto is put back to Stretch (4); a mode picked in the QAM (Integer, Fit, Fill) is kept.
|
||||
[ -z "${BL_DESKTOP:-}" ] && [ "${BL_STRETCHED:-0}" = 1 ] && (
|
||||
while :; do
|
||||
nap 1
|
||||
cur=$(xprop -root GAMESCOPE_NEW_SCALING_SCALER 2>/dev/null) || continue
|
||||
case $cur in *" = "*) cur=${cur##* = } ;; *) cur=0 ;; esac
|
||||
[ "$cur" = 0 ] || continue
|
||||
xprop -root -f GAMESCOPE_NEW_SCALING_SCALER 32c -set GAMESCOPE_NEW_SCALING_SCALER 4 2>/dev/null \
|
||||
&& echo "== stretch 16:9 to panel: the client's scaler was Auto, set to Stretch"
|
||||
done
|
||||
) &
|
||||
# Resume from the Steam menu. The menu is an overlay that takes input, and a fullscreen game that
|
||||
# loses input minimizes itself; gamescope only takes a window out of that state when the focused
|
||||
# window changes, which the menu never does, so the game stayed minimized after Resume (a black
|
||||
@@ -698,8 +684,6 @@ BUSCONF
|
||||
_bl_ui+=(-steamdeck -steamos3)
|
||||
# The QAM's Scaling Filter lists NVIDIA Image Scaling only when told gamescope has it (it does).
|
||||
export STEAM_GAMESCOPE_NIS_SUPPORTED=1
|
||||
# And shows its Scaling Mode and Scaling Filter only when told gamescope takes them.
|
||||
export STEAM_GAMESCOPE_FANCY_SCALING_SUPPORT=1
|
||||
echo "== steam: Deck mode on (-steamdeck -steamos3)"
|
||||
fi
|
||||
# What a killed session leaves behind. Android ends sessions without warning (backgrounding, the
|
||||
@@ -791,10 +775,6 @@ BUSCONF
|
||||
echo "== steam: client branch on disk was '$(cat "$steam_beta" 2>/dev/null)', set to '$steam_channel' to match -clientbeta"
|
||||
echo "$steam_channel" > "$steam_beta"
|
||||
fi
|
||||
if [ -z "${_bl_counted:-}" ] && [ -z "${BL_DESKTOP:-}" ]; then
|
||||
echo start >> "$steam_root/package/droiddeck-unconfirmed"
|
||||
_bl_counted=1
|
||||
fi
|
||||
step "starting the Steam client${BL_STEAM_UI:+ ($BL_STEAM_UI UI)}"
|
||||
"$steam_root/steamrtarm64/steam" "${_bl_ui[@]}" "${_bl_cdp[@]}" -clientbeta "$steam_channel" \
|
||||
-no-cef-sandbox -cef-force-gpu -cef-ozone-platform=x11 \
|
||||
|
||||
@@ -12,33 +12,9 @@ manifest=steam_client_${steam_channel}_linuxarm64
|
||||
steam_root=${XDG_DATA_HOME:-$HOME/.local/share}/Steam
|
||||
stamp=$steam_root/package/droiddeck-installed
|
||||
legacy_stamp=$steam_root/package/bannerlator-installed
|
||||
unconfirmed=$steam_root/package/droiddeck-unconfirmed
|
||||
repair_request=$HOME/.bl-steam-repair
|
||||
if [ -f "$legacy_stamp" ] && [ ! -f "$stamp" ]; then
|
||||
mv -f "$legacy_stamp" "$stamp" || true
|
||||
fi
|
||||
repair=""
|
||||
if [ -e "$repair_request" ]; then
|
||||
repair="requested"
|
||||
elif [ -f "$unconfirmed" ] && ! grep -qx repaired "$unconfirmed" \
|
||||
&& [ "$(grep -cx start "$unconfirmed")" -ge 2 ]; then
|
||||
repair="the client was started $(grep -cx start "$unconfirmed") times without showing anything"
|
||||
fi
|
||||
if [ -n "$repair" ]; then
|
||||
echo "== STEP $(date -u +%H:%M:%S) repairing the Steam client ($repair)"
|
||||
rm -f "$stamp" "$legacy_stamp" "$steam_root/.crash" "$steam_root/steam.pid" \
|
||||
"$steam_root"/package/steam_client_*.manifest "$steam_root"/package/steam_client_*.installed
|
||||
for part in "$steam_root"/package/*.zip.*; do
|
||||
[ -f "$part" ] || continue
|
||||
sum=${part##*.}
|
||||
sum=${sum%%_*}
|
||||
case $sum in
|
||||
*[!0-9a-f]*|"") continue ;;
|
||||
esac
|
||||
[ ${#sum} -eq 40 ] || continue
|
||||
[ "$(sha1sum "$part" | cut -d' ' -f1)" = "$sum" ] || rm -f "$part"
|
||||
done
|
||||
fi
|
||||
[ -x "$steam_root/steamrtarm64/steam" ] && [ -f "$stamp" ] && exit 0
|
||||
|
||||
work=$(mktemp -d)
|
||||
@@ -92,7 +68,3 @@ ln -sfn "$steam_root/linuxarm64" "$HOME/.steam/sdkarm64"
|
||||
ln -sfn "$steam_root/steamrtarm64" "$HOME/.steam/binarm64"
|
||||
ln -sfn "$steam_root/linux32" "$HOME/.steam/sdk32"
|
||||
echo "$version" > "$stamp"
|
||||
if [ -n "$repair" ]; then
|
||||
echo repaired > "$unconfirmed"
|
||||
rm -f "$repair_request"
|
||||
fi
|
||||
@@ -44,7 +44,7 @@ if [ "$pkg" = "$P" ]; then
|
||||
else
|
||||
python3 "$here/axml_rename.py" "$in" "$work/renamed.apk" \
|
||||
"$P=$pkg" "$P.androidx-startup=$pkg.androidx-startup" "$P.logs=$pkg.logs" \
|
||||
"$P.documents=$pkg.documents" "$P.home=$pkg.home" "$P.agent=$pkg.agent" \
|
||||
"$P.documents=$pkg.documents" "$P.home=$pkg.home" \
|
||||
"$P.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION=$pkg.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"
|
||||
fi
|
||||
got=$("$BUILD_TOOLS/aapt" dump badging "$work/renamed.apk" | sed -n "s/^package: name='\([^']*\)'.*/\1/p")
|
||||
|
||||
@@ -117,38 +117,6 @@ class SleepHandshakeTest(unittest.TestCase):
|
||||
self.wait_for(lambda: self.signals == [True, False])
|
||||
self.assertFalse(self.preparing())
|
||||
|
||||
def test_legacy_upower_suspend_uses_the_same_wake_handshake(self):
|
||||
self.bus.call_sync("org.freedesktop.UPower", "/org/freedesktop/UPower",
|
||||
"org.freedesktop.UPower", "Suspend", None, None,
|
||||
Gio.DBusCallFlags.NONE, 2000, None)
|
||||
self.wait_for(lambda: (self.dir / "steam-sleep").exists())
|
||||
self.wait_for(lambda: self.signals == [True])
|
||||
token = (self.dir / "steam-sleep").read_text().strip()
|
||||
self.assertTrue(self.preparing())
|
||||
self.state(token, "awake")
|
||||
self.wait_for(lambda: self.signals == [True, False])
|
||||
self.assertFalse(self.preparing())
|
||||
|
||||
def request_wake(self):
|
||||
staged = self.dir / "steam-wake.tmp"
|
||||
staged.write_text("wake\n")
|
||||
staged.replace(self.dir / "steam-wake")
|
||||
|
||||
def test_host_resume_recovers_without_a_sleep_request(self):
|
||||
self.assertFalse(self.preparing())
|
||||
self.request_wake()
|
||||
self.wait_for(lambda: self.signals == [True, False])
|
||||
self.assertFalse((self.dir / "steam-wake").exists())
|
||||
|
||||
def test_host_wake_survives_frozen_service(self):
|
||||
token = self.suspend()
|
||||
self.state(token, "paused")
|
||||
os.kill(self.process.pid, signal.SIGSTOP)
|
||||
self.request_wake()
|
||||
os.kill(self.process.pid, signal.SIGCONT)
|
||||
self.wait_for(lambda: self.signals == [True, False])
|
||||
self.assertFalse(self.preparing())
|
||||
|
||||
def test_failed_pause_recovers_and_duplicate_is_rejected(self):
|
||||
token = self.suspend()
|
||||
with self.assertRaises(GLib.Error):
|
||||
|
||||
@@ -38,10 +38,6 @@ cp "$TEST_CDN/${2##*/}" "$4"
|
||||
sha = self.bin / 'sha256sum'
|
||||
sha.write_text('#!/bin/bash\nexec shasum -a 256 "$@"\n')
|
||||
sha.chmod(0o755)
|
||||
if shutil.which('sha1sum') is None:
|
||||
sha1 = self.bin / 'sha1sum'
|
||||
sha1.write_text('#!/bin/bash\nexec shasum -a 1 "$@"\n')
|
||||
sha1.chmod(0o755)
|
||||
self.env = dict(os.environ, HOME=str(self.home), XDG_DATA_HOME=str(self.data),
|
||||
PATH=str(self.bin) + os.pathsep + os.environ['PATH'],
|
||||
TEST_CDN=str(self.cdn), TEST_REQUESTS=str(self.requests))
|
||||
@@ -108,65 +104,6 @@ cp "$TEST_CDN/${2##*/}" "$4"
|
||||
self.assertEqual(0, self.install('publicbeta').returncode)
|
||||
self.assertEqual('publicbeta\n', (self.steam / 'package/beta').read_text())
|
||||
|
||||
def break_client(self, starts):
|
||||
self.assert_installed('steamdeck_publicbeta')
|
||||
self.requests.unlink()
|
||||
package = self.steam / 'package'
|
||||
(self.steam / 'steamrtarm64/steam').write_text('half updated')
|
||||
(package / 'steam_client_steamdeck_publicbeta_linuxarm64.manifest').write_text('manifest')
|
||||
(package / 'steam_client_steamdeck_publicbeta_linuxarm64.installed').write_text('installed')
|
||||
good = b'complete package'
|
||||
(package / ('bins_linuxarm64.zip.vz.' + hashlib.sha1(good).hexdigest() + '_16')).write_bytes(good)
|
||||
(package / ('bins_misc_linuxarm64.zip.vz.' + hashlib.sha1(b'whole').hexdigest() + '_5')).write_bytes(b'wh')
|
||||
(package / ('strings_all.zip.' + hashlib.sha1(b'strings').hexdigest())).write_bytes(b'strings')
|
||||
(self.steam / '.crash').write_text('')
|
||||
(package / 'droiddeck-unconfirmed').write_text('start\n' * starts)
|
||||
return package
|
||||
|
||||
def test_two_starts_with_nothing_shown_fetch_the_client_again(self):
|
||||
package = self.break_client(2)
|
||||
self.assert_installed('steamdeck_publicbeta')
|
||||
self.assertEqual('repaired\n', (package / 'droiddeck-unconfirmed').read_text())
|
||||
self.assertFalse((self.steam / '.crash').exists())
|
||||
self.assertEqual([], sorted(p.name for p in package.glob('steam_client_*')))
|
||||
self.assertEqual(['bins_linuxarm64.zip.vz.', 'strings_all.zip.'],
|
||||
sorted(p.name[:p.name.rindex('.') + 1] for p in package.glob('*.zip.*')))
|
||||
|
||||
def test_one_start_with_nothing_shown_is_left_alone(self):
|
||||
package = self.break_client(1)
|
||||
self.assertEqual(0, self.install().returncode)
|
||||
self.assertFalse(self.requests.exists())
|
||||
self.assertEqual('half updated', (self.steam / 'steamrtarm64/steam').read_text())
|
||||
self.assertTrue((package / 'steam_client_steamdeck_publicbeta_linuxarm64.installed').exists())
|
||||
|
||||
def test_a_repair_is_not_repeated_until_the_client_has_been_seen(self):
|
||||
package = self.break_client(2)
|
||||
self.assertEqual(0, self.install().returncode)
|
||||
self.requests.unlink()
|
||||
with (package / 'droiddeck-unconfirmed').open('a') as marker:
|
||||
marker.write('start\nstart\nstart\n')
|
||||
self.assertEqual(0, self.install().returncode)
|
||||
self.assertFalse(self.requests.exists())
|
||||
|
||||
def test_requested_repair_runs_once_and_is_retried_until_it_completes(self):
|
||||
package = self.break_client(0)
|
||||
(package / 'droiddeck-unconfirmed').unlink()
|
||||
request = self.home / '.bl-steam-repair'
|
||||
request.write_text('1\n')
|
||||
archive = self.cdn / 'steamdeck_publicbeta.zip'
|
||||
original = archive.read_bytes()
|
||||
archive.write_bytes(b'corrupt download')
|
||||
self.assertNotEqual(0, self.install().returncode)
|
||||
self.assertTrue(request.exists())
|
||||
self.assertFalse((package / 'droiddeck-installed').exists())
|
||||
archive.write_bytes(original)
|
||||
self.requests.unlink()
|
||||
self.assert_installed('steamdeck_publicbeta')
|
||||
self.assertFalse(request.exists())
|
||||
self.requests.unlink()
|
||||
self.assertEqual(0, self.install().returncode)
|
||||
self.assertFalse(self.requests.exists())
|
||||
|
||||
def test_invalid_channel_fails_before_any_download(self):
|
||||
result = self.install('../unknown')
|
||||
self.assertNotEqual(0, result.returncode)
|
||||
|
||||
Reference in new issue
Block a user