Skip to content
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

Add support for flatpak portal #146

Merged
merged 2 commits into from May 24, 2019

Conversation

@gicmo
Copy link
Contributor

commented May 20, 2019

Add support to transparently use the portal when running inside a flatpak. This is necessary because flatpak uses pid namespace isolation (see #73) and therefore process ids need to be translated for the gamemode daemon .

This is a draft PR because it depends on flatpak/xdg-desktop-portal#314

That gives some meaning to the strings and makes it easier to see
what the arguments of sd_bus_call_method mean without checking the
function docs.
Copy link
Contributor

left a comment

lib/client_impl.c:106 should use the correct bus name on the error message. Other than that, really nice simple change on the part of gamemode - glad a solution was found for Flatpak

@gicmo gicmo force-pushed the gicmo:flatpak_portal branch from 8c6d6d2 to e63f6a6 May 20, 2019
@gicmo

This comment has been minimized.

Copy link
Contributor Author

commented May 20, 2019

lib/client_impl.c:106 should use the correct bus name on the error message.

Good point! Fixed.

@gicmo gicmo marked this pull request as ready for review May 20, 2019
@gicmo

This comment has been minimized.

Copy link
Contributor Author

commented May 20, 2019

The portal landed, so I guess this can go in.

When we detect that we are running inside a flatpak, talk to the
flatpak portal D-Bus service instead of the session daemon. This
is necessary because flatpak uses pid namespace isolation (see
man pid_namespaces(7)) and thus the pid needs to be translated
from the flatpak pid namespace to the host namespace. This
translation is happening inside the GameMode xdg-desktop-portal.
@gicmo gicmo force-pushed the gicmo:flatpak_portal branch from e63f6a6 to 837f1e2 May 20, 2019
@aejsmith aejsmith merged commit 6e5e4a1 into FeralInteractive:master May 24, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@aejsmith

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

Merged. Thanks a lot for working on a solution for this!

@gicmo gicmo deleted the gicmo:flatpak_portal branch May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.