Compare commits

..
Author SHA1 Message Date
The412Banner 71a82775c3 chore(xbox): log why owned games are left out of the library 2026-11-22 17:19:41 +00:00
Tushar Gandhe c6b6e7362e fix(ui): game page main action above its box, and tabs that scroll and slide (#2994) 2026-11-22 11:31:46 -05:00
MaxsTechReview cb7edbefd2 fix(input): show the main screen layout editor first, like the second screen (#3019)
The Screen visibility group sat above the Layout group on the Main screen page, so in landscape its description pushed Edit on screen below the fold and the page looked like it had no editor. The Layout group now comes first on both screens.
2026-11-22 10:56:03 -05:00
Kurt Himebauch a9b5994a91 fix(library): drop the card's bottom gradient when it has no text to show (#3017) 2026-11-22 10:52:25 -05:00
MaxsTechReview 42f25c2a6c fix(input): controls edited in portrait keep their places in the panel below the game (#3013)
* fix(input): controls edited in portrait keep their places in the panel below the game

The panel below the game in portrait always regenerated the stock
layout, so positions saved from the Controls editor were dropped and
only the button styling carried over. The panel now orients to the
portrait frame and fits the edited controls into the panel at their
saved proportions; untouched stock layouts keep the generated panel.

* Keep the Deck panel's trackpads and fitted sizes for edited portrait controls
2026-11-22 09:51:32 -05:00
MaxsTechReview 501debc7f6 fix(game-env): Dragon's Dogma 2 starts with its Wine detection off (#3011)
Dragon's Dogma 2 checks for Wine and takes a path that does not start.
Launches of Steam app 2054970 now append the game's own
/WineDetectionEnabled:False switch at launch time. Steam's stored Launch
Options are untouched, and a /WineDetectionEnabled: value the user already
passes keeps priority and is not repeated.
2026-11-22 09:31:40 -05:00
Tushar Gandhe 1f70d43fe2 feat(ui): a Launcher setting turns page swipes off, and edge swipes in landscape leave the page alone (#2924) 2026-11-22 07:26:39 -05:00
Tamim Kabir a8d03d687f fix(input): SDL 3 games no longer crash on the virtual pads' udev devices (#2915) 2026-11-22 02:43:32 -05:00
60 changed files with 672 additions and 308 deletions

No files matched your search

@@ -53,6 +53,13 @@ object AppUiPrefs {
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().putBoolean("hide-home-from-recents", hidden).apply()
}
fun pageSwipe(context: Context): Boolean =
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).getBoolean("page-swipe", true)
fun setPageSwipe(context: Context, on: Boolean) {
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().putBoolean("page-swipe", on).apply()
}
internal fun normalizeScale(percent: Int): Int = percent.takeIf { it in scales } ?: DEFAULT_SCALE
fun scale(context: Context): Int = normalizeScale(
@@ -267,12 +267,11 @@ class DroidDeckHudHost(context: Context) {
val h = if (strip) maxOf(v.height.toFloat(), STRIP_PULL_OFF_DP * density) else v.height.toFloat()
val x = v.x + dx
val y = v.y + dy
val b = HudBounds.of(p, v.width.toFloat(), v.height.toFloat())
return mapOf(
DroidDeckHudDock.LEFT to (b.left - x) / w,
DroidDeckHudDock.RIGHT to (x + v.width - b.right) / w,
DroidDeckHudDock.TOP to (b.top - y) / h,
DroidDeckHudDock.BOTTOM to (y + v.height - b.bottom) / h,
DroidDeckHudDock.LEFT to -x / w,
DroidDeckHudDock.RIGHT to (x + v.width - p.width) / w,
DroidDeckHudDock.TOP to -y / h,
DroidDeckHudDock.BOTTOM to (y + v.height - p.height) / h,
).maxByOrNull { it.value }
}
@@ -280,19 +279,19 @@ class DroidDeckHudHost(context: Context) {
val p = hud.parent as? View ?: return
stopMotion(hud)
snapping = false
val b = HudBounds.of(p, hud.width.toFloat(), hud.height.toFloat())
hud.x = x.coerceIn(b.left, b.maxX)
hud.y = y.coerceIn(b.top, b.maxY)
hud.x = x.coerceIn(0f, (p.width - hud.width).toFloat().coerceAtLeast(0f))
hud.y = y.coerceIn(0f, (p.height - hud.height).toFloat().coerceAtLeast(0f))
}
private fun dropTab(hud: DroidDeckHudView) {
val p = hud.parent as? View ?: return
val b = HudBounds.of(p, hud.width.toFloat(), hud.height.toFloat())
val maxX = (p.width - hud.width).toFloat().coerceAtLeast(0f)
val maxY = (p.height - hud.height).toFloat().coerceAtLeast(0f)
val pulled = when (hud.dock) {
DroidDeckHudDock.LEFT -> (hud.x - b.left) / hud.width
DroidDeckHudDock.RIGHT -> (b.maxX - hud.x) / hud.width
DroidDeckHudDock.TOP -> (hud.y - b.top) / hud.height
DroidDeckHudDock.BOTTOM -> (b.maxY - hud.y) / hud.height
DroidDeckHudDock.LEFT -> hud.x / hud.width
DroidDeckHudDock.RIGHT -> (maxX - hud.x) / hud.width
DroidDeckHudDock.TOP -> hud.y / hud.height
DroidDeckHudDock.BOTTOM -> (maxY - hud.y) / hud.height
DroidDeckHudDock.NONE, DroidDeckHudDock.FLOAT -> 0f
}
if (pulled >= 1f) { setDock(hud, DroidDeckHudDock.NONE); return }
@@ -340,11 +339,12 @@ class DroidDeckHudHost(context: Context) {
/** Sends the HUD to a side the way a chat head goes: by where the throw would carry it, springing on from its speed. */
private fun snapToAnchor(hud: DroidDeckHudView, vx: Float, vy: Float) {
val p = hud.parent as? View ?: return
val b = HudBounds.of(p, hud.width.toFloat(), hud.height.toFloat())
val right = com.droiddeck.launcher.ui.EdgeFling.toRight(hud.x - b.left + hud.width / 2f, b.right - b.left, vx, context.resources.displayMetrics.density)
val maxX = (p.width - hud.width).toFloat().coerceAtLeast(0f)
val maxY = (p.height - hud.height).toFloat().coerceAtLeast(0f)
val right = com.droiddeck.launcher.ui.EdgeFling.toRight(hud.x + hud.width / 2f, p.width.toFloat(), vx, context.resources.displayMetrics.density)
anchorX = if (right) 1f else 0f
wantX = b.anchoredX(anchorX)
wantY = com.droiddeck.launcher.ui.EdgeFling.restY(hud.y, vy, b.top, b.maxY)
wantX = anchorX * maxX
wantY = com.droiddeck.launcher.ui.EdgeFling.restY(hud.y, vy, 0f, maxY)
SessionPrefs.setDroidDeckHudPosition(context, wantX, wantY)
stopMotion(hud)
hud.scaleX = 1f; hud.scaleY = 1f
@@ -387,8 +387,7 @@ class DroidDeckHudHost(context: Context) {
val at = IntArray(2).also { p.getLocationOnScreen(it) }
val x = rawX - at[0]
val y = rawY - at[1]
val b = HudBounds.of(p, 0f, 0f)
val edge = if (snaps) nearestEdge(x - b.left, y - b.top, b.right - b.left, b.bottom - b.top) else DroidDeckHudDock.FLOAT
val edge = if (snaps) nearestEdge(x, y, p.width.toFloat(), p.height.toFloat()) else DroidDeckHudDock.FLOAT
setDock(hud, edge, Pair(x, y))
}
@@ -405,9 +404,8 @@ class DroidDeckHudHost(context: Context) {
if (edge != DroidDeckHudDock.NONE) {
val p = hud.parent as? View
if (p != null) {
val b = HudBounds.of(p, 0f, 0f)
wantX = wantX.coerceIn(b.left, b.right)
wantY = wantY.coerceIn(b.top, b.bottom)
wantX = wantX.coerceIn(0f, p.width.toFloat())
wantY = wantY.coerceIn(0f, p.height.toFloat())
}
SessionPrefs.setDroidDeckHudPosition(context, wantX, wantY)
}
@@ -419,11 +417,12 @@ class DroidDeckHudHost(context: Context) {
}
private fun settleOutOfTab(hud: DroidDeckHudView, tabX: Float, tabY: Float) {
val b = (hud.parent as? View)?.let { HudBounds.of(it, hud.contentWidth, hud.contentHeight) }
wantX = if (b == null) tabX.coerceAtLeast(0f) else tabX.coerceIn(b.left, b.maxX)
wantY = if (b == null) tabY.coerceAtLeast(0f) else tabY.coerceIn(b.top, b.maxY)
anchorX = if (snaps && !hud.isStrip && b != null) b.anchorFor(wantX) else Float.NaN
if (b != null && !anchorX.isNaN()) wantX = b.anchoredX(anchorX)
val p = hud.parent as? View
val maxX = if (p == null) Float.MAX_VALUE else (p.width - hud.contentWidth).coerceAtLeast(0f)
val maxY = if (p == null) Float.MAX_VALUE else (p.height - hud.contentHeight).coerceAtLeast(0f)
wantX = tabX.coerceIn(0f, maxX); wantY = tabY.coerceIn(0f, maxY)
anchorX = if (snaps && !hud.isStrip && p != null) (if (wantX < maxX / 2f) 0f else 1f) else Float.NaN
if (!anchorX.isNaN()) wantX = anchorX * maxX
SessionPrefs.setDroidDeckHudPosition(context, wantX, wantY)
}
@@ -494,13 +493,13 @@ class DroidDeckHudHost(context: Context) {
if (scale > 0.999f) from else (to - from * scale) / (1f - scale)
private fun settled(p: View, dock: DroidDeckHudDock, w: Float, h: Float): Pair<Float, Float> {
val b = HudBounds.of(p, w, h)
var x = wantX.coerceIn(b.left, b.maxX); var y = wantY.coerceIn(b.top, b.maxY)
val maxX = (p.width - w).coerceAtLeast(0f); val maxY = (p.height - h).coerceAtLeast(0f)
var x = wantX.coerceIn(0f, maxX); var y = wantY.coerceIn(0f, maxY)
when (dock) {
DroidDeckHudDock.LEFT -> x = b.left
DroidDeckHudDock.RIGHT -> x = b.maxX
DroidDeckHudDock.TOP -> y = b.top
DroidDeckHudDock.BOTTOM -> y = b.maxY
DroidDeckHudDock.LEFT -> x = 0f
DroidDeckHudDock.RIGHT -> x = maxX
DroidDeckHudDock.TOP -> y = 0f
DroidDeckHudDock.BOTTOM -> y = maxY
DroidDeckHudDock.NONE, DroidDeckHudDock.FLOAT -> {}
}
return Pair(x, y)
@@ -511,18 +510,21 @@ class DroidDeckHudHost(context: Context) {
val p = v.parent as? View ?: return
if (p.width <= 0 || p.height <= 0 || v.width <= 0 || v.height <= 0) return
if (wantX.isNaN()) { wantX = v.x; wantY = v.y }
val b = HudBounds.of(p, v.width.toFloat(), v.height.toFloat())
val maxX = (p.width - v.width).toFloat().coerceAtLeast(0f)
val maxY = (p.height - v.height).toFloat().coerceAtLeast(0f)
val anchored = (v as? DroidDeckHudView)?.let { it.dock == DroidDeckHudDock.NONE && !it.isStrip } == true
if (snaps && anchored && anchorX.isNaN()) anchorX = b.anchorFor(wantX)
if (snaps && anchored && !anchorX.isNaN()) wantX = b.anchoredX(anchorX)
var x = wantX.coerceIn(b.left, b.maxX)
var y = wantY.coerceIn(b.top, b.maxY)
if ((v as? DroidDeckHudView)?.isStrip == true) y = if (y + v.height / 2f < (b.top + b.bottom) / 2f) b.top else b.maxY
if (snaps && anchored && anchorX.isNaN()) {
anchorX = if (wantX.coerceIn(0f, maxX) < maxX / 2f) 0f else 1f
}
if (snaps && anchored && !anchorX.isNaN()) wantX = anchorX * maxX
var x = wantX.coerceIn(0f, maxX)
var y = wantY.coerceIn(0f, maxY)
if ((v as? DroidDeckHudView)?.isStrip == true) y = if (y + v.height / 2f < p.height / 2f) 0f else maxY
when (v.let { it as? DroidDeckHudView }?.dock) {
DroidDeckHudDock.LEFT -> x = b.left
DroidDeckHudDock.RIGHT -> x = b.maxX
DroidDeckHudDock.TOP -> y = b.top
DroidDeckHudDock.BOTTOM -> y = b.maxY
DroidDeckHudDock.LEFT -> x = 0f
DroidDeckHudDock.RIGHT -> x = maxX
DroidDeckHudDock.TOP -> y = 0f
DroidDeckHudDock.BOTTOM -> y = maxY
else -> {}
}
if (v.x != x) v.x = x
@@ -549,25 +551,3 @@ class DroidDeckHudHost(context: Context) {
}.getOrNull()?.takeIf { it.isNotBlank() }
}
}
internal class HudBounds(val left: Float, val top: Float, val right: Float, val bottom: Float, w: Float, h: Float) {
val maxX = (right - w).coerceAtLeast(left)
val maxY = (bottom - h).coerceAtLeast(top)
fun anchorFor(x: Float): Float = if (x.coerceIn(left, maxX) - left < (maxX - left) / 2f) 0f else 1f
fun anchoredX(anchor: Float): Float = left + anchor * (maxX - left)
companion object {
fun of(p: View, w: Float, h: Float): HudBounds {
val left = p.paddingLeft.toFloat()
val top = p.paddingTop.toFloat()
return HudBounds(
left, top,
(p.width - p.paddingRight).toFloat().coerceAtLeast(left),
(p.height - p.paddingBottom).toFloat().coerceAtLeast(top),
w, h,
)
}
}
}
@@ -934,7 +934,7 @@ class DroidDeckHudView(context: Context) : View(context) {
val rowPx = sp(11.5f); val unitPx = rowPx * 0.8f; val fpsPx = sp(15f)
val padX = sp(10f); val groupGap = sp(13f)
val h = sp(26f)
val w = ((parent as? View)?.let { it.width - it.paddingLeft - it.paddingRight }?.takeIf { it > 0 } ?: resources.displayMetrics.widthPixels).toFloat()
val w = ((parent as? View)?.width?.takeIf { it > 0 } ?: resources.displayMetrics.widthPixels).toFloat()
val mid = h / 2f
val baseline = mid + capHeight(fpsPx) / 2f
@@ -31,17 +31,20 @@ object OnScreenLayout {
private const val TOLERANCE = .01f
private const val KEYBOARD_ID = "builtin:keyboard"
private val REAR = setOf(InputControl.L4, InputControl.L5, InputControl.R4, InputControl.R5)
private val BAR = setOf(InputControl.GUIDE, InputControl.QAM)
fun elements(context: Context, saved: SavedInputLayout?, width: Int, height: Int, safe: Rect,
buttonsOnly: Boolean = false, dock: Dock? = null, rearButtons: Boolean? = null,
trackpads: Boolean? = null): List<InputSurfaceElement> {
if (saved == null) return emptyList()
if (width <= 0 || height <= 0) return saved.elements
val layout = oriented(saved, width, height)
val layout = oriented(saved, dock?.portrait ?: (height > width))
val stored = layout.elements
val generator = LegacyGamepadLayout(context, width, height, safe, layout.scale)
val (reference, matched) = reference(context, layout, width, height)
if (buttonsOnly && dock == null) return generator.buttonsOnly(stored) + fit(stored.filter { it.alwaysShown }, reference.first, reference.second, width, height, safe)
if (dock?.portrait == true && !dock.grips && !matched && layout.aspect > 0f && layout.aspect < 1f && stored.any(::isGamepad))
return cluster(stored.filterNot { it.alwaysShown || isGamepad(it) && (it.id == KEYBOARD_ID || it.control in BAR) }, layout.aspect, width, height, safe)
val generated = matched || PadKit.forOverlay(context, layout) != null && stored.any(::isGamepad) &&
(dock != null || height > width && layout.aspect >= 1f || height <= width && layout.aspect > 0f && layout.aspect < 1f)
val gamepad = if (generated) stored.filter(::isGamepad) else emptyList()
@@ -70,8 +73,9 @@ object OnScreenLayout {
.place(ordered, lowerShortcuts = generated, rearButtons = rearButtons, trackpads = trackpads)
}
fun oriented(layout: SavedInputLayout, width: Int, height: Int): SavedInputLayout {
val portrait = height > width
fun oriented(layout: SavedInputLayout, width: Int, height: Int): SavedInputLayout = oriented(layout, height > width)
private fun oriented(layout: SavedInputLayout, portrait: Boolean): SavedInputLayout {
if (layout.rotated.isEmpty() || layout.aspect <= 0f || (layout.aspect < 1f) == portrait || (layout.rotatedAspect < 1f) != portrait) return layout
val rotated = layout.rotated.associateBy { it.id }
return layout.copy(elements = layout.elements.map { e -> rotated[e.id]?.let { e.copy(x = it.x, y = it.y, width = it.width, height = it.height) } ?: e } +
@@ -131,6 +135,23 @@ object OnScreenLayout {
}
}
private fun cluster(elements: List<InputSurfaceElement>, aspect: Float, width: Int, height: Int, safe: Rect): List<InputSurfaceElement> {
if (elements.isEmpty()) return elements
val left = elements.minOf { it.x } * aspect
val top = elements.minOf { it.y }
val spanX = (elements.maxOf { it.x + it.width } * aspect - left).coerceAtLeast(.0001f)
val spanY = (elements.maxOf { it.y + it.height } - top).coerceAtLeast(.0001f)
val w = (width - safe.left - safe.right).toFloat().coerceAtLeast(1f)
val h = (height - safe.top - safe.bottom).toFloat().coerceAtLeast(1f)
val scale = minOf(w / aspect, w / spanX, h / spanY)
val originX = safe.left + (w - spanX * scale) / 2f - left * scale
val originY = safe.top + (h - spanY * scale) / 2f - top * scale
return elements.map { e ->
e.copy(x = (originX + e.x * aspect * scale) / width, y = (originY + e.y * scale) / height,
width = e.width * aspect * scale / width, height = e.height * scale / height)
}
}
private fun anchor(start: Float, size: Float, reference: Float, actual: Float, scale: Float): Float {
val centre = start + size / 2f
val scaled = size * reference * scale
@@ -61,11 +61,14 @@ object XboxBackend : StoreBackend {
val products = XboxCatalog.rawProducts(licenses.keys.toList(), market)
val cloud = runCatching { XboxCatalog.cloudCatalog(market) }
.onFailure { StoresState.logLine("Xbox: cloud lists unavailable (${it.javaClass.simpleName})") }.getOrNull()
val games = mergeEditions(products.mapNotNull { XboxCatalog.product(it, licenses, cloud) }).sortedBy { it.title.lowercase() }
val drops = java.util.TreeMap<String, Int>()
val listed = products.mapNotNull { XboxCatalog.product(it, licenses, cloud) { reason -> drops[reason] = (drops[reason] ?: 0) + 1 } }
val games = mergeEditions(listed).sortedBy { it.title.lowercase() }
StoresState.logLine("Xbox: library catalog requested=${licenses.size} returned=${products.size} supported=${games.size} " +
"filtered=${products.size - games.size} backend-skipped=${response.optInt("skippedEntitlements")} " +
"pc=${games.count { it.xboxPc }} cloud=${games.count { it.xboxCloud }} cloud-only=${games.count { !it.xboxPc }} " +
"cloud-lists=${cloud?.gamePass?.size ?: -1}/${cloud?.all?.size ?: -1}")
"cloud-lists=${cloud?.gamePass?.size ?: -1}/${cloud?.all?.size ?: -1} folded=${listed.size - games.size}" +
drops.entries.joinToString("") { " ${it.key}=${it.value}" })
synchronized(this) {
if (current != generation || StoreAccounts.signedInAs(app, store) != account) return@Thread
access = licenses
@@ -73,8 +73,11 @@ internal object XboxCatalog {
}
val result = rows.keys.mapNotNull { id -> kind(id)?.let { id to it } }.toMap()
val missingPlan = rows.values.count { row -> row.optString("satisfiedByProductId").let { it in plans && !activePlan(it) } }
val unlistedParent = rows.values.count { row -> active(row) &&
row.optString("satisfiedByProductId").let { productId.matches(it) && it !in rows && it !in plans && it !in blocked } }
report("library entitlements=${array.length()} invalid=${array.length() - rows.size} restricted=${rows.values.count { !active(it) }} " +
"unverified-plan=$missingPlan owned=${result.values.count { it == "owned" }} gamepass=${result.values.count { it == "gamepass" }}")
"unverified-plan=$missingPlan owned=${result.values.count { it == "owned" }} gamepass=${result.values.count { it == "gamepass" }} " +
"plan-rows=${rows.keys.count { it in plans }} unlisted-parent=$unlistedParent")
return result
}
@@ -105,22 +108,28 @@ internal object XboxCatalog {
return products(objects(body.optJSONArray("productsList")).map { it.optString("productId") }.take(24), access)
}
internal fun product(json: JSONObject, access: Map<String, String>, cloud: XboxCloudCatalog? = null): CatalogItem? {
internal fun product(json: JSONObject, access: Map<String, String>, cloud: XboxCloudCatalog? = null,
dropped: (String) -> Unit = {}): CatalogItem? {
val id = json.optString("ProductId").uppercase()
if (!productId.matches(id) || json.optString("ProductType") != "Game") return null
val localized = objects(json.optJSONArray("LocalizedProperties")).firstOrNull() ?: return null
val title = localized.optString("ProductTitle").takeIf { it.isNotBlank() } ?: return null
val packages = objects(json.optJSONArray("DisplaySkuAvailabilities"))
if (!productId.matches(id) || json.optString("ProductType") != "Game") return null.also { dropped("not-game") }
val localized = objects(json.optJSONArray("LocalizedProperties")).firstOrNull() ?: return null.also { dropped("no-title") }
val title = localized.optString("ProductTitle").takeIf { it.isNotBlank() } ?: return null.also { dropped("no-title") }
val skus = objects(json.optJSONArray("DisplaySkuAvailabilities"))
.mapNotNull { it.optJSONObject("Sku")?.optJSONObject("Properties") }
.filter { it.opt("IsTrial") != true && it.opt("IsPreOrder") != true }
.flatMap { objects(it.optJSONArray("Packages")) }
val packages = skus.flatMap { objects(it.optJSONArray("Packages")) }
val pc = packages.filter { pkg -> objects(pkg.optJSONArray("PlatformDependencies")).any { it.optString("PlatformName") == "Windows.Desktop" } }
val installable = pc.any { installableFormat(it.optString("PackageFormat")) }
// The installer needs the format, not just the fact that one exists: a
// legacy container takes a different subcommand from a streamed package.
val format = pc.firstOrNull { installableFormat(it.optString("PackageFormat")) }?.optString("PackageFormat").orEmpty()
val streams = cloud?.streams(id, access[id].orEmpty()) == true
if (!installable && !streams) return null
if (!installable && !streams) return null.also { dropped(when {
pc.isNotEmpty() -> "pc-format"
packages.isNotEmpty() -> "console-only"
skus.any { it.opt("IsBundle") == true } -> "bundle"
else -> "no-package"
}) }
val images = objects(localized.optJSONArray("Images"))
fun image(vararg kinds: String): String? = kinds.firstNotNullOfOrNull { purpose ->
images.firstOrNull { it.optString("ImagePurpose") == purpose }?.optString("Uri")?.let { raw ->
@@ -360,7 +360,7 @@ internal fun AppDialog(
.then(if (scrollable) Modifier.verticalScroll(scrollState) else Modifier)
.padding(horizontal = 18.dp, vertical = 16.dp),
) {
content()
androidx.compose.runtime.CompositionLocalProvider(LocalRevealChecked provides true) { content() }
if (side != null && !beside) side()
}
}
@@ -762,6 +762,8 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
onRailSelect(key)
}, a)
CompositionLocalProvider(LocalShowSection provides { key -> selected = key }) {
val swipeContext = androidx.compose.ui.platform.LocalContext.current
remember { com.droiddeck.launcher.core.AppUiPrefs.pageSwipe(swipeContext).also { PageSwipe.on = it } }
val agentKeyboardOpen = openTab == "agent" && WindowInsets.ime.getBottom(androidx.compose.ui.platform.LocalDensity.current) > 0
LauncherLayout(
bottomNavigation && !s.dualScreen, pal.line,
@@ -787,7 +789,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
) {
Pane(
s, selected, a, page,
Modifier.fillMaxSize().then(paneFocus).pageSwipe({ !processSettingsPageVisible && appToChooseDisplay == null }) { dir ->
Modifier.fillMaxSize().then(paneFocus).pageSwipe({ !processSettingsPageVisible && appToChooseDisplay == null }, edgeGuard = { !bottomNavigation }) { dir ->
val keys = navigationKeys(s)
val at = keys.indexOf(railSelectionNow.value)
if (at >= 0) keys.getOrNull(at + dir)?.let { key ->
@@ -516,6 +516,13 @@ internal fun SetupPanel(
if (s.launcherFullscreen) stringResource(R.string.setup_fullscreen_on) else stringResource(R.string.setup_fullscreen_off),
s.launcherFullscreen,
) { a.onLauncherFullscreen(it) }
ToggleRow(
host, "page-swipe", stringResource(R.string.setup_page_swipe),
stringResource(R.string.setup_page_swipe_hint), PageSwipe.on,
) { on ->
PageSwipe.on = on
com.droiddeck.launcher.core.AppUiPrefs.setPageSwipe(ctx, on)
}
ToggleRow(
host, "controller-haptics", stringResource(R.string.setup_controller_haptics),
stringResource(R.string.setup_controller_haptics_hint),
@@ -211,6 +211,7 @@ internal fun PrimaryButton(
val pal = LocalPalette.current
val pillMode = LocalPillButtons.current
val btnShape = if (pillMode) CircleShape else Shape12
val outlined = LocalGradientOutline.current && enabled
val frontFocus = if (main) LocalFrontFocus.current else null
if (frontFocus != null) DisposableEffect(Unit) {
frontFocus.primaryAttached++
@@ -234,6 +235,7 @@ internal fun PrimaryButton(
.clip(btnShape)
.background(if (enabled) Brush.linearGradient(listOf(colors.primary, pal.primary2)) else Brush.linearGradient(listOf(colors.surfaceVariant, colors.surfaceVariant)))
.then(if (enabled) Modifier else Modifier.border(1.dp, pal.line2, btnShape))
.then(if (outlined) Modifier.border(2.dp, Brush.linearGradient(listOf(pal.primary2, colors.primary)), btnShape) else Modifier)
.glideBorder(hot, btnShape, pal.signal, hotFillAlpha = 0f)
.hoverable(src).clickable(role = Role.Button, interactionSource = src, indication = null, enabled = enabled) {
placed[0]?.takeIf { it.isAttached }?.let { LaunchOrigin.mark(it.boundsInRoot(), placed) }
@@ -75,6 +75,7 @@ import androidx.compose.ui.input.key.onPreviewKeyEvent
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.boundsInRoot
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.positionInParent
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.platform.LocalDensity
@@ -131,6 +132,9 @@ import kotlinx.coroutines.withContext
import java.io.File
import androidx.compose.runtime.setValue
import androidx.compose.runtime.getValue
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.layout.offset
internal class GameRef(val appId: Int?, val store: Store?, val storeId: String?) {
fun game(games: List<Library.SteamGame>): Library.SteamGame? = when {
@@ -254,12 +258,18 @@ internal fun GameDetail(
color = MaterialTheme.colorScheme.error, maxLines = 3, overflow = TextOverflow.Ellipsis,
)
Spacer(Modifier.height(2.dp))
GameCapsule(scores) { GameActions(store, id, game, item, installed, s, a, Modifier.focusRequester(lead), compactMenu = stacked, inStore = inStore) }
Column {
CompositionLocalProvider(LocalPillButtons provides true, LocalGradientOutline provides true) {
GameActions(store, id, game, item, installed, s, a, Modifier.focusRequester(lead), compactMenu = stacked, inStore = inStore, part = ActionPart.LEAD)
}
Spacer(Modifier.height(LeadGap - ActionGap))
GameCapsule(scores) { GameActions(store, id, game, item, installed, s, a, Modifier, compactMenu = stacked, inStore = inStore, part = ActionPart.REST) }
}
}
}
if (StoresMotion.heroLands) header() else Rise(1) { header() }
if (tab != null) Rise(2) {
Column(Modifier.fillMaxWidth().padding(top = 14.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) {
Column(Modifier.fillMaxWidth().padding(top = ActionGap), verticalArrangement = Arrangement.spacedBy(ActionGap)) {
val labels = tabs.map { t ->
when (t) {
GameTab.ABOUT -> stringResource(R.string.game_tab_about)
@@ -277,15 +287,17 @@ internal fun GameDetail(
focusRequesters = tabs.map { tabFocus.getValue(it) }, bumpers = tabs.size > 1, compact = stacked,
)
Box(Modifier.fillMaxWidth().onFocusChanged { if (inPanel && !it.hasFocus) dropped++; inPanel = it.hasFocus }.testTag("game-tab-${tab.name.lowercase()}")) {
when (tab) {
GameTab.ABOUT -> AboutTab(developer, publisher, releaseDate, description, scores, stacked) {
if (!s.shortcutPicker) GameResourcesRow(title.takeUnless { it == id }.orEmpty(), game)
CompositionLocalProvider(LocalRevealChecked provides false) {
when (tab) {
GameTab.ABOUT -> AboutTab(developer, publisher, releaseDate, description, scores, stacked) {
if (!s.shortcutPicker) GameResourcesRow(title.takeUnless { it == id }.orEmpty(), game)
}
GameTab.ACHIEVEMENTS -> achievementState?.let { st -> AchievementsTab(StoreAchievements.forSource(store?.id)?.label.orEmpty(), st) }
GameTab.LAUNCH -> if (game != null) LaunchTab(game, s, a, hopRail)
GameTab.SAVES -> if (game != null && prefix != null) SavesTab(game, prefix, a)
GameTab.ADDONS -> if (game != null) AddonsTab(game, addonTargets, a)
GameTab.INSTALL -> InstallTab(game, installed, item, store)
}
GameTab.ACHIEVEMENTS -> achievementState?.let { st -> AchievementsTab(StoreAchievements.forSource(store?.id)?.label.orEmpty(), st) }
GameTab.LAUNCH -> if (game != null) LaunchTab(game, s, a, hopRail)
GameTab.SAVES -> if (game != null && prefix != null) SavesTab(game, prefix, a)
GameTab.ADDONS -> if (game != null) AddonsTab(game, addonTargets, a)
GameTab.INSTALL -> InstallTab(game, installed, item, store)
}
}
}
@@ -348,14 +360,22 @@ private fun StatusChip(text: String, icon: androidx.compose.ui.graphics.vector.I
}
}
private val ActionGap = 12.dp
private val LeadGap = 20.dp
@Composable
private fun GameCapsule(scores: GameScores?, actions: @Composable () -> Unit) {
var noActions by remember { mutableStateOf(false) }
val shown = scores?.takeIf { it.metacritic != Lookup.None || it.hltb != Lookup.None }
val empty = noActions && shown == null
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.fillMaxWidth().glass(RoundedCornerShape(30.dp)).padding(6.dp),
modifier = Modifier.fillMaxWidth().then(if (empty) Modifier else Modifier.padding(top = ActionGap).glass(RoundedCornerShape(30.dp)).padding(6.dp)),
) {
CompositionLocalProvider(LocalPillButtons provides true) { Box(Modifier.weight(1f)) { actions() } }
if (scores != null) CapsuleScores(scores, Modifier.padding(start = 8.dp, end = 10.dp))
CompositionLocalProvider(LocalPillButtons provides true) {
Box(Modifier.weight(1f).onSizeChanged { noActions = it.height == 0 }) { actions() }
}
shown?.let { CapsuleScores(it, Modifier.padding(start = 8.dp, end = 10.dp)) }
}
}
@@ -367,41 +387,95 @@ private fun GameTabBar(
) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val scroll = rememberScrollState()
val spans = remember(tabs.size) { androidx.compose.runtime.mutableStateListOf<IntRange?>(*arrayOfNulls<IntRange>(tabs.size)) }
var tabHeight by remember { mutableStateOf(0) }
var viewport by remember { mutableStateOf(0) }
LaunchedEffect(selected, viewport) {
val span = spans.getOrNull(selected) ?: return@LaunchedEffect
if (viewport > 0) scroll.animateScrollTo((span.first + span.last) / 2 - viewport / 2)
}
Row(modifier.fillMaxWidth().glass(CircleShape).padding(4.dp), verticalAlignment = Alignment.CenterVertically) {
if (bumpers) TabBarBumper("LB", stringResource(R.string.widgets_prev_tab), leading = true) { onSelect((selected + tabs.size - 1) % tabs.size) }
tabs.forEachIndexed { i, label ->
val on = i == selected
val src = remember { MutableInteractionSource() }
val hot = rememberHot(src)
val pick = { onSelect(i) }
Box(
contentAlignment = Alignment.Center,
modifier = Modifier.weight(1f)
.testTag("tab-$i")
.then(focusRequesters?.getOrNull(i)?.let { Modifier.focusRequester(it) } ?: Modifier)
.clip(CircleShape)
.background(if (on) pal.signal.copy(alpha = 0.3f) else if (hot) pal.signal.copy(alpha = 0.14f) else Color.Transparent)
.glideBorder(hot, CircleShape, pal.signal, if (on) pal.signal.copy(alpha = 0.5f) else Color.Transparent)
.hoverable(src).selectable(selected = on, interactionSource = src, indication = null, role = Role.Tab, onClick = pick)
.controllerConfirm(onClick = pick)
.padding(horizontal = 6.dp, vertical = if (compact) 8.dp else 10.dp),
) {
Text(
label, fontSize = if (compact) 13.sp else 14.sp, fontWeight = if (on) FontWeight.Bold else FontWeight.SemiBold, maxLines = 1, overflow = TextOverflow.Ellipsis,
color = if (on || hot) colors.onBackground else colors.onSurfaceVariant,
)
androidx.compose.foundation.layout.BoxWithConstraints(Modifier.weight(1f).clip(if (bumpers) RoundedCornerShape(BumperFlat) else CircleShape).onSizeChanged { viewport = it.width }) {
val share = maxWidth / tabs.size.coerceAtLeast(1)
Box(Modifier.horizontalScroll(scroll)) {
spans.getOrNull(selected)?.takeIf { tabHeight > 0 }?.let { span ->
TabHighlight(span, tabHeight, flatStart = bumpers && selected == 0, flatEnd = bumpers && selected == tabs.lastIndex)
}
Row(verticalAlignment = Alignment.CenterVertically) {
tabs.forEachIndexed { i, label ->
val on = i == selected
val src = remember { MutableInteractionSource() }
val hot = rememberHot(src)
val pick = { onSelect(i) }
val shape = tabShape(flatStart = bumpers && i == 0, flatEnd = bumpers && i == tabs.lastIndex)
Box(
contentAlignment = Alignment.Center,
modifier = Modifier.widthIn(min = share)
.onGloballyPositioned { c -> val x = c.positionInParent().x.toInt(); val r = x..(x + c.size.width); if (spans[i] != r) spans[i] = r; tabHeight = c.size.height }
.testTag("tab-$i")
.then(focusRequesters?.getOrNull(i)?.let { Modifier.focusRequester(it) } ?: Modifier)
.clip(shape)
.background(if (hot && !on) pal.signal.copy(alpha = 0.14f) else Color.Transparent)
.glideBorder(hot, shape, pal.signal)
.hoverable(src).selectable(selected = on, interactionSource = src, indication = null, role = Role.Tab, onClick = pick)
.controllerConfirm(onClick = pick)
.padding(horizontal = 12.dp, vertical = if (compact) 8.dp else 10.dp),
) {
Text(
label, fontSize = if (compact) 13.sp else 14.sp, fontWeight = if (on) FontWeight.Bold else FontWeight.SemiBold, maxLines = 1, overflow = TextOverflow.Ellipsis,
color = if (on || hot) colors.onBackground else colors.onSurfaceVariant,
)
}
}
}
}
}
if (bumpers) TabBarBumper("RB", stringResource(R.string.widgets_next_tab), leading = false) { onSelect((selected + 1) % tabs.size) }
}
}
private val BumperFlat = 7.dp
@Composable
private fun TabHighlight(span: IntRange, height: Int, flatStart: Boolean, flatEnd: Boolean) {
val pal = LocalPalette.current
val density = LocalDensity.current
val spring = Motion.sp<Float>(0.8f, Spring.StiffnessMediumLow)
val x by animateFloatAsState(span.first.toFloat(), spring, label = "tabX")
val width by animateFloatAsState((span.last - span.first).toFloat(), spring, label = "tabWidth")
val start by animateFloatAsState(if (flatStart) 1f else 0f, spring, label = "tabFlatStart")
val end by animateFloatAsState(if (flatEnd) 1f else 0f, spring, label = "tabFlatEnd")
with(density) {
val round = (height / 2f).toDp()
val shape = RoundedCornerShape(
topStart = androidx.compose.ui.unit.lerp(round, BumperFlat, start), topEnd = androidx.compose.ui.unit.lerp(round, BumperFlat, end),
bottomEnd = androidx.compose.ui.unit.lerp(round, BumperFlat, end), bottomStart = androidx.compose.ui.unit.lerp(round, BumperFlat, start),
)
Box(
Modifier.offset { androidx.compose.ui.unit.IntOffset(x.toInt(), 0) }
.size(width.toDp(), height.toDp())
.clip(shape).background(pal.signal.copy(alpha = 0.3f)).border(1.dp, pal.signal.copy(alpha = 0.5f), shape),
)
}
}
private fun tabShape(flatStart: Boolean, flatEnd: Boolean): androidx.compose.ui.graphics.Shape {
if (!flatStart && !flatEnd) return CircleShape
val flat = androidx.compose.foundation.shape.CornerSize(BumperFlat)
val round = androidx.compose.foundation.shape.CornerSize(50)
val start = if (flatStart) flat else round
val end = if (flatEnd) flat else round
return RoundedCornerShape(topStart = start, topEnd = end, bottomEnd = end, bottomStart = start)
}
@Composable
private fun TabBarBumper(label: String, description: String, leading: Boolean, onClick: () -> Unit) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val round = 22.dp
val flat = 7.dp
val flat = BumperFlat
val cap = if (leading) RoundedCornerShape(round, flat, flat, round) else RoundedCornerShape(flat, round, round, flat)
Box(
contentAlignment = Alignment.Center,
@@ -433,12 +507,17 @@ private fun GameTitle(title: String, logo: Any?, titleSize: TextUnit) {
)
}
internal enum class ActionPart { ALL, LEAD, REST }
@Composable
internal fun GameActions(
store: Store?, id: String?, game: Library.SteamGame?, item: CatalogItem?, installed: InstalledStoreGame?,
s: FrontEndState, a: FrontEndActions, leadOn: Modifier, compactMenu: Boolean = false, inStore: Boolean = false,
part: ActionPart = ActionPart.ALL,
) {
val ctx = LocalContext.current
val lead = part != ActionPart.REST
val rest = part != ActionPart.LEAD
val storeKey = if (store != null && id != null) "${store.id}:$id" else null
val rawDownload = storeKey?.let { StoresState.download(it) }
val download = rawDownload?.takeIf { it.isActive }
@@ -448,127 +527,133 @@ internal fun GameActions(
Actions {
when {
s.shortcutPicker && game != null -> {
PrimaryButton(stringResource(R.string.game_shortcut_choose), enabled = !s.busy, main = true, icon = Icons.Filled.PlayArrow, modifier = leadOn) { a.onSteamGame(game) }
FileButtons(game, a)
if (lead) PrimaryButton(stringResource(R.string.game_shortcut_choose), enabled = !s.busy, main = true, icon = Icons.Filled.PlayArrow, modifier = leadOn) { a.onSteamGame(game) }
if (rest) FileButtons(game, a)
}
!cloud && (game != null || installed != null) -> {
val gone = storeKey?.let { StoresState.uninstalling[it] }
val xboxBusy = store == Store.XBOX && id != null && XboxContent.busy(id)
val preparing = (game?.launchKey ?: storeKey)?.let { it in s.preparingGames } == true
PrimaryButton(
if (lead) PrimaryButton(
stringResource(if (preparing) R.string.store_starting else R.string.stores_play),
enabled = !s.busy && !preparing && gone == null && download == null && !xboxBusy && (store != Store.GOG || installed?.sidecar?.isInstalled != false),
main = true, icon = Icons.Filled.PlayArrow, modifier = leadOn,
) {
if (game != null) a.onSteamGame(game) else if (store != null && id != null) launchStoreGame(store, id, s, a)
}
if (game != null) {
if (compactMenu) GameMoreMenu(game, a) else {
FileButtons(game, a)
GameShortcutMenu(game, a)
}
}
if (store == Store.ITCH && installed != null) ItchUpdateButton(installed, download == null && StoresState.uninstalling[installed.key] == null)
if (store == Store.GAMEJOLT && installed != null) GameJoltUpdateButton(installed, download == null && StoresState.uninstalling[installed.key] == null)
if (store == Store.GAMEJOLT && installed != null) GameJoltVersionButton(installed, download == null && StoresState.uninstalling[installed.key] == null)
if (inStore && store == Store.GAMEJOLT && installed != null) {
SecondaryButton(stringResource(R.string.stores_view_on, Store.GAMEJOLT.shortLabel)) {
openUrl(ctx, item?.storeUrl.orEmpty().ifBlank { GameJoltApi.pageUrl("game", installed.sidecar.id) })
}
}
if (store == Store.EA && installed != null) EaUpdateButton(installed, download == null && StoresState.uninstalling[installed.key] == null)
if (store == Store.GOG && installed != null) GogMaintenanceActions(installed)
if (store == Store.XBOX && id != null) XboxInstalledStream(id, game?.name ?: item?.title.orEmpty(), item)
if (store == Store.XBOX && installed != null && id != null) {
SecondaryButton(stringResource(R.string.stores_xbox_update), enabled = download == null && !XboxRuntime.isActive(id)) {
runCatching { XboxBackend.update(ctx, installed) }
.onFailure { StoresState.problems[Store.XBOX] = it.message ?: ctx.getString(R.string.stores_xbox_close_first) }
}
SecondaryButton(stringResource(R.string.stores_xbox_manage), enabled = download == null) { XboxContent.manage(ctx, installed) }
}
if (store == Store.BATTLENET) {
if (installed != null && id != null) {
LaunchedEffect(id) { BattleNetInstall.checkUpdate(ctx, installed) }
if (download != null) {
SteadyDownloadChip(download)
if (download.state != DownloadState.PAUSED) SecondaryButton(stringResource(R.string.stores_dl_pause)) { DownloadQueue.pause(download.key) }
else SecondaryButton(stringResource(R.string.stores_dl_resume)) { DownloadQueue.resume(ctx, download.key) }
} else if (BattleNetInstall.updates[id] == true) {
SecondaryButton(stringResource(R.string.bnet_update)) { BattleNetInstall.update(ctx, installed) }
if (rest) {
if (game != null) {
if (compactMenu) GameMoreMenu(game, a) else {
FileButtons(game, a)
GameShortcutMenu(game, a)
}
}
SecondaryButton(stringResource(R.string.bnet_open)) { a.onBattleNet() }
}
if (game != null && !compactMenu) {
HideButton(hideKey(game), game)
EditArtButton(game)
if (store == Store.ITCH && installed != null) ItchUpdateButton(installed, download == null && StoresState.uninstalling[installed.key] == null)
if (store == Store.GAMEJOLT && installed != null) GameJoltUpdateButton(installed, download == null && StoresState.uninstalling[installed.key] == null)
if (store == Store.GAMEJOLT && installed != null) GameJoltVersionButton(installed, download == null && StoresState.uninstalling[installed.key] == null)
if (inStore && store == Store.GAMEJOLT && installed != null) {
SecondaryButton(stringResource(R.string.stores_view_on, Store.GAMEJOLT.shortLabel)) {
openUrl(ctx, item?.storeUrl.orEmpty().ifBlank { GameJoltApi.pageUrl("game", installed.sidecar.id) })
}
}
if (store == Store.EA && installed != null) EaUpdateButton(installed, download == null && StoresState.uninstalling[installed.key] == null)
if (store == Store.GOG && installed != null) GogMaintenanceActions(installed)
if (store == Store.XBOX && id != null) XboxInstalledStream(id, game?.name ?: item?.title.orEmpty(), item)
if (store == Store.XBOX && installed != null && id != null) {
SecondaryButton(stringResource(R.string.stores_xbox_update), enabled = download == null && !XboxRuntime.isActive(id)) {
runCatching { XboxBackend.update(ctx, installed) }
.onFailure { StoresState.problems[Store.XBOX] = it.message ?: ctx.getString(R.string.stores_xbox_close_first) }
}
SecondaryButton(stringResource(R.string.stores_xbox_manage), enabled = download == null) { XboxContent.manage(ctx, installed) }
}
if (store == Store.BATTLENET) {
if (installed != null && id != null) {
LaunchedEffect(id) { BattleNetInstall.checkUpdate(ctx, installed) }
if (download != null) {
SteadyDownloadChip(download)
if (download.state != DownloadState.PAUSED) SecondaryButton(stringResource(R.string.stores_dl_pause)) { DownloadQueue.pause(download.key) }
else SecondaryButton(stringResource(R.string.stores_dl_resume)) { DownloadQueue.resume(ctx, download.key) }
} else if (BattleNetInstall.updates[id] == true) {
SecondaryButton(stringResource(R.string.bnet_update)) { BattleNetInstall.update(ctx, installed) }
}
}
SecondaryButton(stringResource(R.string.bnet_open)) { a.onBattleNet() }
}
if (game != null && !compactMenu) {
HideButton(hideKey(game), game)
EditArtButton(game)
}
}
}
download != null -> {
SteadyDownloadChip(download)
if (download.state != DownloadState.PAUSED) SecondaryButton(stringResource(R.string.stores_dl_pause), modifier = leadOn) { DownloadQueue.pause(download.key) }
else PrimaryButton(stringResource(R.string.stores_dl_resume), main = true, modifier = leadOn) { DownloadQueue.resume(ctx, download.key) }
ConfirmButton(stringResource(R.string.stores_dl_cancel), stringResource(R.string.stores_dl_cancel_confirm)) { DownloadQueue.cancel(ctx, download.key) }
if (rest) SteadyDownloadChip(download)
if (lead) {
if (download.state != DownloadState.PAUSED) SecondaryButton(stringResource(R.string.stores_dl_pause), modifier = leadOn) { DownloadQueue.pause(download.key) }
else PrimaryButton(stringResource(R.string.stores_dl_resume), main = true, modifier = leadOn) { DownloadQueue.resume(ctx, download.key) }
}
if (rest) ConfirmButton(stringResource(R.string.stores_dl_cancel), stringResource(R.string.stores_dl_cancel_confirm)) { DownloadQueue.cancel(ctx, download.key) }
}
failed != null -> {
ActionChip(stringResource(R.string.stores_dl_failed), ok = false)
PrimaryButton(stringResource(R.string.stores_dl_resume), main = true, modifier = leadOn) {
if (rest) ActionChip(stringResource(R.string.stores_dl_failed), ok = false)
if (lead) PrimaryButton(stringResource(R.string.stores_dl_resume), main = true, modifier = leadOn) {
if (item != null) StoresState.requestInstall(ctx, item) else DownloadQueue.retry(ctx, failed.key)
}
ConfirmButton(stringResource(R.string.stores_dl_clear), stringResource(R.string.stores_dl_cancel_confirm), compact = true) { DownloadQueue.clear(ctx, failed.key) }
if (rest) ConfirmButton(stringResource(R.string.stores_dl_clear), stringResource(R.string.stores_dl_cancel_confirm), compact = true) { DownloadQueue.clear(ctx, failed.key) }
}
cloud -> {
val cloudId = game.storeId.orEmpty()
XboxStreamButton(cloudId, game.name, main = true, modifier = leadOn)
if (item?.installable == true && item.xboxPc) {
if (lead) XboxStreamButton(cloudId, game.name, main = true, modifier = leadOn)
if (rest && item?.installable == true && item.xboxPc) {
SecondaryButton(
if (StoresState.isUnfinished(item)) stringResource(R.string.stores_resume_install)
else if (downloadBytes > 0) stringResource(R.string.stores_install_size, formatBytes(downloadBytes))
else stringResource(R.string.stores_install),
) { StoresState.requestInstall(ctx, item) }
}
if (item != null && StoresState.isUnfinished(item)) ConfirmButton(stringResource(R.string.stores_dl_clear), stringResource(R.string.stores_dl_cancel_confirm), compact = true) { StoresState.clearUnfinished(ctx, item) }
XboxLibraryButton(cloudId, item)
if (rest && item != null && StoresState.isUnfinished(item)) ConfirmButton(stringResource(R.string.stores_dl_clear), stringResource(R.string.stores_dl_cancel_confirm), compact = true) { StoresState.clearUnfinished(ctx, item) }
if (rest) XboxLibraryButton(cloudId, item)
}
store == Store.BATTLENET && item != null -> InstallButton(stringResource(R.string.stores_install), leadOn) { StoresState.requestInstall(ctx, item) }
store == Store.BATTLENET && item != null -> if (lead) InstallButton(stringResource(R.string.stores_install), leadOn) { StoresState.requestInstall(ctx, item) }
store == Store.XBOX && item != null && !item.xboxPc && item.xboxCloud -> {
XboxStreamButton(item.id, item.title, main = true, modifier = leadOn)
XboxLibraryButton(item.id, item)
if (lead) XboxStreamButton(item.id, item.title, main = true, modifier = leadOn)
if (rest) XboxLibraryButton(item.id, item)
}
item?.installable == true && StoresState.isUnfinished(item) -> {
InstallButton(stringResource(R.string.stores_resume_install), leadOn) { StoresState.requestInstall(ctx, item) }
ConfirmButton(stringResource(R.string.stores_dl_clear), stringResource(R.string.stores_dl_cancel_confirm), compact = true) { StoresState.clearUnfinished(ctx, item) }
if (lead) InstallButton(stringResource(R.string.stores_resume_install), leadOn) { StoresState.requestInstall(ctx, item) }
if (rest) ConfirmButton(stringResource(R.string.stores_dl_clear), stringResource(R.string.stores_dl_cancel_confirm), compact = true) { StoresState.clearUnfinished(ctx, item) }
}
item?.installable == true -> {
InstallButton(
if (lead) InstallButton(
if (downloadBytes > 0) stringResource(R.string.stores_install_size, formatBytes(downloadBytes)) else stringResource(R.string.stores_install),
leadOn,
) { StoresState.requestInstall(ctx, item) }
if (store == Store.XBOX && item.xboxCloud) {
if (rest && store == Store.XBOX && item.xboxCloud) {
XboxStreamButton(item.id, item.title)
XboxLibraryButton(item.id, item)
}
if (!item.accessible) SecondaryButton(buyLabel(item)) { openStoreUrl(ctx, item) }
if (rest && !item.accessible) SecondaryButton(buyLabel(item)) { openStoreUrl(ctx, item) }
}
item != null && (item.store == Store.ITCH || item.store == Store.GAMEJOLT) && item.isFree -> {
InstallButton(stringResource(R.string.stores_install), leadOn) { StoresState.requestInstall(ctx, item) }
SecondaryButton(stringResource(R.string.stores_view_on, item.store.shortLabel)) { openStoreUrl(ctx, item) }
if (lead) InstallButton(stringResource(R.string.stores_install), leadOn) { StoresState.requestInstall(ctx, item) }
if (rest) SecondaryButton(stringResource(R.string.stores_view_on, item.store.shortLabel)) { openStoreUrl(ctx, item) }
}
item != null && item.isFree -> {
item != null && item.isFree -> if (lead) {
val adding = StoresState.claiming[item.key] == true
PrimaryButton(stringResource(if (adding) R.string.stores_claiming else R.string.stores_get_free), enabled = !adding, main = true, modifier = leadOn) {
if (StoresState.canClaim(item)) StoresState.claim(ctx, item) { openStoreUrl(ctx, item) } else openStoreUrl(ctx, item)
}
}
item != null -> PrimaryButton(buyLabel(item), main = true, modifier = leadOn) { openStoreUrl(ctx, item) }
item != null -> if (lead) PrimaryButton(buyLabel(item), main = true, modifier = leadOn) { openStoreUrl(ctx, item) }
}
val entryKey = game?.let(::hideKey) ?: storeKey
if (!s.shortcutPicker && entryKey != null && (game == null || cloud)) HideButton(entryKey, game)
if (cloud && (download != null || failed != null)) {
XboxStreamButton(game.storeId.orEmpty(), game.name)
XboxLibraryButton(game.storeId.orEmpty(), item)
if (rest) {
val entryKey = game?.let(::hideKey) ?: storeKey
if (!s.shortcutPicker && entryKey != null && (game == null || cloud)) HideButton(entryKey, game)
if (cloud && (download != null || failed != null)) {
XboxStreamButton(game.storeId.orEmpty(), game.name)
XboxLibraryButton(game.storeId.orEmpty(), item)
}
BusyChip(s)
}
BusyChip(s)
}
}
@@ -58,6 +58,7 @@ import coil.size.Precision
import kotlin.math.max
internal val LocalPillButtons = compositionLocalOf { false }
internal val LocalGradientOutline = compositionLocalOf { false }
internal class GlassBackdrop {
var painter: Painter? = null
@@ -267,12 +267,6 @@ private fun InputSettingsContent(onBack: () -> Unit, onChanged: () -> Unit, embe
}
}
InputPage.SOURCE -> {
if (role == InputRole.PRIMARY) SettingsGroup(stringResource(R.string.input_screen_visibility)) {
ChoiceRow(host, "controller-osc", stringResource(R.string.mode_osc), stringResource(R.string.input_visibility_shared),
listOf(SessionPrefs.OSC_AUTO to stringResource(R.string.common_auto), SessionPrefs.OSC_ALWAYS to stringResource(R.string.common_always),
SessionPrefs.OSC_STEAM_TOUCH to stringResource(R.string.osc_steam_touch), SessionPrefs.OSC_STEAM_QAM to stringResource(R.string.mode_osc_qam), SessionPrefs.OSC_NEVER to stringResource(R.string.common_never)),
oscMode) { SessionPrefs.setOscMode(context, it); oscMode = it; onChanged() }
}
if (layout != null) SettingsGroup(stringResource(R.string.ctrl_layout)) {
if (layout.editable) InputNavigationRow(stringResource(R.string.input_edit_layout), layout.name, Modifier.testTag("input-surface-${role.name.lowercase()}")) { surface = true }
else InputHint(layout.name)
@@ -288,6 +282,12 @@ private fun InputSettingsContent(onBack: () -> Unit, onChanged: () -> Unit, embe
}
if (role == InputRole.SECONDARY) InputHint(stringResource(R.string.input_second_screen_enable))
}
if (role == InputRole.PRIMARY) SettingsGroup(stringResource(R.string.input_screen_visibility)) {
ChoiceRow(host, "controller-osc", stringResource(R.string.mode_osc), stringResource(R.string.input_visibility_shared),
listOf(SessionPrefs.OSC_AUTO to stringResource(R.string.common_auto), SessionPrefs.OSC_ALWAYS to stringResource(R.string.common_always),
SessionPrefs.OSC_STEAM_TOUCH to stringResource(R.string.osc_steam_touch), SessionPrefs.OSC_STEAM_QAM to stringResource(R.string.mode_osc_qam), SessionPrefs.OSC_NEVER to stringResource(R.string.common_never)),
oscMode) { SessionPrefs.setOscMode(context, it); oscMode = it; onChanged() }
}
SettingsGroup(stringResource(R.string.input_assign_actions)) {
val users = library.usersOfBindings(preset.id)
if (users.size > 1) InputHint(stringResource(R.string.input_shared_with, users.filterNot { it.id == profileId }.joinToString { it.name }))
@@ -90,6 +90,7 @@ import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.input.key.onPreviewKeyEvent
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.boundsInRoot
import androidx.compose.ui.layout.layout
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalContext
@@ -1121,14 +1122,22 @@ internal fun ArtCard(
}
val showName = LibraryDisplay.title || hot
val showDetail = LibraryDisplay.size || hot
if (showName || showDetail) Column(
verticalArrangement = Arrangement.spacedBy(1.dp),
modifier = Modifier.align(Alignment.BottomCenter).fillMaxWidth()
.background(Brush.verticalGradient(0f to Color.Transparent, 0.6f to Color.Black.copy(alpha = 0.78f), 1f to Color.Black.copy(alpha = 0.92f)))
.padding(start = 8.dp, end = 8.dp, top = 20.dp, bottom = if (download != null) 14.dp else 6.dp),
) {
if (showName) Text(title, fontSize = 11.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = if (hot) 2 else 1, overflow = TextOverflow.Ellipsis, lineHeight = 13.sp)
if (showDetail) detail()
if (showName || showDetail) {
val top = with(androidx.compose.ui.platform.LocalDensity.current) { 20.dp.roundToPx() }
val bottom = with(androidx.compose.ui.platform.LocalDensity.current) { (if (download != null) 14.dp else 6.dp).roundToPx() }
Column(
verticalArrangement = Arrangement.spacedBy(1.dp),
modifier = Modifier.align(Alignment.BottomCenter).fillMaxWidth()
.background(Brush.verticalGradient(0f to Color.Transparent, 0.6f to Color.Black.copy(alpha = 0.78f), 1f to Color.Black.copy(alpha = 0.92f)))
.layout { measurable, constraints ->
val inner = measurable.measure(constraints)
if (inner.height == 0) layout(inner.width, 0) {} else layout(inner.width, inner.height + top + bottom) { inner.place(0, top) }
}
.padding(horizontal = 8.dp),
) {
if (showName) Text(title, fontSize = 11.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = if (hot) 2 else 1, overflow = TextOverflow.Ellipsis, lineHeight = 13.sp)
if (showDetail) detail()
}
}
if (download != null) Box(Modifier.align(Alignment.BottomCenter).padding(start = 6.dp, end = 6.dp, bottom = 5.dp)) {
ProgressBarThin(download.fraction, paused = download.state == DownloadState.PAUSED, verify = download.stage == DownloadStage.VERIFY)
@@ -6,6 +6,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
@@ -13,26 +15,40 @@ import androidx.compose.ui.input.pointer.PointerEventPass
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.input.pointer.util.VelocityTracker
import androidx.compose.ui.input.pointer.util.addPointerInputChange
import androidx.compose.ui.layout.LayoutCoordinates
import androidx.compose.ui.layout.findRootCoordinates
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.unit.dp
import kotlin.math.abs
internal object PageSwipe {
var locks by mutableIntStateOf(0)
var direction by mutableIntStateOf(0)
var on by mutableStateOf(true)
}
@Composable
internal fun Modifier.pageSwipe(enabled: () -> Boolean, onSwipe: (Int) -> Unit): Modifier {
internal fun Modifier.pageSwipe(enabled: () -> Boolean, edgeGuard: () -> Boolean = { false }, onSwipe: (Int) -> Unit): Modifier {
val enabledNow by rememberUpdatedState(enabled)
val edgeGuardNow by rememberUpdatedState(edgeGuard)
val onSwipeNow by rememberUpdatedState(onSwipe)
return pointerInput(Unit) {
val placed = remember { arrayOfNulls<LayoutCoordinates>(1) }
return onGloballyPositioned { placed[0] = it }.pointerInput(Unit) {
val distance = 72.dp.toPx()
val flingDistance = 32.dp.toPx()
val flingVelocity = 900.dp.toPx()
val slop = viewConfiguration.touchSlop
val edge = 32.dp.toPx()
awaitEachGesture {
val down = awaitFirstDown(requireUnconsumed = false, pass = PointerEventPass.Final)
if (!enabledNow() || PageSwipe.locks > 0) return@awaitEachGesture
if (!PageSwipe.on || !enabledNow() || PageSwipe.locks > 0) return@awaitEachGesture
// A swipe in from the screen's edge brings back hidden system bars; it should not also turn the page.
if (edgeGuardNow()) {
val at = placed[0]?.takeIf { it.isAttached }
val x = at?.localToRoot(down.position)?.x ?: down.position.x
val width = at?.findRootCoordinates()?.size?.width?.toFloat() ?: size.width.toFloat()
if (x < edge || x > width - edge) return@awaitEachGesture
}
val tracker = VelocityTracker()
tracker.addPointerInputChange(down)
var total = Offset.Zero
@@ -48,7 +64,7 @@ internal fun Modifier.pageSwipe(enabled: () -> Boolean, onSwipe: (Int) -> Unit):
if (!mine && abs(total.x) > slop && abs(total.x) > abs(total.y) * 2f) mine = true
if (mine) change.consume()
}
if (!mine || PageSwipe.locks > 0) return@awaitEachGesture
if (!mine || !PageSwipe.on || PageSwipe.locks > 0) return@awaitEachGesture
val vx = tracker.calculateVelocity().x
val horizontal = abs(total.x) > abs(total.y) * 1.5f
val far = abs(total.x) > distance
@@ -108,6 +108,7 @@ internal object SettingsIndex {
s(SettingsSection.LAUNCHER, R.string.setup_launcher_orientation, "rotate", "portrait"),
s(SettingsSection.LAUNCHER, R.string.setup_session_orientation, "rotate", "portrait"),
s(SettingsSection.LAUNCHER, R.string.setup_fullscreen),
s(SettingsSection.LAUNCHER, R.string.setup_page_swipe, "gesture"),
s(SettingsSection.LAUNCHER, R.string.setup_controller_haptics, "vibration", "rumble"),
s(SettingsSection.LAUNCHER, R.string.setup_dual_screen_launcher, "thor", "second screen", "bottom screen"),
s(SettingsSection.LAUNCHER, R.string.setup_low_storage_warning),
@@ -163,6 +163,8 @@ internal fun Modifier.bumpers(onPrevious: () -> Unit, onNext: () -> Unit): Modif
}
}
internal val LocalRevealChecked = androidx.compose.runtime.compositionLocalOf { true }
@OptIn(androidx.compose.foundation.ExperimentalFoundationApi::class)
@Composable
internal fun TabStrip(
@@ -347,7 +349,7 @@ fun AnchoredMenu(
}
}
.verticalScroll(scroll),
) { content(firstItemFocus) }
) { androidx.compose.runtime.CompositionLocalProvider(LocalRevealChecked provides true) { content(firstItemFocus) } }
if (scroll.canScrollForward) Icon(
Icons.Filled.KeyboardArrowDown, contentDescription = null, tint = colors.onSurfaceVariant,
modifier = Modifier.align(Alignment.BottomCenter).size(20.dp),
@@ -377,7 +379,7 @@ fun MenuItem(
val hot = src.collectIsFocusedAsState().value || src.collectIsHoveredAsState().value
val shift by animateFloatAsState(if (hot) 2f else 0f, Motion.sp(0.5f), label = "miShift")
val reveal = remember { androidx.compose.foundation.relocation.BringIntoViewRequester() }
if (checked) LaunchedEffect(Unit) { reveal.bringIntoView() }
if (checked && LocalRevealChecked.current) LaunchedEffect(Unit) { reveal.bringIntoView() }
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier.fillMaxWidth()
+2
View File
@@ -971,6 +971,8 @@
<string name="setup_fullscreen">ملء الشاشة</string>
<string name="setup_fullscreen_on">يخفي شريطي الحالة والتنقّل في Android</string>
<string name="setup_fullscreen_off">يعرض شريطي الحالة والتنقّل في Android</string>
<string name="setup_page_swipe">التمرير بين الصفحات</string>
<string name="setup_page_swipe_hint">اسحب عبر الصفحة لتغيير علامة التبويب.</string>
<string name="setup_dual_screen_launcher">المشغّل على شاشتين</string>
<string name="setup_dual_screen_launcher_hint">يضع الوضع «تلقائي» أقسام المشغّل (Steam والمكتبة والمتاجر وغيرها) على الشاشة الثانية في الأجهزة المحمولة المزوّدة بشاشة ثانية مدمجة. ويستخدم الوضع «تشغيل» أي شاشة ثانية. أما الوضع «إيقاف» فيُبقي المشغّل على شاشة واحدة.</string>
<string name="setup_dual_screen_sessions">الجلسات على شاشتين</string>
@@ -989,6 +989,8 @@
<string name="setup_fullscreen">Pantalla completa</string>
<string name="setup_fullscreen_on">Oculta las barras de estado y navegación de Android</string>
<string name="setup_fullscreen_off">Muestra las barras de estado y navegación de Android</string>
<string name="setup_page_swipe">Deslizar entre páginas</string>
<string name="setup_page_swipe_hint">Desliza sobre una página para cambiar de pestaña.</string>
<string name="setup_dual_screen_launcher">Lanzador de doble pantalla</string>
<string name="setup_dual_screen_launcher_hint">Automático coloca las secciones del lanzador (Steam, Biblioteca, Tiendas y las demás) en la segunda pantalla integrada de las consolas portátiles que la tienen. Activado usa cualquier segunda pantalla. Desactivado mantiene el lanzador en una sola pantalla.</string>
<string name="setup_dual_screen_sessions">Sesiones de doble pantalla</string>
+2
View File
@@ -959,6 +959,8 @@
<string name="setup_fullscreen">Цял екран</string>
<string name="setup_fullscreen_on">Скрива лентите за състояние и навигация на Android</string>
<string name="setup_fullscreen_off">Показва лентите за състояние и навигация на Android</string>
<string name="setup_page_swipe">Плъзгане между страниците</string>
<string name="setup_page_swipe_hint">Плъзнете по страница, за да смените раздела.</string>
<string name="setup_dual_screen_launcher">Лаунчер с два екрана</string>
<string name="setup_dual_screen_launcher_hint">Автоматично: секциите на лаунчера (Steam, Библиотека, Магазини и останалите) се показват на втория екран при преносими устройства с вграден такъв. Включено: използва се всеки втори дисплей. Изключено: лаунчерът остава на един екран.</string>
<string name="setup_dual_screen_sessions">Сесии с два екрана</string>
+2
View File
@@ -965,6 +965,8 @@
<string name="setup_fullscreen">Celá obrazovka</string>
<string name="setup_fullscreen_on">Skryje stavový a navigační panel Androidu</string>
<string name="setup_fullscreen_off">Zobrazí stavový a navigační panel Androidu</string>
<string name="setup_page_swipe">Přejíždění mezi stránkami</string>
<string name="setup_page_swipe_hint">Přejetím přes stránku přepnete kartu.</string>
<string name="setup_dual_screen_launcher">Spouštěč na dvou obrazovkách</string>
<string name="setup_dual_screen_launcher_hint">Automaticky přesune sekce spouštěče (Steam, Knihovna, Obchody a ostatní) na druhou obrazovku handheldů, které ji mají vestavěnou. Zapnuto použije libovolný druhý displej. Vypnuto ponechá spouštěč na jedné obrazovce.</string>
<string name="setup_dual_screen_sessions">Relace na dvou obrazovkách</string>
+2
View File
@@ -959,6 +959,8 @@
<string name="setup_fullscreen">Fuldskærm</string>
<string name="setup_fullscreen_on">Skjuler Androids status- og navigationsbjælker</string>
<string name="setup_fullscreen_off">Viser Androids status- og navigationsbjælker</string>
<string name="setup_page_swipe">Stryg mellem sider</string>
<string name="setup_page_swipe_hint">Stryg hen over en side for at skifte fane.</string>
<string name="setup_dual_screen_launcher">Launcher til to skærme</string>
<string name="setup_dual_screen_launcher_hint">Automatisk placerer launcherens sektioner (Steam, Bibliotek, Butikker og resten) på den anden skærm på håndholdte enheder med en indbygget anden skærm. Til bruger enhver ekstra skærm. Fra holder launcheren på én skærm.</string>
<string name="setup_dual_screen_sessions">Sessioner på to skærme</string>
+2
View File
@@ -951,6 +951,8 @@
<string name="setup_fullscreen">Vollbild</string>
<string name="setup_fullscreen_on">Blendet die Status- und Navigationsleiste von Android aus</string>
<string name="setup_fullscreen_off">Zeigt die Status- und Navigationsleiste von Android an</string>
<string name="setup_page_swipe">Zwischen Seiten wischen</string>
<string name="setup_page_swipe_hint">Über eine Seite wischen, um den Tab zu wechseln.</string>
<string name="setup_dual_screen_launcher">Dual-Screen-Launcher</string>
<string name="setup_dual_screen_launcher_hint">Bei Automatisch liegen die Launcher-Bereiche (Steam, Bibliothek, Shops und die übrigen) auf dem zweiten Bildschirm von Handhelds mit integriertem zweitem Bildschirm. Ein nutzt einen beliebigen zweiten Bildschirm. Aus belässt den Launcher auf einem Bildschirm.</string>
<string name="setup_dual_screen_sessions">Dual-Screen-Sitzungen</string>
+2
View File
@@ -959,6 +959,8 @@
<string name="setup_fullscreen">Πλήρης οθόνη</string>
<string name="setup_fullscreen_on">Αποκρύπτει τις γραμμές κατάστασης και πλοήγησης του Android</string>
<string name="setup_fullscreen_off">Εμφανίζει τις γραμμές κατάστασης και πλοήγησης του Android</string>
<string name="setup_page_swipe">Σάρωση μεταξύ σελίδων</string>
<string name="setup_page_swipe_hint">Σαρώστε κατά μήκος μιας σελίδας για να αλλάξετε καρτέλα.</string>
<string name="setup_dual_screen_launcher">Εκκινητής διπλής οθόνης</string>
<string name="setup_dual_screen_launcher_hint">Η επιλογή Αυτόματα τοποθετεί τις ενότητες του εκκινητή (Steam, Βιβλιοθήκη, Καταστήματα και τις υπόλοιπες) στη δεύτερη οθόνη των φορητών κονσολών με ενσωματωμένη δεύτερη οθόνη. Η επιλογή Ενεργό χρησιμοποιεί οποιαδήποτε δεύτερη οθόνη. Η επιλογή Ανενεργό κρατά τον εκκινητή σε μία οθόνη.</string>
<string name="setup_dual_screen_sessions">Συνεδρίες διπλής οθόνης</string>
+2
View File
@@ -962,6 +962,8 @@
<string name="setup_fullscreen">Pantalla completa</string>
<string name="setup_fullscreen_on">Oculta las barras de estado y navegación de Android</string>
<string name="setup_fullscreen_off">Muestra las barras de estado y navegación de Android</string>
<string name="setup_page_swipe">Deslizar entre páginas</string>
<string name="setup_page_swipe_hint">Desliza sobre una página para cambiar de pestaña.</string>
<string name="setup_dual_screen_launcher">Lanzador de doble pantalla</string>
<string name="setup_dual_screen_launcher_hint">Automático coloca las secciones del lanzador (Steam, Biblioteca, Tiendas y el resto) en la segunda pantalla de las consolas portátiles que la llevan integrada. Activado usa cualquier segunda pantalla. Desactivado mantiene el lanzador en una sola pantalla.</string>
<string name="setup_dual_screen_sessions">Sesiones de doble pantalla</string>
+2
View File
@@ -959,6 +959,8 @@
<string name="setup_fullscreen">Koko näyttö</string>
<string name="setup_fullscreen_on">Piilottaa Androidin tila- ja navigointipalkit</string>
<string name="setup_fullscreen_off">Näyttää Androidin tila- ja navigointipalkit</string>
<string name="setup_page_swipe">Pyyhkäise sivujen välillä</string>
<string name="setup_page_swipe_hint">Vaihda välilehteä pyyhkäisemällä sivun poikki.</string>
<string name="setup_dual_screen_launcher">Kahden näytön käynnistin</string>
<string name="setup_dual_screen_launcher_hint">Automaattinen siirtää käynnistimen osiot (Steam, Kirjasto, Kaupat ja muut) käsikonsolin sisäänrakennetulle toiselle näytölle. Päällä käyttää mitä tahansa toista näyttöä. Pois päältä pitää käynnistimen yhdellä näytöllä.</string>
<string name="setup_dual_screen_sessions">Kahden näytön istunnot</string>
+2
View File
@@ -962,6 +962,8 @@
<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_page_swipe">Balayer entre les pages</string>
<string name="setup_page_swipe_hint">Balayez une page pour changer d\'onglet.</string>
<string name="setup_dual_screen_launcher">Lanceur double écran</string>
<string name="setup_dual_screen_launcher_hint">Automatique place les sections du lanceur (Steam, Bibliothèque, Boutiques et les autres) sur le second écran intégré des consoles portables qui en sont équipées. Activé utilise n\'importe quel écran secondaire. Désactivé conserve le lanceur sur un seul écran.</string>
<string name="setup_dual_screen_sessions">Sessions double écran</string>
+2
View File
@@ -959,6 +959,8 @@
<string name="setup_fullscreen">फ़ुलस्क्रीन</string>
<string name="setup_fullscreen_on">Android स्टेटस और नेविगेशन बार छिपाता है</string>
<string name="setup_fullscreen_off">Android स्टेटस और नेविगेशन बार दिखाता है</string>
<string name="setup_page_swipe">पेजों के बीच स्वाइप करें</string>
<string name="setup_page_swipe_hint">टैब बदलने के लिए किसी पेज पर स्वाइप करें।</string>
<string name="setup_dual_screen_launcher">डुअल स्क्रीन लॉन्चर</string>
<string name="setup_dual_screen_launcher_hint">स्वचालित पर, बिल्ट-इन दूसरी स्क्रीन वाले हैंडहेल्ड में लॉन्चर के सेक्शन (Steam, लाइब्रेरी, स्टोर्स और बाकी) दूसरी स्क्रीन पर चले जाते हैं। चालू पर कोई भी दूसरी डिस्प्ले इस्तेमाल होती है। बंद पर लॉन्चर एक ही स्क्रीन पर रहता है।</string>
<string name="setup_dual_screen_sessions">डुअल स्क्रीन सत्र</string>
+2
View File
@@ -959,6 +959,8 @@
<string name="setup_fullscreen">Teljes képernyő</string>
<string name="setup_fullscreen_on">Elrejti az Android állapot- és navigációs sávokat</string>
<string name="setup_fullscreen_off">Megjeleníti az Android állapot- és navigációs sávokat</string>
<string name="setup_page_swipe">Lapozás csúsztatással</string>
<string name="setup_page_swipe_hint">Csúsztasson végig egy oldalon a lapváltáshoz.</string>
<string name="setup_dual_screen_launcher">Kétképernyős indító</string>
<string name="setup_dual_screen_launcher_hint">Az Automatikus mód a beépített második képernyővel rendelkező kézi eszközökön a második képernyőre helyezi az indító szakaszait (Steam, Könyvtár, Áruházak és a többi). A Be mód bármely második kijelzőt használ. A Ki mód egy képernyőn tartja az indítót.</string>
<string name="setup_dual_screen_sessions">Kétképernyős munkamenetek</string>
+2
View File
@@ -956,6 +956,8 @@
<string name="setup_fullscreen">Layar penuh</string>
<string name="setup_fullscreen_on">Menyembunyikan bilah status dan navigasi Android</string>
<string name="setup_fullscreen_off">Menampilkan bilah status dan navigasi Android</string>
<string name="setup_page_swipe">Geser antarhalaman</string>
<string name="setup_page_swipe_hint">Geser melintasi halaman untuk berganti tab.</string>
<string name="setup_dual_screen_launcher">Peluncur layar ganda</string>
<string name="setup_dual_screen_launcher_hint">Otomatis menempatkan bagian peluncur (Steam, Pustaka, Toko, dan bagian lainnya) pada layar kedua bawaan perangkat genggam. Aktif memakai layar kedua mana pun. Nonaktif membuat peluncur tetap di satu layar saja.</string>
<string name="setup_dual_screen_sessions">Sesi layar ganda</string>
+2
View File
@@ -954,6 +954,8 @@
<string name="setup_fullscreen">Schermo intero</string>
<string name="setup_fullscreen_on">Nasconde la barra di stato e la barra di navigazione di Android</string>
<string name="setup_fullscreen_off">Mostra la barra di stato e la barra di navigazione di Android</string>
<string name="setup_page_swipe">Scorri tra le pagine</string>
<string name="setup_page_swipe_hint">Scorri su una pagina per cambiare scheda.</string>
<string name="setup_dual_screen_launcher">Launcher a doppio schermo</string>
<string name="setup_dual_screen_launcher_hint">Automatico colloca le sezioni del launcher (Steam, Libreria, Store e le altre) sullo schermo secondario integrato delle console portatili che ne hanno uno. Con Attivo si usa qualsiasi display secondario. Con Disattivo il launcher resta su un solo schermo.</string>
<string name="setup_dual_screen_sessions">Sessioni a doppio schermo</string>
+2
View File
@@ -956,6 +956,8 @@
<string name="setup_fullscreen">全画面</string>
<string name="setup_fullscreen_on">Androidのステータスバーとナビゲーションバーを非表示</string>
<string name="setup_fullscreen_off">Androidのステータスバーとナビゲーションバーを表示</string>
<string name="setup_page_swipe">スワイプでページを切り替え</string>
<string name="setup_page_swipe_hint">ページを横切るようにスワイプすると、タブを切り替えます。</string>
<string name="setup_dual_screen_launcher">デュアルスクリーンランチャー</string>
<string name="setup_dual_screen_launcher_hint">自動では、内蔵セカンドスクリーンを搭載した携帯ゲーム機で、ランチャーの各セクション(Steam、ライブラリ、ストアなど)を2画面目に表示します。オンでは任意のセカンドディスプレイを使用します。オフではランチャーを1画面に留めます。</string>
<string name="setup_dual_screen_sessions">デュアルスクリーンセッション</string>
+2
View File
@@ -956,6 +956,8 @@
<string name="setup_fullscreen">전체 화면</string>
<string name="setup_fullscreen_on">Android 상태 표시줄 및 탐색 표시줄 숨기기</string>
<string name="setup_fullscreen_off">Android 상태 표시줄 및 탐색 표시줄 표시</string>
<string name="setup_page_swipe">스와이프로 페이지 전환</string>
<string name="setup_page_swipe_hint">페이지를 가로질러 스와이프하면 탭이 바뀝니다.</string>
<string name="setup_dual_screen_launcher">듀얼 화면 런처</string>
<string name="setup_dual_screen_launcher_hint">자동은 내장 두 번째 화면이 있는 휴대용 기기에서 런처 섹션(Steam, 라이브러리, 스토어 등)을 두 번째 화면에 표시합니다. 켜기는 어떤 두 번째 디스플레이든 사용합니다. 끄기는 런처를 한 화면에 유지합니다.</string>
<string name="setup_dual_screen_sessions">듀얼 화면 세션</string>
+2
View File
@@ -956,6 +956,8 @@
<string name="setup_fullscreen">Skrin penuh</string>
<string name="setup_fullscreen_on">Menyembunyikan bar status dan navigasi Android</string>
<string name="setup_fullscreen_off">Memaparkan bar status dan navigasi Android</string>
<string name="setup_page_swipe">Leret antara halaman</string>
<string name="setup_page_swipe_hint">Leret merentasi halaman untuk menukar tab.</string>
<string name="setup_dual_screen_launcher">Pelancar dwi skrin</string>
<string name="setup_dual_screen_launcher_hint">Automatik meletakkan bahagian pelancar (Steam, Pustaka, Kedai dan selebihnya) pada skrin kedua terbina dalam peranti genggam. Hidup menggunakan sebarang paparan kedua. Mati mengekalkan pelancar pada satu skrin.</string>
<string name="setup_dual_screen_sessions">Sesi dwi skrin</string>
+2
View File
@@ -959,6 +959,8 @@
<string name="setup_fullscreen">Fullskjerm</string>
<string name="setup_fullscreen_on">Skjuler Androids status- og navigasjonslinjer</string>
<string name="setup_fullscreen_off">Viser Androids status- og navigasjonslinjer</string>
<string name="setup_page_swipe">Sveip mellom sider</string>
<string name="setup_page_swipe_hint">Sveip over en side for å bytte fane.</string>
<string name="setup_dual_screen_launcher">Startprogram på to skjermer</string>
<string name="setup_dual_screen_launcher_hint">Automatisk plasserer startprogrammets deler (Steam, Bibliotek, Butikker og resten) på den andre skjermen på håndholdte enheter med innebygd sekundærskjerm. På bruker en hvilken som helst annen skjerm. Av holder startprogrammet på én skjerm.</string>
<string name="setup_dual_screen_sessions">Økter på to skjermer</string>
+2
View File
@@ -959,6 +959,8 @@
<string name="setup_fullscreen">Volledig scherm</string>
<string name="setup_fullscreen_on">Verbergt de statusbalk en navigatiebalk van Android</string>
<string name="setup_fullscreen_off">Toont de statusbalk en navigatiebalk van Android</string>
<string name="setup_page_swipe">Vegen tussen pagina\'s</string>
<string name="setup_page_swipe_hint">Veeg over een pagina om van tabblad te wisselen.</string>
<string name="setup_dual_screen_launcher">Launcher op twee schermen</string>
<string name="setup_dual_screen_launcher_hint">Automatisch zet de launchersecties (Steam, Bibliotheek, Winkels en de rest) op het tweede scherm van handhelds met een ingebouwd exemplaar. Aan gebruikt elk tweede scherm. Uit houdt de launcher op één scherm.</string>
<string name="setup_dual_screen_sessions">Sessies op twee schermen</string>
+2
View File
@@ -965,6 +965,8 @@
<string name="setup_fullscreen">Pełny ekran</string>
<string name="setup_fullscreen_on">Ukrywa systemowe paski stanu i nawigacji</string>
<string name="setup_fullscreen_off">Pokazuje systemowe paski stanu i nawigacji</string>
<string name="setup_page_swipe">Przesuwanie między stronami</string>
<string name="setup_page_swipe_hint">Przesuń palcem po stronie, aby zmienić kartę.</string>
<string name="setup_dual_screen_launcher">Launcher na dwóch ekranach</string>
<string name="setup_dual_screen_launcher_hint">Automatycznie umieszcza sekcje launchera (Steam, Biblioteka, Sklepy i pozostałe) na wbudowanym drugim ekranie konsol przenośnych. Włączone używa dowolnego drugiego wyświetlacza. Wyłączone pozostawia launcher na jednym ekranie.</string>
<string name="setup_dual_screen_sessions">Sesje na dwóch ekranach</string>
@@ -954,6 +954,8 @@
<string name="setup_fullscreen">Ecrã inteiro</string>
<string name="setup_fullscreen_on">Oculta as barras de estado e de navegação do Android</string>
<string name="setup_fullscreen_off">Mostra as barras de estado e de navegação do Android</string>
<string name="setup_page_swipe">Deslizar entre páginas</string>
<string name="setup_page_swipe_hint">Deslize sobre uma página para mudar de separador.</string>
<string name="setup_dual_screen_launcher">Iniciador de ecrã duplo</string>
<string name="setup_dual_screen_launcher_hint">Automático coloca as secções do iniciador (Steam, Biblioteca, Lojas e as restantes) no segundo ecrã das consolas portáteis com um segundo ecrã integrado. Ativado utiliza qualquer segundo ecrã. Desativado mantém o iniciador num único ecrã.</string>
<string name="setup_dual_screen_sessions">Sessões de ecrã duplo</string>
+2
View File
@@ -961,6 +961,8 @@
<string name="setup_fullscreen">Tela cheia</string>
<string name="setup_fullscreen_on">Oculta as barras de status e de navegação do Android</string>
<string name="setup_fullscreen_off">Mostra as barras de status e de navegação do Android</string>
<string name="setup_page_swipe">Deslizar entre páginas</string>
<string name="setup_page_swipe_hint">Deslize sobre uma página para mudar de aba.</string>
<string name="setup_dual_screen_launcher">Iniciador em duas telas</string>
<string name="setup_dual_screen_launcher_hint">O modo automático coloca as seções do iniciador (Steam, Biblioteca, Lojas e as demais) na segunda tela de consoles portáteis com uma tela secundária integrada. Ativado usa qualquer tela secundária. Desativado mantém o iniciador em uma única tela.</string>
<string name="setup_dual_screen_sessions">Sessões em duas telas</string>
+2
View File
@@ -962,6 +962,8 @@
<string name="setup_fullscreen">Ecran complet</string>
<string name="setup_fullscreen_on">Ascunde barele de stare și de navigare Android</string>
<string name="setup_fullscreen_off">Arată barele de stare și de navigare Android</string>
<string name="setup_page_swipe">Glisare între pagini</string>
<string name="setup_page_swipe_hint">Glisați peste o pagină pentru a schimba fila.</string>
<string name="setup_dual_screen_launcher">Lansator pe două ecrane</string>
<string name="setup_dual_screen_launcher_hint">Automat plasează secțiunile lansatorului (Steam, Bibliotecă, Magazine și celelalte) pe ecranul secundar al consolelor portabile cu unul integrat. Activat folosește orice ecran secundar. Dezactivat păstrează lansatorul pe un singur ecran.</string>
<string name="setup_dual_screen_sessions">Sesiuni pe două ecrane</string>
+2
View File
@@ -965,6 +965,8 @@
<string name="setup_fullscreen">Полноэкранный режим</string>
<string name="setup_fullscreen_on">Скрывает строку состояния и панель навигации Android</string>
<string name="setup_fullscreen_off">Показывает строку состояния и панель навигации Android</string>
<string name="setup_page_swipe">Перелистывание страниц свайпом</string>
<string name="setup_page_swipe_hint">Проведите по странице, чтобы сменить вкладку.</string>
<string name="setup_dual_screen_launcher">Лаунчер на двух экранах</string>
<string name="setup_dual_screen_launcher_hint">«Автоматически» переносит разделы лаунчера (Steam, Библиотека, Магазины и остальные) на второй экран портативных устройств со встроенным вторым экраном. «Вкл.» использует любой второй дисплей. «Выкл.» оставляет лаунчер на одном экране.</string>
<string name="setup_dual_screen_sessions">Сессии на двух экранах</string>
+2
View File
@@ -959,6 +959,8 @@
<string name="setup_fullscreen">Helskärm</string>
<string name="setup_fullscreen_on">Döljer Androids statusfält och navigeringsfält</string>
<string name="setup_fullscreen_off">Visar Androids statusfält och navigeringsfält</string>
<string name="setup_page_swipe">Svep mellan sidor</string>
<string name="setup_page_swipe_hint">Svep över en sida för att byta flik.</string>
<string name="setup_dual_screen_launcher">Startprogram för två skärmar</string>
<string name="setup_dual_screen_launcher_hint">Automatiskt: placerar startprogrammets avsnitt (Steam, Bibliotek, Butiker med flera) på den inbyggda andra skärmen på handhållna enheter som har en. På: använder vilken andra bildskärm som helst. Av: behåller startprogrammet på en skärm.</string>
<string name="setup_dual_screen_sessions">Sessioner med två skärmar</string>
+2
View File
@@ -956,6 +956,8 @@
<string name="setup_fullscreen">เต็มจอ</string>
<string name="setup_fullscreen_on">ซ่อนแถบสถานะและแถบนำทางของ Android</string>
<string name="setup_fullscreen_off">แสดงแถบสถานะและแถบนำทางของ Android</string>
<string name="setup_page_swipe">ปัดเพื่อเปลี่ยนหน้า</string>
<string name="setup_page_swipe_hint">ปัดผ่านหน้าเพื่อเปลี่ยนแท็บ</string>
<string name="setup_dual_screen_launcher">ลอนเชอร์แบบสองจอ</string>
<string name="setup_dual_screen_launcher_hint">โหมดอัตโนมัติจะแสดงส่วนต่างๆ ของลอนเชอร์ (Steam, คลังเกม, ร้านค้า และส่วนอื่นๆ) บนจอที่สองของเครื่องเล่นพกพาที่มีจอที่สองในตัว โหมดเปิดใช้จอที่สองใดก็ได้ โหมดปิดจะแสดงลอนเชอร์บนจอเดียว</string>
<string name="setup_dual_screen_sessions">เซสชันแบบสองจอ</string>
+2
View File
@@ -951,6 +951,8 @@
<string name="setup_fullscreen">Tam ekran</string>
<string name="setup_fullscreen_on">Android durum ve gezinme çubuklarını gizler</string>
<string name="setup_fullscreen_off">Android durum ve gezinme çubuklarını gösterir</string>
<string name="setup_page_swipe">Sayfalar arasında kaydır</string>
<string name="setup_page_swipe_hint">Sekme değiştirmek için sayfa boyunca kaydırın.</string>
<string name="setup_dual_screen_launcher">Çift ekranlı başlatıcı</string>
<string name="setup_dual_screen_launcher_hint">Otomatik, yerleşik ikinci ekranı olan el konsollarında başlatıcı bölümlerini (Steam, Kitaplık, Mağazalar ve diğerleri) ikinci ekrana yerleştirir. Açık, herhangi bir ikinci ekranı kullanır. Kapalı, başlatıcıyı tek ekranda tutar.</string>
<string name="setup_dual_screen_sessions">Çift ekranlı oturumlar</string>
+2
View File
@@ -965,6 +965,8 @@
<string name="setup_fullscreen">Повний екран</string>
<string name="setup_fullscreen_on">Приховує рядок стану та панель навігації Android</string>
<string name="setup_fullscreen_off">Показує рядок стану та панель навігації Android</string>
<string name="setup_page_swipe">Гортання сторінок свайпом</string>
<string name="setup_page_swipe_hint">Проведіть по сторінці, щоб змінити вкладку.</string>
<string name="setup_dual_screen_launcher">Лаунчер для двох екранів</string>
<string name="setup_dual_screen_launcher_hint">Автоматичний режим розміщує розділи лаунчера (Steam, Бібліотека, Магазини тощо) на вбудованому другому екрані портативних пристроїв. У режимі «Увімкнено» використовується будь-який другий дисплей. У режимі «Вимкнено» лаунчер залишається на одному екрані.</string>
<string name="setup_dual_screen_sessions">Сеанси для двох екранів</string>
+2
View File
@@ -956,6 +956,8 @@
<string name="setup_fullscreen">Toàn màn hình</string>
<string name="setup_fullscreen_on">Ẩn thanh trạng thái và thanh điều hướng của Android</string>
<string name="setup_fullscreen_off">Hiện thanh trạng thái và thanh điều hướng của Android</string>
<string name="setup_page_swipe">Vuốt để chuyển trang</string>
<string name="setup_page_swipe_hint">Vuốt ngang trang để đổi thẻ.</string>
<string name="setup_dual_screen_launcher">Trình khởi chạy hai màn hình</string>
<string name="setup_dual_screen_launcher_hint">Tự động đưa các phần của trình khởi chạy (Steam, Thư viện, Cửa hàng và phần còn lại) lên màn hình thứ hai tích hợp của máy cầm tay. Bật dùng bất kỳ màn hình thứ hai nào. Tắt giữ trình khởi chạy trên một màn hình.</string>
<string name="setup_dual_screen_sessions">Phiên chơi hai màn hình</string>
@@ -956,6 +956,8 @@
<string name="setup_fullscreen">全屏</string>
<string name="setup_fullscreen_on">隐藏 Android 状态栏和导航栏</string>
<string name="setup_fullscreen_off">显示 Android 状态栏和导航栏</string>
<string name="setup_page_swipe">滑动切换页面</string>
<string name="setup_page_swipe_hint">在页面上滑动即可切换标签。</string>
<string name="setup_dual_screen_launcher">双屏启动器</string>
<string name="setup_dual_screen_launcher_hint">自动会把启动器的各个板块(Steam、库、商店等)放到带内置副屏的掌机的第二块屏幕上。开启使用任意第二块显示屏。关闭则让启动器只显示在一块屏幕上。</string>
<string name="setup_dual_screen_sessions">双屏会话</string>
@@ -955,6 +955,8 @@
<string name="setup_fullscreen">全螢幕</string>
<string name="setup_fullscreen_on">隱藏 Android 狀態列和導覽列</string>
<string name="setup_fullscreen_off">顯示 Android 狀態列和導覽列</string>
<string name="setup_page_swipe">滑動切換頁面</string>
<string name="setup_page_swipe_hint">在頁面上滑動即可切換標籤。</string>
<string name="setup_dual_screen_launcher">雙螢幕啟動器</string>
<string name="setup_dual_screen_launcher_hint">自動會把啟動器各部分(Steam、收藏庫、商店及其他部分)放到內建雙螢幕手持裝置的第二螢幕。開啟會使用任何第二顯示器。關閉會將啟動器保持在單一螢幕。</string>
<string name="setup_dual_screen_sessions">雙螢幕工作階段</string>
@@ -955,6 +955,8 @@
<string name="setup_fullscreen">全螢幕</string>
<string name="setup_fullscreen_on">隱藏 Android 狀態列和導覽列</string>
<string name="setup_fullscreen_off">顯示 Android 狀態列和導覽列</string>
<string name="setup_page_swipe">滑動切換頁面</string>
<string name="setup_page_swipe_hint">在頁面上滑動即可切換分頁。</string>
<string name="setup_dual_screen_launcher">雙螢幕啟動器</string>
<string name="setup_dual_screen_launcher_hint">自動:在內建第二螢幕的掌機上,將啟動器區塊(Steam、收藏庫、商店等)放到第二螢幕。開啟:使用任一第二螢幕。關閉:啟動器維持在單一螢幕。</string>
<string name="setup_dual_screen_sessions">雙螢幕工作階段</string>
+2
View File
@@ -1035,6 +1035,8 @@
<string name="setup_fullscreen">Fullscreen</string>
<string name="setup_fullscreen_on">Hides the Android status and navigation bars</string>
<string name="setup_fullscreen_off">Shows the Android status and navigation bars</string>
<string name="setup_page_swipe">Swipe between pages</string>
<string name="setup_page_swipe_hint">Swipe across a page to change tabs.</string>
<string name="setup_controller_haptics">Controller haptics</string>
<string name="setup_controller_haptics_hint">A light tick when the D-pad, A or the shoulder buttons move or select in the launcher. Touch stays silent</string>
<string name="setup_dual_screen_launcher">Dual screen launcher</string>
@@ -1,93 +0,0 @@
package com.droiddeck.launcher.hud
import android.os.Looper
import android.provider.Settings
import android.view.View
import android.widget.FrameLayout
import com.droiddeck.launcher.session.SessionPrefs
import com.droiddeck.launcher.ui.Motion
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.Shadows.shadowOf
import org.robolectric.annotation.Config
import org.robolectric.annotation.GraphicsMode
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [33], qualifiers = "xhdpi")
@GraphicsMode(GraphicsMode.Mode.NATIVE)
class DroidDeckHudHostInsetTest {
private fun animate(scale: Float) {
val app = RuntimeEnvironment.getApplication()
Settings.Global.putFloat(app.contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE, scale)
Motion.refresh(app)
}
@Before fun noAnimation() = animate(0f)
@After fun restoreAnimation() = animate(1f)
private fun show(size: String, x: Float, y: Float, padLeft: Int, padRight: Int): DroidDeckHudView {
val app = RuntimeEnvironment.getApplication()
SessionPrefs.setDroidDeckHudConfig(app, DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudSnap" to "1") + ("hudSize" to size)))
SessionPrefs.setDroidDeckHudPosition(app, x, y)
val root = FrameLayout(app)
root.setPadding(padLeft, 0, padRight, 0)
DroidDeckHudHost(app).attach(root, 0)
val hud = root.getChildAt(0) as DroidDeckHudView
hud.visibility = View.VISIBLE
val exactly = { s: Int -> View.MeasureSpec.makeMeasureSpec(s, View.MeasureSpec.EXACTLY) }
root.measure(exactly(2000), exactly(1000))
root.layout(0, 0, 2000, 1000)
hud.showForTest(DroidDeckHudPanelTest.SNAPSHOT, "DXVK", 0L)
hud.requestLayout()
root.measure(exactly(2000), exactly(1000))
root.layout(0, 0, 2000, 1000)
shadowOf(Looper.getMainLooper()).idle()
return hud
}
@Test fun theStripSpansOnlyTheAreaInsideTheNotchPadding() {
val hud = show("strip", 0f, 0f, padLeft = 120, padRight = 40)
assertEquals(120f, hud.x, 0.5f)
assertEquals(2000 - 120 - 40, hud.width)
}
@Test fun aHudSnappedLeftSitsBesideTheNotchInsteadOfUnderIt() {
val hud = show("full", 0f, 300f, padLeft = 120, padRight = 0)
assertEquals(120f, hud.x, 0.5f)
}
@Test fun aHudSnappedRightStopsAtTheRightPadding() {
val hud = show("full", 1990f, 300f, padLeft = 0, padRight = 90)
assertEquals(2000f - 90f, hud.x + hud.width, 0.5f)
}
@Test fun withoutPaddingTheHudStillReachesTheScreenEdges() {
assertEquals(0f, show("full", 0f, 300f, 0, 0).x, 0.5f)
val strip = show("strip", 0f, 0f, 0, 0)
assertEquals(0f, strip.x, 0.5f)
assertEquals(2000, strip.width)
}
@Test fun boundsAnchorBetweenThePaddedEdges() {
val b = HudBounds(120f, 0f, 2000f, 1000f, 400f, 200f)
assertEquals(1600f, b.maxX, 0f)
assertEquals(800f, b.maxY, 0f)
assertEquals(120f, b.anchoredX(0f), 0f)
assertEquals(1600f, b.anchoredX(1f), 0f)
assertEquals(0f, b.anchorFor(0f), 0f)
assertEquals(0f, b.anchorFor(850f), 0f)
assertEquals(1f, b.anchorFor(870f), 0f)
}
@Test fun boundsNeverInvertWhenTheHudIsWiderThanTheArea() {
val b = HudBounds(120f, 50f, 600f, 300f, 900f, 900f)
assertEquals(120f, b.maxX, 0f)
assertEquals(50f, b.maxY, 0f)
}
}
@@ -307,6 +307,51 @@ class OnScreenLayoutTest {
assertEquals(.1f * 2208f / 1768 / .2f, fitted.width * 2208 / (fitted.height * 800), .01f)
}
@Test fun controlsEditedInPortraitKeepTheirPlacesInThePanelBelowTheGame() {
SessionPrefs.setSteamController(context, SessionPrefs.CONTROLLER_NONE)
val (w, h) = 1080 to 2400
val stock = gamepad()
val shown = OnScreenLayout.editorElements(context, stock, w, h)
val moved = shown.map { if (it.id == "legacy:a") it.copy(x = .05f) else if (it.id == "legacy:ls") it.copy(x = .6f) else it }
val edited = OnScreenLayout.withFrame(context, stock, OnScreenLayout.editorFrame(stock, moved), w.toFloat() / h)
val shownA = shown.first { it.id == "legacy:a" }
for (panelHeight in listOf(1100, 800)) {
val placed = OnScreenLayout.elements(context, edited, w, panelHeight, Rect(), dock = OnScreenLayout.Dock(true, false))
val a = placed.first { it.id == "legacy:a" }
val ls = placed.first { it.id == "legacy:ls" }
val b = placed.first { it.id == "legacy:b" }
assertTrue(a.x < .2f)
assertTrue(ls.x > .5f)
assertTrue(b.x > a.x)
assertNull(placed.firstOrNull { it.id == "builtin:keyboard" || it.control == InputControl.GUIDE || it.control == InputControl.QAM })
assertInside(placed, w, panelHeight)
assertEquals(shownA.width * w / (shownA.height * h), a.width * w / (a.height * panelHeight), .01f)
val untouched = OnScreenLayout.elements(context, stock, w, panelHeight, Rect(), dock = OnScreenLayout.Dock(true, false))
assertTrue(untouched.first { it.id == "legacy:a" }.x > .5f)
assertTrue(untouched.first { it.id == "legacy:ls" }.x < .5f)
}
val landscape = OnScreenLayout.elements(context, edited, 2400, 1080, Rect())
assertTrue(landscape.first { it.id == "legacy:a" }.x > .5f)
SessionPrefs.setSteamController(context, SessionPrefs.CONTROLLER_DECK)
val deck = OnScreenLayout.elements(context, edited, w, 1100, Rect(), dock = OnScreenLayout.Dock.deck(true, null), trackpads = true)
assertTrue(deck.none { it.id == "legacy:rs" })
assertTrue(deck.any { it.kind == InputElementKind.TRACKPAD && it.x + it.width / 2f > .5f })
SessionPrefs.setSteamController(context, SessionPrefs.CONTROLLER_NONE)
val tiny = stock.copy(aspect = .45f, elements = stock.elements.map {
when (it.id) {
"legacy:a" -> it.copy(x = .05f, y = .05f, width = .1f, height = .045f)
"legacy:b" -> it.copy(x = .16f, y = .05f, width = .1f, height = .045f)
"legacy:ls" -> it.copy(x = .8f, y = .85f, width = .15f, height = .1f)
else -> it
}
}, rotated = emptyList())
val short = OnScreenLayout.elements(context, tiny, w, 385, Rect(), dock = OnScreenLayout.Dock(true, false))
val sa = short.first { it.id == "legacy:a" }
val sb = short.first { it.id == "legacy:b" }
assertTrue(sa.x + sa.width <= sb.x)
assertEquals(1f, sa.width * w / (sa.height * 385), .01f)
}
@Test fun thePortraitAndBelowGameKitsKeepDirectionalArtClearOfTheSticksAndFaceButtons() {
val directions = setOf(InputControl.UP, InputControl.RIGHT, InputControl.DOWN, InputControl.LEFT)
val face = setOf(InputControl.A, InputControl.B, InputControl.X, InputControl.Y)
@@ -65,10 +65,45 @@ class XboxCatalogTest {
@Test fun libraryDiagnosticsContainCountsWithoutAccountOrProductIdentifiers() {
val lines = mutableListOf<String>()
XboxCatalog.access(envelope(row(game), row(parent, plan)), "test@example.test", "US", now, lines::add)
assertEquals(listOf("library entitlements=2 invalid=0 restricted=0 unverified-plan=1 owned=1 gamepass=0"), lines)
assertEquals(listOf("library entitlements=2 invalid=0 restricted=0 unverified-plan=1 owned=1 gamepass=0 plan-rows=0 unlisted-parent=0"), lines)
assertFalse(lines.single().contains(game) || lines.single().contains(parent) || lines.single().contains("@"))
}
@Test fun libraryDiagnosticsCountActiveRowsWhoseParentIsNotListed() {
val lines = mutableListOf<String>()
val unlisted = "9CCCCCCCCCCC"
val access = XboxCatalog.access(envelope(row(game, unlisted), row(parent, unlisted).put("status", "Expired"), row(plan)),
"test@example.test", "US", now, lines::add)
assertTrue(access.isEmpty())
assertEquals(listOf("library entitlements=3 invalid=0 restricted=1 unverified-plan=0 owned=0 gamepass=0 plan-rows=1 unlisted-parent=1"), lines)
assertFalse(listOf(game, parent, unlisted, plan, "@").any { lines.single().contains(it) })
}
@Test fun catalogDropReasonsNameTheFailingStepWithoutChangingWhatIsListed() {
fun sku(vararg packages: Pair<String, String>, bundle: Boolean = false) = JSONObject().put("Sku", JSONObject().put("Properties",
JSONObject().put("IsBundle", bundle).put("Packages", JSONArray(packages.map { (format, platform) ->
JSONObject().put("PackageFormat", format).put("PlatformDependencies", JSONArray().put(JSONObject().put("PlatformName", platform)))
}))))
fun offer(vararg skus: JSONObject, type: String = "Game", title: String = "A Game") = JSONObject().put("ProductId", game)
.put("ProductType", type).put("LocalizedProperties", JSONArray().put(JSONObject().put("ProductTitle", title)))
.put("DisplaySkuAvailabilities", JSONArray(skus.toList()))
val owned = mapOf(game to "owned")
fun reasons(json: JSONObject, cloud: XboxCloudCatalog? = null) = mutableListOf<String>().also { found ->
XboxCatalog.product(json, owned, cloud) { found.add(it) }
}
assertEquals(listOf("not-game"), reasons(offer(sku("MSIXVC" to "Windows.Desktop"), type = "Durable")))
assertEquals(listOf("no-title"), reasons(offer(sku("MSIXVC" to "Windows.Desktop"), title = "")))
assertEquals(listOf("console-only"), reasons(offer(sku("XVC" to "Windows.Xbox"))))
assertEquals(listOf("pc-format"), reasons(offer(sku("APPX" to "Windows.Desktop"))))
assertEquals(listOf("bundle"), reasons(offer(sku(bundle = true))))
assertEquals(listOf("no-package"), reasons(offer(sku())))
assertEquals(emptyList<String>(), reasons(offer(sku("XVC" to "Windows.Xbox", "MSIXVC" to "Windows.Desktop"))))
assertEquals(emptyList<String>(), reasons(offer(sku("XVC" to "Windows.Xbox")), XboxCloudCatalog(emptySet(), setOf(game))))
assertNull(XboxCatalog.product(offer(sku("XVC" to "Windows.Xbox")), owned))
assertNull(XboxCatalog.product(offer(sku(bundle = true)), owned))
assertTrue(XboxCatalog.product(offer(sku("XVC" to "Windows.Xbox", "MSIXVC" to "Windows.Desktop")), owned)!!.xboxPc)
}
@Test fun purchasedAndSubscriptionAccessRemainDistinct() {
assertEquals(mapOf(game to "owned", parent to "gamepass"), access(row(game), row(parent, plan), row(plan)))
assertFalse(access(row(plan)).containsKey(plan))
@@ -258,6 +258,18 @@ class InputSettingsTest {
compose.onNodeWithTag("input-layout-canvas").assertExists()
}
@Test fun everyScreenOpensWithItsEditorFirst() {
compose.setContent { DroidDeckTheme { InputSettingsPage({}) } }
compose.onNodeWithTag("input-profile-game").performScrollTo().performClick()
val tops = listOf("primary", "secondary").map { screen ->
compose.onNodeWithTag("input-part-$screen").performScrollTo().performClick()
val top = compose.onNodeWithTag("input-surface-$screen").assertIsDisplayed().fetchSemanticsNode().boundsInRoot.top
compose.onNodeWithText(context.getString(R.string.mode_back)).performClick()
top
}
assertEquals(tops[1], tops[0])
}
@Test fun deviceSettingsAreInlineBelowProfiles() {
compose.setContent { DroidDeckTheme { InputSettingsPage({}) } }
compose.onNodeWithTag("input-more").assertDoesNotExist()
+6
View File
@@ -293,6 +293,12 @@ configuration falls back to the inherited environment without evaluating its
contents. Both component and environment selection normalize signed non-Steam
prefix IDs to unsigned IDs.
A Dragon's Dogma 2 launch (Steam app 2054970) appends the game's own
`/WineDetectionEnabled:False` switch: the game checks for Wine and its Wine path
does not start. The switch is added only at launch, never to Steam's stored
Launch Options, and a user's own `/WineDetectionEnabled:` value in Launch
Options keeps priority and is not repeated.
The published file also carries generated `dxvkConfig` and `dxvkConfigGames`
values the app's own file never has. The session menu's texture filtering
(`core/TextureFiltering`) becomes `d3d9/d3d11.samplerAnisotropy` and
+1
View File
@@ -44,6 +44,7 @@ Links of the form `droiddeck://settings/<section>` open a Settings section direc
| Launcher orientation | Settings › Launcher (`droiddeck://settings/launcher`) | rotate, portrait |
| Session orientation | Settings › Launcher (`droiddeck://settings/launcher`) | rotate, portrait |
| Fullscreen | Settings › Launcher (`droiddeck://settings/launcher`) | |
| Swipe between pages | Settings › Launcher (`droiddeck://settings/launcher`) | gesture |
| Controller haptics | Settings › Launcher (`droiddeck://settings/launcher`) | vibration, rumble |
| Dual screen launcher | Settings › Launcher (`droiddeck://settings/launcher`) | thor, second screen, bottom screen |
| Warn when storage is low | Settings › Launcher (`droiddeck://settings/launcher`) | |
@@ -152,6 +152,12 @@ def deep_rock_gdk_raytracing(game):
return {}, ["-noraytracing", "-ini:Engine:[/Script/Engine.RendererSettings]:r.RayTracing=False"], "Deep Rock Galactic GDK: ray tracing off (D3D12 pipeline creation fails on Thor)"
@fix
def dragons_dogma_2_wine_detection(game):
if game.app_id == "2054970" and not any(a.lower().startswith("/winedetectionenabled:") for a in game.args):
return {}, ["/WineDetectionEnabled:False"], "Dragon's Dogma 2: the game's Wine detection off (its Wine path does not start)"
@fix
def ff7_rebirth_feature_level(game):
if game.stem in ("ff7rebirth", "ff7rebirth_"):
+65
View File
@@ -582,6 +582,16 @@ const char *udev_device_get_action(void *device) {
return real_get(device);
}
const char *udev_device_get_driver(void *device) {
static const char *(*real_get)(void *);
struct pad *pad = device_pad(device);
if (pad != NULL) return NULL;
if (real_get == NULL) real_get = next_symbol("udev_device_get_driver");
if (real_get == NULL) return NULL;
return real_get(device);
}
dev_t udev_device_get_devnum(void *device) {
static dev_t (*real_get)(void *);
struct pad *pad = device_pad(device);
@@ -686,6 +696,54 @@ void *udev_device_get_sysattr_list_entry(void *device) {
return real_get != NULL ? real_get(device) : NULL;
}
void *udev_device_get_current_tags_list_entry(void *device) {
static void *(*real_get)(void *);
if (device_pad(device) != NULL) return NULL;
if (real_get == NULL) real_get = next_symbol("udev_device_get_current_tags_list_entry");
return real_get != NULL ? real_get(device) : NULL;
}
int udev_device_has_current_tag(void *device, const char *tag) {
static int (*real_has)(void *, const char *);
if (device_pad(device) != NULL) return 0;
if (real_has == NULL) real_has = next_symbol("udev_device_has_current_tag");
return real_has != NULL ? real_has(device, tag) : 0;
}
void *udev_device_get_devlinks_list_entry(void *device) {
static void *(*real_get)(void *);
if (device_pad(device) != NULL) return NULL;
if (real_get == NULL) real_get = next_symbol("udev_device_get_devlinks_list_entry");
return real_get != NULL ? real_get(device) : NULL;
}
unsigned long long udev_device_get_seqnum(void *device) {
static unsigned long long (*real_get)(void *);
if (device_pad(device) != NULL) return 0;
if (real_get == NULL) real_get = next_symbol("udev_device_get_seqnum");
return real_get != NULL ? real_get(device) : 0;
}
unsigned long long udev_device_get_usec_since_initialized(void *device) {
static unsigned long long (*real_get)(void *);
if (device_pad(device) != NULL) return 0;
if (real_get == NULL) real_get = next_symbol("udev_device_get_usec_since_initialized");
return real_get != NULL ? real_get(device) : 0;
}
int udev_device_set_sysattr_value(void *device, const char *sysattr, const char *value) {
static int (*real_set)(void *, const char *, const char *);
if (device_pad(device) != NULL) return -EACCES;
if (real_set == NULL) real_set = next_symbol("udev_device_set_sysattr_value");
return real_set != NULL ? real_set(device, sysattr, value) : -ENOSYS;
}
void *udev_device_new_from_devnum(void *udev, char type, dev_t devnum) {
static void *(*real_new)(void *, char, dev_t);
struct pad pad;
@@ -1011,6 +1069,7 @@ static const struct udev_symbol udev_symbols[] = {
{"udev_device_get_subsystem", (void *)udev_device_get_subsystem},
{"udev_device_get_devtype", (void *)udev_device_get_devtype},
{"udev_device_get_action", (void *)udev_device_get_action},
{"udev_device_get_driver", (void *)udev_device_get_driver},
{"udev_device_get_devnum", (void *)udev_device_get_devnum},
{"udev_device_get_sysattr_value", (void *)udev_device_get_sysattr_value},
{"udev_device_get_property_value", (void *)udev_device_get_property_value},
@@ -1023,6 +1082,12 @@ static const struct udev_symbol udev_symbols[] = {
{"udev_device_get_properties_list_entry", (void *)udev_device_get_properties_list_entry},
{"udev_device_get_tags_list_entry", (void *)udev_device_get_tags_list_entry},
{"udev_device_get_sysattr_list_entry", (void *)udev_device_get_sysattr_list_entry},
{"udev_device_get_current_tags_list_entry", (void *)udev_device_get_current_tags_list_entry},
{"udev_device_has_current_tag", (void *)udev_device_has_current_tag},
{"udev_device_get_devlinks_list_entry", (void *)udev_device_get_devlinks_list_entry},
{"udev_device_get_seqnum", (void *)udev_device_get_seqnum},
{"udev_device_get_usec_since_initialized", (void *)udev_device_get_usec_since_initialized},
{"udev_device_set_sysattr_value", (void *)udev_device_set_sysattr_value},
{"udev_enumerate_new", (void *)udev_enumerate_new},
{"udev_enumerate_ref", (void *)udev_enumerate_ref},
{"udev_enumerate_unref", (void *)udev_enumerate_unref},
+12
View File
@@ -1536,6 +1536,18 @@ class GameEnvironmentTest(unittest.TestCase):
self.assertEqual(MODULE["engine_fixes"]("/game/FSD-Win64-Shipping.exe", []), ({}, [], []))
self.assertEqual(MODULE["engine_fixes"]("/game/Other-WinGDK-Shipping.exe", []), ({}, [], []))
def test_dragons_dogma_2_turns_its_wine_detection_off_unless_the_user_sets_it(self):
game = "/game/Dragons Dogma 2/DD2.exe"
env, extra, notes = MODULE["engine_fixes"](game, [], "2054970")
self.assertEqual(extra, ["/WineDetectionEnabled:False"])
self.assertEqual(env, {})
self.assertTrue(notes)
self.assertEqual(MODULE["engine_fixes"](game, ["-dx12"], "2054970")[1], ["/WineDetectionEnabled:False"])
for own in ("/WineDetectionEnabled:False", "/WineDetectionEnabled:True", "/winedetectionenabled:false"):
self.assertEqual(MODULE["engine_fixes"](game, [own], "2054970"), ({}, [], []))
self.assertEqual(MODULE["engine_fixes"](game, [], "42"), ({}, [], []))
self.assertEqual(MODULE["engine_fixes"](game, []), ({}, [], []))
def test_arkham_city_gets_full_x87_precision_over_the_preset(self):
with tempfile.TemporaryDirectory() as tmp:
city = Path(tmp) / "Batman Arkham City GOTY/Binaries/Win32"
+72 -8
View File
@@ -1,5 +1,6 @@
from pathlib import Path
import os
import re
import shutil
import subprocess
import sys
@@ -181,20 +182,48 @@ void *udev_device_new_from_subsystem_sysname(void *udev, const char *subsystem,
(void)udev; (void)subsystem; (void)sysname;
return NULL;
}
void *udev_device_unref(void *device) { (void)device; return NULL; }
void *udev_device_ref(void *device) { (void)device; return NULL; }
void *udev_device_get_parent(void *device) { (void)device; return NULL; }
void *udev_device_get_udev(void *device) { (void)device; return NULL; }
const char *udev_device_get_syspath(void *device) { (void)device; return "real"; }
const char *udev_device_get_sysnum(void *device) { (void)device; return "real"; }
int real_device_calls;
void *udev_device_unref(void *device) { (void)device; real_device_calls++; return NULL; }
void *udev_device_ref(void *device) { (void)device; real_device_calls++; return NULL; }
void *udev_device_get_parent(void *device) { (void)device; real_device_calls++; return NULL; }
void *udev_device_get_udev(void *device) { (void)device; real_device_calls++; return NULL; }
const char *udev_device_get_syspath(void *device) { (void)device; real_device_calls++; return "real"; }
const char *udev_device_get_sysnum(void *device) { (void)device; real_device_calls++; return "real"; }
void *udev_device_new_from_devnum(void *udev, char type, unsigned long devnum) {
(void)udev; (void)type; (void)devnum;
return NULL;
}
"""
DEVICE_FUNCTIONS = (
"p:udev_device_ref", "p:udev_device_get_udev", "p:udev_device_get_parent",
"P:udev_device_get_parent_with_subsystem_devtype", "s:udev_device_get_devpath", "s:udev_device_get_subsystem",
"s:udev_device_get_devtype", "s:udev_device_get_syspath", "s:udev_device_get_sysname",
"s:udev_device_get_sysnum", "s:udev_device_get_devnode", "i:udev_device_get_is_initialized",
"p:udev_device_get_devlinks_list_entry", "p:udev_device_get_properties_list_entry",
"p:udev_device_get_tags_list_entry", "p:udev_device_get_current_tags_list_entry",
"p:udev_device_get_sysattr_list_entry", "S:udev_device_get_property_value", "s:udev_device_get_driver",
"d:udev_device_get_devnum", "s:udev_device_get_action", "u:udev_device_get_seqnum",
"u:udev_device_get_usec_since_initialized", "S:udev_device_get_sysattr_value",
"W:udev_device_set_sysattr_value", "I:udev_device_has_tag", "I:udev_device_has_current_tag",
"p:udev_device_unref",
)
SIGNATURES = {
"p": ("void *", ""), "s": ("const char *", ""), "i": ("int", ""), "d": ("dev_t", ""),
"u": ("unsigned long long", ""), "S": ("const char *", ", const char *a"), "I": ("int", ", const char *a"),
"P": ("void *", ", const char *a, const char *b"), "W": ("int", ", const char *a, const char *b"),
}
UDEV += "#include <sys/types.h>\n" + "".join(
f"{SIGNATURES[kind][0]} {name}(void *device{SIGNATURES[kind][1]}) {{ (void)device; real_device_calls++; return 0; }}\n"
for kind, _, name in (entry.partition(":") for entry in DEVICE_FUNCTIONS) if not re.search(rf"\b{name}\(", UDEV))
PROGRAM = r"""
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/sysmacros.h>
#include <unistd.h>
#define PAD "/sys/devices/virtual/input/droiddeck0"
@@ -400,6 +429,37 @@ static void run_enumerate(void) {
printf("nothing added scan %d\n", scan(other));
}
static void run_every(int count, char **entries) {
void *(*from_devnum)(void *, char, dev_t) = sym("udev_device_new_from_devnum");
int *real_calls = dlsym(lib, "real_device_calls");
int udev;
void *pad = from_devnum(&udev, 'c', makedev(13, 64));
int i;
for (i = 0; pad != NULL && i < count; i++) {
const char *name = entries[i] + 2;
void *call = sym(name);
if (call == NULL) {
printf("missing %s\n", name);
continue;
}
switch (entries[i][0]) {
case 'p': ((void *(*)(void *))call)(pad); break;
case 's': ((const char *(*)(void *))call)(pad); break;
case 'i': ((int (*)(void *))call)(pad); break;
case 'd': ((dev_t (*)(void *))call)(pad); break;
case 'u': ((unsigned long long (*)(void *))call)(pad); break;
case 'S': ((const char *(*)(void *, const char *))call)(pad, "attr"); break;
case 'I': ((int (*)(void *, const char *))call)(pad, "attr"); break;
case 'P': ((void *(*)(void *, const char *, const char *))call)(pad, "input", NULL); break;
case 'W': ((int (*)(void *, const char *, const char *))call)(pad, "attr", "value"); break;
default: printf("unknown signature %s\n", entries[i]);
}
}
printf("pad %d real calls %d\n", pad != NULL, real_calls != NULL ? *real_calls : -1);
}
static void run_probe(void) {
int udev;
@@ -447,6 +507,7 @@ int main(int argc, char **argv) {
name = sym("udev_list_entry_get_name");
value = sym("udev_list_entry_get_value");
if (strcmp(argv[1], "probe") == 0) run_probe();
else if (strcmp(argv[1], "every") == 0) run_every(argc - 3, argv + 3);
else if (strcmp(argv[1], "stable") == 0) run_stable();
else if (strcmp(argv[1], "enumerate") == 0) run_enumerate();
else run_udev();
@@ -502,11 +563,11 @@ class InputUdevPreloadTest(unittest.TestCase):
(pads / node).write_text("")
return pads
def run_program(self, mode, *preloads, pads=None, slots="0=/pad", program=None):
def run_program(self, mode, *preloads, pads=None, slots="0=/pad", program=None, args=()):
env = dict(os.environ, LD_PRELOAD=":".join(str(self.dir / name) for name in ("libddsession.so", *preloads)),
FAKE_EVDEV_MEMFD_PATHS=slots, FAKE_EVDEV_DIR=str(pads or self.pads))
env.pop("FAKE_EVDEV_UINPUT", None)
result = subprocess.run([str(program or self.program), mode, str(self.udev)], env=env, capture_output=True, text=True,
result = subprocess.run([str(program or self.program), mode, str(self.udev), *args], env=env, capture_output=True, text=True,
timeout=20)
self.assertEqual(result.returncode, 0, result.stderr)
return result.stdout.splitlines()
@@ -554,6 +615,9 @@ class InputUdevPreloadTest(unittest.TestCase):
"contexts 1 1",
])
def test_no_device_call_on_a_pad_reaches_the_real_libudev(self):
self.assertEqual(self.run_program("every", args=DEVICE_FUNCTIONS), ["pad 1 real calls 0"])
def test_a_handle_keeps_its_strings_after_the_pad_goes_away(self):
self.assertEqual(self.run_program("stable", pads=self.pad_dir("stable", "event0")), [
"gone 1",