Repository navigation
gamescope: hide the splash on the first committed frame, and keep Open container blue (payload 20261024.1) #2238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,7 +11,7 @@ import java.io.File | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /** Versioned gamescope payload (gamescope, XWayland, scaling clients), fetched on the first gamescope launch. */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| object GamescopePayload { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const val VERSION = "20261023.4" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const val VERSION = "20261024.1" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const val ARCHIVE = "gamescope-gamenative-$VERSION.tzst" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private const val STAMP = ".payload.version" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -29,16 +29,39 @@ object GamescopePayload { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val archive = File(filesDir, ARCHIVE) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!archive.isFile || archive.length() == 0L) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| archive.delete() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SteamService.fetchFileWithFallback(ARCHIVE, archive, context, onProgress) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch (e: Exception) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| archive.delete() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw e | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // A payload shipped inside the APK wins over the download: it is the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // build that was exercised with this app, and it needs no network. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Only when the asset is absent does the published archive get | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // fetched. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (copyFromAssets(context, archive)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win Retry the bundled asset after an interrupted copy. If the app stops after 🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onProgress(1.0f) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SteamService.fetchFileWithFallback(ARCHIVE, archive, context, onProgress) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch (e: Exception) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| archive.delete() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw e | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| install(archive, filesDir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /** Whether this APK carries the payload, and if so, copy it out to [dest]. */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private fun copyFromAssets(context: Context, dest: File): Boolean { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val assets = context.assets | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val present = runCatching { assets.open(ARCHIVE).close() }.isSuccess | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!present) return false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return runCatching { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assets.open(ARCHIVE).use { input -> dest.outputStream().use { output -> input.copyTo(output) } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Write the APK asset to a temporary Prompt for AI agents
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .onFailure { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Timber.w(it, "Failed to copy $ARCHIVE from assets") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dest.delete() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .isSuccess | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+53
to
+62
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Prompt for AI agents
Suggested change
Comment on lines
+53
to
+62
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Do not use the download fallback after a bundled asset copy fails. When the asset exists but copying fails, Both the current code and the proposed propagation delete Propagate the copy failure instead of returning Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Synchronized | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| internal fun install(archive: File, filesDir: File): File { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val target = directory(filesDir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ public abstract class WineThemeManager { | |
| public enum Theme {LIGHT, DARK} | ||
| public enum BackgroundType {IMAGE, COLOR} | ||
| public static final String DEFAULT_DESKTOP_THEME = Theme.LIGHT+","+BackgroundType.IMAGE+",#0277bd"; | ||
| public static final String GAME_SESSION_THEME = Theme.DARK+","+BackgroundType.COLOR+",#000000"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Give game-session tooltips contrasting colors.
🤖 Prompt for AI Agents
|
||
|
|
||
| public static class ThemeInfo { | ||
| public final Theme theme; | ||
|
|
@@ -30,33 +31,14 @@ public static class ThemeInfo { | |
| public ThemeInfo(String value) { | ||
| String[] values = value.split(","); | ||
| theme = Theme.valueOf(values[0]); | ||
| if (values.length < 3) { | ||
| backgroundColor = Color.parseColor(values[1]); | ||
| backgroundType = BackgroundType.IMAGE; | ||
| } | ||
| else { | ||
| backgroundType = BackgroundType.valueOf(values[1]); | ||
| backgroundColor = Color.parseColor(values[2]); | ||
| } | ||
| backgroundType = BackgroundType.valueOf(values[1]); | ||
| backgroundColor = Color.parseColor(values[2]); | ||
| } | ||
| } | ||
|
|
||
| // Game sessions get a black desktop: gamescope composites Wine's desktop | ||
| // surface, so the wallpaper would show through before the game's first frame | ||
| // and around its dialogs. The X11 renderers never draw explorer, so it is | ||
| // invisible there either way. | ||
| public static String gameSessionTheme(String value) { | ||
| ThemeInfo info = new ThemeInfo(value); | ||
| return info.theme + "," + BackgroundType.COLOR + ",#000000"; | ||
| } | ||
|
|
||
| public static void apply(Context context, ThemeInfo themeInfo, ScreenInfo screenInfo) { | ||
| apply(context, themeInfo, screenInfo, true); | ||
| } | ||
|
|
||
| // The desktop is named "shell", which makes explorer draw its taskbar and | ||
| // start menu; game sessions turn that off along with the standalone systray. | ||
| public static void apply(Context context, ThemeInfo themeInfo, ScreenInfo screenInfo, boolean enableShell) { | ||
| public static void apply(Context context, ThemeInfo themeInfo, ScreenInfo screenInfo, boolean showDesktop) { | ||
| File rootDir = ImageFs.find(context).getRootDir(); | ||
| File userRegFile = new File(rootDir, ImageFs.WINEPREFIX+"/user.reg"); | ||
| String background = Color.red(themeInfo.backgroundColor)+" "+Color.green(themeInfo.backgroundColor)+" "+Color.blue(themeInfo.backgroundColor); | ||
|
|
@@ -69,14 +51,8 @@ public static void apply(Context context, ThemeInfo themeInfo, ScreenInfo screen | |
| } | ||
| else registryEditor.removeValue("Control Panel\\Desktop", "Wallpaper"); | ||
|
|
||
| if (enableShell) { | ||
| registryEditor.removeValue("Software\\Wine\\Explorer\\Desktops\\shell", "EnableShell"); | ||
| registryEditor.removeValue("Software\\Wine\\Explorer\\Desktops\\shell", "ShowSystray"); | ||
| } | ||
| else { | ||
| registryEditor.setDwordValue("Software\\Wine\\Explorer\\Desktops\\shell", "EnableShell", 0); | ||
| registryEditor.setDwordValue("Software\\Wine\\Explorer\\Desktops\\shell", "ShowSystray", 0); | ||
| } | ||
| registryEditor.setDwordValue("Software\\Wine\\Explorer\\Desktops\\shell", "EnableShell", showDesktop ? 1 : 0); | ||
| registryEditor.setDwordValue("Software\\Wine\\Explorer\\Desktops\\shell", "ShowSystray", showDesktop ? 1 : 0); | ||
|
|
||
| if (themeInfo.theme == Theme.LIGHT) { | ||
| registryEditor.setStringValue("Control Panel\\Colors", "ActiveBorder", "245 245 245"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: The new APK-versus-download selection has no focused tests for asset-present, asset-absent, or copy-failure paths. Add tests through
ensureto preserve the fallback contract.(Based on your team's feedback about testing non-trivial core logic.) [5c93b136-1932-44ec-90e5-884afbab8d54]
Prompt for AI agents