Launch Workdir Fix and some detailed improvements - #711
Conversation
Some games (Unity, e.g. MiSide) read language packs relative to the current working directory, so launching from the imagefs root misses them. The working dir is now resolved through the container-aware WineUtils.getNativePath (C: -> the container's drive_c, custom games via hostPathToRootWinePath) instead of the raw host game path, which is not under any Wine drive and makes wine fall back to the Windows directory.
The WinToast shown when the locale manifest is silently ignored is not needed; comment it out while keeping the warning drained.
The first renderDrawerMenu() call in onCreate happens before gestureProfileManager is created, throwing a caught-but-noisy NPE stack trace on every early render. Skip the gesture section when it is null; it populates on the next render once the manager exists.
enterPictureInPictureMode(new Builder().build()) can throw — no aspect ratio on API 26-30, stricter OEM builds, or a non-resumable window. PiP itself needs no runtime permission (the system PiP allowance just makes it return false), so the only crash vector was the unguarded call. Set an explicit aspect ratio and wrap in try/catch so the button can never crash the session.
b0fffb2 to
db23a0f
Compare
|
Thanks for these. The working-directory fix is the valuable part here — passing A few things before this can go in: 1. Please delete the locale-warning code rather than commenting it out. Right now the three 2. The PiP comment describes handling that isn't there. It says the per-app allowance "returns false (not an exception)", but the return value of 3. 4. The working-dir change has no comment at all, and it's the subtlest change in the PR. One line explaining why you convert host → Wine → host (to re-resolve through the container's Could you also post a short screen recording of the launch fix working? Specifically a custom game whose folder resolves correctly, and one where it doesn't, so we can see the new Last thing: this is four unrelated changes in one PR again (launch dir, a revert, a PiP guard, a drawer guard). Please split them next time — the workdir fix is the only one with real risk and it deserves to be reviewable on its own. |
Remove the on-screen locale manifest warning plumbing entirely: the pendingLocaleManifestWarning field, its AtomicReference import, the three .set() call sites, and the 69 strings across 23 locales. The existing ContainerLaunch Log.w lines already cover this, so this is a net deletion.
PiP requires an aspect ratio between 1:2.39 and 2.39:1. On an unusually wide display the raw window ratio could exceed the bound and make setAspectRatio throw, silently disabling PiP via the catch. Clamp the ratio to the valid range and trim the comment to one line about OEM builds throwing.
Explain why the custom-game working dir is converted host -> Wine -> host: re-resolving through the container's dosdevices symlinks lands on the container's own home/xuser-<id> that the guest actually sees, not the generic <imageFs>/home/xuser the 2-arg overload would resolve to.
The custom_game_folder/game_install_path extra can be stale after the game folder is moved or re-mounted (e.g. copied into a shared folder). Only trust it when the directory actually contains the exe being launched; otherwise re-derive the working dir from the resolved WIN exe path, which is always the directory the game really runs from. Elevate the resulting working-dir log to W so it survives the app log export filter for diagnostics.
The custom_game_folder/game_install_path extra can be stale after the game folder is moved or re-mounted (e.g. copied into a shared folder). Only trust it when the directory actually contains the exe being launched; otherwise re-derive the working dir from the resolved WIN exe path, which is always the directory the game really runs from.
|
The video has already been posted on Discord, and the issues described have basically been resolved |
fix(launch): set guest working dir via Wine-mapped host path
chore: remove on-screen locale/codepage manifest warning prompt
fix(pip): guard enterPictureInPictureMode against exceptions
fix: guard renderDrawerMenu against uninitialized gestureProfileManager