Skip to content

container default - #713

Open
kingokksa wants to merge 7 commits into
WinNative-Emu:mainfrom
kingokksa:feature/container-default
Open

container default#713
kingokksa wants to merge 7 commits into
WinNative-Emu:mainfrom
kingokksa:feature/container-default

Conversation

@kingokksa

Copy link
Copy Markdown
Contributor

feat(containers): show Default badge on the default container card
feat(containers): add 'Set as default' to container overflow menu
i18n(containers): translate container-default strings

New games already use SetupWizardActivity.getPreferredGameContainer(),
backed by default_x86/arm64_container_id prefs — but those were only ever
written by the setup wizard. Add a 'Set as default' item to each container
card's three-dot menu that writes the pref directly (arch from the wine
version). Only the pref is touched, so existing games/shortcuts are
unaffected.
Load default_x86/arm64_container_id into ContainersScreenState and render
a 'Default' pill under the name of whichever container card is the current
default. Refresh after 'Set as default' so the badge moves immediately.
@kingokksa
kingokksa force-pushed the feature/container-default branch from 2a5c1ef to 6a4c8a2 Compare August 30, 2026 02:58
@maxjivi05

Copy link
Copy Markdown
Contributor

Nice feature, and the translations are complete across all 23 locales — thanks for that. I built it and tried it on a device. One real problem:

"Set as default" doesn't do anything for ARM64EC containers. getPreferredGameContainer() only reads default_x86_container_id — I checked every caller (UnifiedActivityLaunch, UnifiedActivityDrawer, ShortcutSettingsComposeDialog, ContainerUtils) and the arm64 pref is never consulted on any new-game path. So setting an ARM64EC container as default writes the pref and shows the badge, and the toast says "ARM64EC container set as default for new games" — but new games still use the x86 default. Either teach getPreferredGameContainer to pick by architecture, or don't offer the menu item on arm64 containers so the toast isn't misleading.

Two containers show the "Default" badge at the same time. On a fresh install the wizard sets both prefs, and isDefault = id == defaultX86 || id == defaultArm64 marks both cards. You get two identical "Default" pills with no way to tell which is which. The toast already distinguishes the architecture — the badge probably should too ("Default (x86-64)" / "Default (ARM64EC)").

Smaller things:

  • getPreferredGameContainer guards with if (preferredId > 0) because 0 means unset (and RETRO_CONTAINER_ID is 0). The badge check doesn't have that guard — worth matching for consistency.
  • runCatching { ... }.getOrDefault(container.getWineVersion().contains("arm64ec", ...)) evaluates the fallback on every call, including when the runCatching succeeds, since Kotlin evaluates the argument eagerly. getOrElse { ... } is probably what you want.
  • ContentsManager(ctx).syncContents() runs on the main thread in the click handler and walks every content directory. It's only there to work out one boolean that the fallback already approximates.

Could you post a screenshot showing what happens after setting an ARM64EC container as default and then launching a new game — specifically which container it actually ends up using? That's the part I'd like confirmed before this merges.

…efault

# Conflicts:
#	app/src/main/res/values-b+es+419/strings.xml
#	app/src/main/res/values-da/strings.xml
#	app/src/main/res/values-de/strings.xml
#	app/src/main/res/values-es/strings.xml
#	app/src/main/res/values-fi/strings.xml
#	app/src/main/res/values-fr/strings.xml
#	app/src/main/res/values-hi/strings.xml
#	app/src/main/res/values-it/strings.xml
#	app/src/main/res/values-ja/strings.xml
#	app/src/main/res/values-ko/strings.xml
#	app/src/main/res/values-no/strings.xml
#	app/src/main/res/values-pl/strings.xml
#	app/src/main/res/values-pt-rBR/strings.xml
#	app/src/main/res/values-pt/strings.xml
#	app/src/main/res/values-ro/strings.xml
#	app/src/main/res/values-ru/strings.xml
#	app/src/main/res/values-sv/strings.xml
#	app/src/main/res/values-th/strings.xml
#	app/src/main/res/values-tr/strings.xml
#	app/src/main/res/values-uk/strings.xml
#	app/src/main/res/values-zh-rTW/strings.xml
@kingokksa

Copy link
Copy Markdown
Contributor Author

I believe the default container for new games simply needs to be the most universal and commonly used setting that the user picks for their specific device. Therefore, I only provide a single default container option, rather than strictly differentiating between ARM64 and x86. If future feature changes require improvements, we can always revisit this design and add per-architecture logic at that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants