-
Notifications
You must be signed in to change notification settings - Fork 299
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
MangoHud doesn't use the freedesktop portal to communicate with the gamemode daemon when running in flatpak #685
Comments
It won't work properly. gamemoded expects clients to send their PIDs, which are different inside flatpak sandbox. E.g. a flatpak app usually has PID 2 inside the sandbox, while on host, as seen by gamemoded, PID 2 will be usually some kernel or systemd process. You shouldn't talk to |
Disclaimer: I am just a tinkerer, and not familiar with the inner workings of MangoHud, Flatpak, or DBus. @gasinvein is correct regarding the permission override workaround above. That said, @lunaneff seems to be correct. As it stands, MangoHud from within a Flatpak is unable to reliably detect if GameMode is enabled or not. Examples:
The latter is likely due to MangoHud detecting MangoApp as the Exe, and not polling Dbus. Edit: FlightlessMango, btw, a big thank you for contributing quality software to the FOSS community! :-) Setup |
mangoapp is not aware of the games pid at this point, so it's not able to do any gamemode, vkbasalt detection or process memory etc. |
@flightlessmango, does It seems the way Getting the (non-sandbox) game PID:
Registering the (non-sandbox) game PID to host gamemoded:
|
afaik mangohud doesn't use the dbus portal at all, we're just checking if the library is loaded in the app |
I see. In that case a D-Bus query would be more of a feature request.
Edit 2: One way that works below. Get the Parent PID of the current process as seen by MangoHud, i.e. "mangoapp" as shown above:
Then
If there is a match, I can see not reason why one could not conclude that GameMode is enabled. |
gamemode uses a freedesktop portal to communicate with the gamemode daemon in order to avoid requiring an additional permission. MangoHud can't use this portal however, and doesn't do anything when the option is enabled
Documentation for the portal is available here: https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.GameMode
This was added to gamemode in FeralInteractive/gamemode#146, maybe it can be used as reference when fixing this?
Workaround until this is fixed:
The text was updated successfully, but these errors were encountered: