Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified app/src/main/assets/container_pattern_common.tzst
Binary file not shown.
Binary file modified app/src/main/assets/wnsteam/bionic/steam.exe
Binary file not shown.
7 changes: 4 additions & 3 deletions app/src/main/cpp/wn-steam-launcher/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ int main(int argc, char** argv) {
const char* user = getenv("WN_STEAM_USERNAME");
const char* token = getenv("WN_STEAM_TOKEN");
uint64_t steamId = env_u64("WN_STEAM_STEAMID");
const char* gameExe = (argc > 1) ? argv[1] : NULL;
const char* gameExe = getenv("WN_STEAM_GAME_EXE");
if (!gameExe || !*gameExe) gameExe = (argc > 1) ? argv[1] : NULL;
uint32_t appId = appIdStr ? (uint32_t) strtoul(appIdStr, NULL, 10) : 0;

log_line("[wn-launcher] env appId=%u steamId=%llu user=%s exe=%s",
Expand All @@ -775,8 +776,8 @@ int main(int argc, char** argv) {
} else {
log_line("[wn-launcher] token missing");
}
if (argc <= 1 || !gameExe || !*gameExe) {
log_line("[wn-launcher] no game exe passed on argv[1]");
if (!gameExe || !*gameExe) {
log_line("[wn-launcher] no game exe passed (env WN_STEAM_GAME_EXE or argv[1])");
return 1;
}

Expand Down
26 changes: 22 additions & 4 deletions app/src/main/runtime/display/XServerDisplayActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ public class XServerDisplayActivity extends FixedFontScaleAppCompatActivity {
private final EnvVars envVars = new EnvVars();
// True when the chosen launch exe differs from Steam's configured entry: launcher skips Steam LaunchApp and CreateProcess'es the selected exe directly. Recomputed per launch.
private boolean wnSteamDirectExeOverride = false;
private String wnSteamPlanWGameExe = null;
private boolean firstTimeBoot = false;
private SharedPreferences preferences;
private boolean isMouseDisabled = false;
Expand Down Expand Up @@ -6736,6 +6737,9 @@ private void setupXEnvironment() throws PackageManager.NameNotFoundException {
envVars.put("WN_STEAM_STEAMID", planWSid);
envVars.put("WN_STEAM_TOKEN", planWTok);
envVars.put("WN_STEAM_APPID", String.valueOf(bsAppId));
if (wnSteamPlanWGameExe != null && !wnSteamPlanWGameExe.isEmpty()) {
envVars.put("WN_STEAM_GAME_EXE", wnSteamPlanWGameExe);
}
if (wnSteamDirectExeOverride) {
envVars.put("WN_STEAM_DIRECT_EXE", "1");
Log.i("XServerDisplayActivity",
Expand Down Expand Up @@ -8171,6 +8175,7 @@ private String getWineStartCommand(GuestProgramLauncherComponent launcherCompone
int appId = Integer.parseInt(shortcut.getExtra("app_id"));
// Reset per launch; set below once the launch exe is resolved.
wnSteamDirectExeOverride = false;
wnSteamPlanWGameExe = null;
String steamExtraArgs = appendSteamJoinConnect(
com.winlator.cmod.feature.stores.steam.utils.SteamLaunchOptions
.gameArgs(shortcut.getSettingExtra("execArgs", container.getExecArgs())));
Expand Down Expand Up @@ -8254,8 +8259,14 @@ private String getWineStartCommand(GuestProgramLauncherComponent launcherCompone
.PrefManager.INSTANCE.getWnPlanW();
String wrapperExe = planW
? "steam.exe" : "wn-steam-helper.exe";
args = "\"C:\\Program Files (x86)\\Steam\\" + wrapperExe
+ "\" \"" + steamGameExe + "\"" + steamExtraArgs;
if (planW) {
wnSteamPlanWGameExe = steamGameExe;
args = "\"C:\\Program Files (x86)\\Steam\\" + wrapperExe
+ "\"" + steamExtraArgs;
} else {
args = "\"C:\\Program Files (x86)\\Steam\\" + wrapperExe
+ "\" \"" + steamGameExe + "\"" + steamExtraArgs;
}
Log.d("XServerDisplayActivity",
"Bionic Steam launch via " + wrapperExe
+ " (planW=" + planW + "): " + steamGameExe);
Expand Down Expand Up @@ -8398,8 +8409,15 @@ && new File(storeInstallPath).exists()) {
}
}

if (!args.isEmpty() && !args.startsWith("winhandler.exe") && !args.startsWith("explorer")) {
return "winhandler.exe " + args;
if (!args.isEmpty()
&& !args.startsWith("winhandler.exe")
&& !args.startsWith("winlauncher.exe")
&& !args.startsWith("explorer")) {
String affinityArg =
taskAffinityMask != 0
? "/affinity " + Integer.toHexString(taskAffinityMask & 0xFFFF) + " "
: "";
return "winlauncher.exe " + affinityArg + args;
} else {
return args;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,12 @@ private int execGuestProgram() {
+ "MESA_VK_WSI_DEBUG="
+ envVars.get("MESA_VK_WSI_DEBUG"));

String winhandlerCmd =
wineInfo.isArm64EC()
? winePath + "/wine winhandler.exe"
: imageFs.getBinDir() + "/box64 wine winhandler.exe";
ProcessHelper.exec(winhandlerCmd, envVars.toStringArray(), rootDir, null);

return ProcessHelper.exec(
command,
envVars.toStringArray(),
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/runtime/display/renderer/VulkanRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,16 @@ private void buildAndSubmitFrame() {
if (textureSrc != drawable) {
float invW = 1.0f / Math.max(1, textureSrc.width);
float invH = 1.0f / Math.max(1, textureSrc.height);
int spanW = drawable.hasPresentedSourceSize()
? Short.toUnsignedInt(drawable.getPresentedSourceWidth())
: drawable.width;
int spanH = drawable.hasPresentedSourceSize()
? Short.toUnsignedInt(drawable.getPresentedSourceHeight())
: drawable.height;
buf.putFloat(uvOff, -scanoutX * invW);
buf.putFloat(uvOff + 4, -scanoutY * invH);
buf.putFloat(uvOff + 8, (drawable.width - scanoutX) * invW);
buf.putFloat(uvOff + 12, (drawable.height - scanoutY) * invH);
buf.putFloat(uvOff + 8, (spanW - scanoutX) * invW);
buf.putFloat(uvOff + 12, (spanH - scanoutY) * invH);
} else {
buf.putFloat(uvOff, 0.0f);
buf.putFloat(uvOff + 4, 0.0f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,7 @@ private boolean canDirectScanout(Drawable content, Drawable pixmap, short xOff,
return pixmap.isDirectScanout()
&& texture != null
&& xOff <= 0
&& yOff <= 0
&& pixmap.width + xOff >= content.width
&& pixmap.height + yOff >= content.height;
&& yOff <= 0;
}

private static void copyPresentedRegion(
Expand Down