discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=66030a4639cfc07f77782c7a105d39eeed7fb64a

commit 66030a4639cfc07f77782c7a105d39eeed7fb64a
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Tue Feb 13 10:48:14 2018 -0500

    set E_GADGET_ORIENTATION env var when launching sandbox gadgets
---
 src/bin/e_gadget_runner.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/bin/e_gadget_runner.c b/src/bin/e_gadget_runner.c
index 57b3b1697..e1a1c53de 100644
--- a/src/bin/e_gadget_runner.c
+++ b/src/bin/e_gadget_runner.c
@@ -101,6 +101,19 @@ runner_run(Instance *inst)
 
    snprintf(buf, sizeof(buf), "%d", inst->ci->id);
    e_util_env_set("E_GADGET_ID", buf);
+   switch (e_gadget_site_orient_get(e_gadget_site_get(inst->box)))
+     {
+      case E_GADGET_SITE_ORIENT_NONE:
+        e_util_env_set("E_GADGET_ORIENTATION", "None");
+        break;
+      case E_GADGET_SITE_ORIENT_HORIZONTAL:
+        e_util_env_set("E_GADGET_ORIENTATION", "Horizontal");
+        break;
+      case E_GADGET_SITE_ORIENT_VERTICAL:
+        e_util_env_set("E_GADGET_ORIENTATION", "Vertical");
+        break;
+     }
+   e_util_env_set("E_GADGET_ID", buf);
 
    unshare(CLONE_NEWPID);
 
@@ -108,6 +121,7 @@ runner_run(Instance *inst)
 
    setns(ns_fd, CLONE_NEWPID);
 
+   e_util_env_set("E_GADGET_ORIENTATION", NULL);
    e_util_env_set("E_GADGET_ID", NULL);
    e_util_env_set("LD_PRELOAD", preload);
    free(preload);

-- 


Reply via email to