[gnome-games] command: Use 'flatpak-spawn --host' to run games in Flatpak



commit 3c4bd37f117af0390f58409d961cba7767682676
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Thu Aug 16 13:54:31 2018 +0500

    command: Use 'flatpak-spawn --host' to run games in Flatpak
    
    This allows running desktop and Steam games from Flatpak-ed Games.

 src/command/command-runner.vala | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/command/command-runner.vala b/src/command/command-runner.vala
index 2321e0b1..2c1b2426 100644
--- a/src/command/command-runner.vala
+++ b/src/command/command-runner.vala
@@ -47,9 +47,15 @@ public class Games.CommandRunner : Object, Runner {
                SpawnChildSetupFunc? child_setup = null;
                Pid pid;
 
+               string[] command = {};
+               if (Application.is_running_in_flatpak ())
+                       command = { "flatpak-spawn", "--host" };
+               foreach (var arg in args)
+                       command += arg;
+
                try {
                        var result = Process.spawn_async (
-                               working_directory, args, envp, flags, child_setup, out pid);
+                               working_directory, command, envp, flags, child_setup, out pid);
                        if (!result)
                                throw new CommandError.EXECUTION_FAILED (_("Couldn’t run “%s”: execution 
failed."), args[0]);
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]