set EMOTION_ENGINE to tyls (and ethumb etc.) can use it inside shell

this should fix T291
This commit is contained in:
Carsten Haitzler 2014-01-22 20:31:37 +09:00
parent 4891932444
commit 870d592139
3 changed files with 24 additions and 5 deletions

View File

@ -4430,7 +4430,16 @@ termio_add(Evas_Object *parent, Config *config, const char *cmd, Eina_Bool login
Evas *e;
Evas_Object *obj, *g;
Termio *sd;
char *modules[] =
{
NULL,
"gstreamer",
"xine",
"vlc",
"gstreamer1"
};
char *mod = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
e = evas_object_evas_get(parent);
if (!e) return NULL;
@ -4440,6 +4449,10 @@ termio_add(Evas_Object *parent, Config *config, const char *cmd, Eina_Bool login
sd = evas_object_smart_data_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd, obj);
if ((config->vidmod >= 0) &&
(config->vidmod < (int)EINA_C_ARRAY_LENGTH(modules)))
mod = modules[config->vidmod];
termio_config_set(obj, config);
sd->glayer = g = elm_gesture_layer_add(parent);
@ -4470,9 +4483,9 @@ termio_add(Evas_Object *parent, Config *config, const char *cmd, Eina_Bool login
_smart_cb_drag_pos, obj,
_smart_cb_drop, obj);
#endif
sd->pty = termpty_new(cmd, login_shell, cd, w, h, config->scrollback,
config->xterm_256color, config->erase_is_del);
config->xterm_256color, config->erase_is_del, mod);
if (!sd->pty)
{
ERR("Cannot allocate termpty");

View File

@ -272,7 +272,7 @@ _limit_coord(Termpty *ty, Termstate *state)
Termpty *
termpty_new(const char *cmd, Eina_Bool login_shell, const char *cd,
int w, int h, int backscroll, Eina_Bool xterm_256color,
Eina_Bool erase_is_del)
Eina_Bool erase_is_del, const char *emotion_mod)
{
Termpty *ty;
const char *pty;
@ -369,6 +369,7 @@ termpty_new(const char *cmd, Eina_Bool login_shell, const char *cd,
const char *args[4] = {NULL, NULL, NULL, NULL};
Eina_Bool needs_shell;
int i;
char buf[256];
if (cd)
{
@ -443,6 +444,11 @@ termpty_new(const char *cmd, Eina_Bool login_shell, const char *cd,
putenv("TERM=xterm");
}
putenv("XTERM_256_COLORS=1");
if (emotion_mod)
{
snprintf(buf, sizeof(buf), "EMOTION_ENGINE=%s", emotion_mod);
putenv(buf);
}
if (!login_shell)
execvp(args[0], (char *const *)args);
else

View File

@ -208,7 +208,7 @@ void termpty_shutdown(void);
Termpty *termpty_new(const char *cmd, Eina_Bool login_shell, const char *cd,
int w, int h, int backscroll, Eina_Bool xterm_256color,
Eina_Bool erase_is_del);
Eina_Bool erase_is_del, const char *emotion_mod);
void termpty_free(Termpty *ty);
void termpty_cellcomp_freeze(Termpty *ty);
void termpty_cellcomp_thaw(Termpty *ty);