Following this example:
I'm trying to port it to rust. Even though seemingly I use the same api I cannot spawn onboard process:
C call (from the example):
gboolean retval; gchar *cmd = g_strdup("onboard -e -l Phone -t ModelM -s 400x300"); gchar **arg_v = NULL; gint std_out = 0; GError *error = NULL; GIOChannel *std_out_ch; g_shell_parse_argv(cmd, NULL, &arg_v, NULL); gchar *_a = arg_v; retval = g_spawn_async_with_pipes(NULL, arg_v, NULL, static_cast<GSpawnFlags>(G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH), NULL, NULL, &child_pid, NULL, &std_out, NULL, &error);
My attempt in rust:
let working_directory = "/"; let argv: [&Path; 8] = [ Path::new("onboard"), Path::new("-e"), Path::new("-l"), Path::new("Phone"), Path::new("-t"), Path::new("ModelM"), Path::new("-s"), Path::new("400x300"), ]; let envp: [&Path; 1] = [Path::new("")]; let flags = glib::SpawnFlags::DO_NOT_REAP_CHILD | glib::SpawnFlags::SEARCH_PATH; let child_setup = None; let io: Result<(Pid, i32, i32, i32), Error> = glib::spawn_async_with_pipes(working_directory, &argv, &envp, flags, child_setup);
Even though I'm getting OK in the result I don't see on my toolbar that the indicator of onboard being spawned.
I'm not sure if I pass all the params correctly, for example, in C the first param is NULL, I don't think I can do it with rust in that specific call.
Any help greatly appreciated.