efl-wl: add function for passing ecore-exe flags to launched exes

@feature
This commit is contained in:
Mike Blumenkrantz 2018-02-02 16:59:56 -05:00
parent 32c293bea4
commit 7f0a4154f5
2 changed files with 27 additions and 2 deletions

View File

@ -65,6 +65,19 @@ EAPI Evas_Object *efl_wl_add(Evas *e);
*/
EAPI Ecore_Exe *efl_wl_run(Evas_Object *obj, const char *cmd);
/**
* Run a command in the compositor widget with specified flags.
*
* @note If GL is available, the ELM_ACCEL environment variable will be
* set to "gl" while executing the command.
*
* @param obj The compositor widget
* @param cmd The command to run
* @param flags The flags to use
* @return The Ecore_Exe from the executed process, @c NULL on failure
*/
Ecore_Exe *efl_wl_flags_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags);
/**
* Add a process to the list of allowed clients for the compositor widget
*

View File

@ -5625,7 +5625,7 @@ efl_wl_add(Evas *e)
}
Ecore_Exe *
efl_wl_run(Evas_Object *obj, const char *cmd)
comp_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags)
{
char *env, *disp, *gl = NULL;
Comp *c;
@ -5650,7 +5650,7 @@ efl_wl_run(Evas_Object *obj, const char *cmd)
if (gl) gl = strdup(gl);
setenv("ELM_ACCEL", "gl", 1);
}
exe = ecore_exe_pipe_run(cmd, ECORE_EXE_TERM_WITH_PARENT, c);
exe = ecore_exe_pipe_run(cmd, flags, c);
if (disp) setenv("DISPLAY", disp, 1);
if (env) setenv("WAYLAND_DISPLAY", env, 1);
else unsetenv("WAYLAND_DISPLAY");
@ -5670,6 +5670,18 @@ efl_wl_run(Evas_Object *obj, const char *cmd)
return exe;
}
Ecore_Exe *
efl_wl_run(Evas_Object *obj, const char *cmd)
{
return comp_run(obj, cmd, ECORE_EXE_TERM_WITH_PARENT);
}
Ecore_Exe *
efl_wl_flags_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags)
{
return comp_run(obj, cmd, flags);
}
void
efl_wl_pid_add(Evas_Object *obj, int32_t pid)
{