-
Notifications
You must be signed in to change notification settings - Fork 184
Added Flatpak runtime detection #1301
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
base: main
Are you sure you want to change the base?
Conversation
Sorry for the confusion, i'm reopening the PR soon |
No worries, it has to be reviewed anyway. |
Feel free to just force push and clean the commit. |
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.
Code looks good to me except for the part that I pointed out. Needs Steam Deck testing from someone to confirm it. Will deploy some builds to test.
FYI the CI is broken and doesn't actually pull changes from branches outside the repository, so the CI build will be based on the |
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.
Why does UR need to know if it's running under Flatpak? If you need to look for specific files, you should be looking inside of the folders you own under the XDG base directory spec.
Why do we need a filesystem check? What was wrong with the environment variable approach? |
I don't think there's any difference, but if libportal uses this approach it's good to do the same imo. |
Co-authored-by: Skyth (Asilkan) <[email protected]>
This approach is not reliable if a Flatpak application launches a native binary. |
Checking it out, most of these Flatpak specific codes can be thrown away if Unleashed Recomp is compliant with XDG Base Directory Specification. These env vars are used to figure out which directories are to be used for user data, if the env vars are not set or is empty, the fallback directories are used.
This is relevant to Flatpak because flatpak sets the following env vars automatically:
but it seems currently Where it should attempt to use EDIT: This is related #679 |
This PR removes flatpak-specific preprocessor macros, leaving the game to figure out at runtime whether it's running under a flatpak environment or not.
To be more specific, this relies on checking the
FLATPAK_ID
environment variable, which is always set for sandboxed environments as described in the official documentationFor Unleashed Recompiled,
FLATPAK_ID
is set toio.github.hedge_dev.unleashedrecomp
. This can be checked by entering the sandboxed environment and checking directly:For Windows builds, the present PR bears no effect.