billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=10f6dc4737e2afebdbb49db9d1dd792cc0b13380

commit 10f6dc4737e2afebdbb49db9d1dd792cc0b13380
Author: Boris Faure <[email protected]>
Date:   Mon Dec 24 11:10:01 2018 +0100

    termpty: set environment variable WINDOWID. Closes T7484
---
 src/bin/termio.c  | 4 +++-
 src/bin/termpty.c | 7 ++++++-
 src/bin/termpty.h | 2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/bin/termio.c b/src/bin/termio.c
index 36e3679..13278bb 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -6298,6 +6298,7 @@ termio_add(Evas_Object *win, Config *config,
         "gstreamer1"
      };
    char *mod = NULL;
+   Ecore_Window window_id;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(win, NULL);
    e = evas_object_evas_get(win);
@@ -6346,9 +6347,10 @@ termio_add(Evas_Object *win, Config *config,
                        _smart_cb_drag_pos, obj,
                        _smart_cb_drop, obj);
 
+   window_id = elm_win_window_id_get(win);
    sd->pty = termpty_new(cmd, login_shell, cd, w, h, config->scrollback,
                          config->xterm_256color, config->erase_is_del, mod,
-                         title);
+                         title, window_id);
    if (!sd->pty)
      {
         ERR(_("Could not allocate termpty"));
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index befdbf4..cd3d91b 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -477,7 +477,7 @@ 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, const char *emotion_mod,
-            const char *title)
+            const char *title, Ecore_Window window_id)
 {
    Termpty *ty;
    const char *pty;
@@ -719,6 +719,11 @@ termpty_new(const char *cmd, Eina_Bool login_shell, const 
char *cd,
              snprintf(buf, sizeof(buf), "EMOTION_ENGINE=%s", emotion_mod);
              putenv(buf);
           }
+        if (window_id)
+          {
+             snprintf(buf, sizeof(buf), "WINDOWID=%lu", window_id);
+             putenv(buf);
+          }
         if (!login_shell)
           execvp(args[0], (char *const *)args);
         else
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index eb9256a..9fb6c99 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -260,7 +260,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, const char *emotion_mod,
-                      const char *title);
+                      const char *title, Ecore_Window window_id);
 void       termpty_free(Termpty *ty);
 
 void       termpty_backlog_lock(void);

-- 


Reply via email to