This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch tymux-10-quiet-head
in repository terminology.

View the commit online.

commit 535ab2616a385fb941c200d918400d12004b3e71
Author: [email protected] <[email protected]>
AuthorDate: Fri Sep 25 10:28:08 2026 -0600

    termtymux: dim a terminal while its session is taken over
    
    When another client hijacks the session, the input of the terminal
    that had it is dropped until the session comes back to it, and nothing
    showed it. The core theme group gets a terminology.pause part over the
    text grid, faded in on pause,on and out on pause,off, which never takes
    mouse events. termio emits those signals when the client is paused or
    resumed, and applies the state again after a theme reload, which
    replaces the edje object.
    
    The theme has no text of its own, so this is a dim rather than a label.
    The man page now tells it apart from the PAUSED banner of the inline
    proxy.
---
 data/themes/default/core.edc | 32 ++++++++++++++++++++++++++++++++
 man/tymux.1                  |  6 ++++--
 src/bin/termio.c             | 28 ++++++++++++++++++++++++++++
 src/bin/termio.h             |  5 +++++
 src/bin/termtymux.c          | 14 ++++++++++++--
 src/bin/termtymux.h          |  9 +++++++++
 src/bin/win.c                | 19 +++++++++++++++++++
 src/bin/win.h                |  4 ++++
 8 files changed, 113 insertions(+), 4 deletions(-)

diff --git a/data/themes/default/core.edc b/data/themes/default/core.edc
index 46efc049..6d0dd179 100644
--- a/data/themes/default/core.edc
+++ b/data/themes/default/core.edc
@@ -104,5 +104,37 @@ group { name: "terminology/core";
             offscale;
          }
       }
+      ////////////////////////////////////////////////////////////////////
+      // dims the terminal while a tymux session running in it has been
+      // hijacked by another client (see termtymux.c's TSRV_MSG_PAUSE);
+      // mouse_events: 0 so it never steals clicks/selection from the
+      // content below it, and no text: this theme has no precedent for
+      // UI text drawn over the terminal content itself (unlike tab
+      // labels or popmedia, which are separate chrome), so an icon-less
+      // dim is the minimal, in-style way to say "not live".
+      part { name: "terminology.pause"; type: RECT;
+         mouse_events: 0;
+         description { state: "default" 0.0;
+            rel1.to: "terminology.content";
+            rel2.to: "terminology.content";
+            color: 0 0 0 0;
+         }
+         description { state: "visible" 0.0;
+            inherit: "default" 0.0;
+            color: 0 0 0 110;
+         }
+      }
+      program {
+         signal: "pause,on"; source: "terminology";
+         action: STATE_SET "visible" 0.0;
+         target: "terminology.pause";
+         transition: LINEAR 0.15;
+      }
+      program {
+         signal: "pause,off"; source: "terminology";
+         action: STATE_SET "default" 0.0;
+         target: "terminology.pause";
+         transition: LINEAR 0.15;
+      }
    }
 }
diff --git a/man/tymux.1 b/man/tymux.1
index 836e5716..69de0936 100644
--- a/man/tymux.1
+++ b/man/tymux.1
@@ -27,9 +27,11 @@ untouched: any terminal can attach to it again later.
 .PP
 Several terminals can be attached at the same time.
 By default, the last one to attach takes over: the terminal previously in
-control shows
+control shows it is paused until the new one detaches \(en the inline proxy
+prints
 .B PAUSED
-until the new one detaches.
+where the shell's screen was, and a terminal that took the session over
+natively (see \fBNATIVE HAND\-OFF\fP) dims it instead.
 .PP
 The size of the terminal in control is the size of the shell's screen.
 .PP
diff --git a/src/bin/termio.c b/src/bin/termio.c
index ae1c9b78..82188d52 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -4261,9 +4261,32 @@ _handle_query_esc(Termio *sd)
      }
 }
 
+Eina_Bool
+termio_tymux_paused_get(const Evas_Object *obj)
+{
+#ifdef HAVE_TYMUX
+   Termio *sd = evas_object_smart_data_get(obj);
+
+   if (!sd) return EINA_FALSE;
+   return termtymux_paused_get(sd->tymux);
+#else
+   (void)obj;
+   return EINA_FALSE;
+#endif
+}
+
 #ifdef HAVE_TYMUX
 static void _smart_pty_command(void *data);
 
+/* Fired by termtymux.c whenever another client hijacks or releases the
+ * session: shows or clears the pause overlay on the terminal's core edje
+ * object (see term_tymux_pause_apply(), win.c). data is the termio obj. */
+static void
+_termio_tymux_pause(void *data, Eina_Bool paused EINA_UNUSED)
+{
+   term_tymux_pause_apply(data);
+}
+
 /* Deferred tymux hand-off, run on the next main loop iteration so we are
  * not still inside the read handler of the pty we are about to free
  * (_handle_read -> termpty_handle_buf -> _handle_esc -> _smart_pty_command).
@@ -4334,6 +4357,8 @@ _termio_tymux_switch_job(void *data)
    sd->pty->cb.bell.data = ""
    sd->pty->cb.command.func = _smart_pty_command;
    sd->pty->cb.command.data = ""
+   sd->tymux->cb_pause.func = _termio_tymux_pause;
+   sd->tymux->cb_pause.data = ""
 
    /* The old pty's view-layer state (link hover, selection, scroll
     * position) does not belong to the new one. termio_remove_links() is
@@ -4354,6 +4379,7 @@ _termio_tymux_switch_job(void *data)
    sd->scroll = 0;
 
    termtymux_resize(tymux, sd->grid.w, sd->grid.h);
+   term_tymux_pause_apply(obj);
    _smart_apply(obj);
 }
 
@@ -4946,6 +4972,8 @@ termio_add(Evas_Object *win, Config *config,
              evas_object_del(obj);
              return NULL;
           }
+        sd->tymux->cb_pause.func = _termio_tymux_pause;
+        sd->tymux->cb_pause.data = ""
      }
    else
 #endif
diff --git a/src/bin/termio.h b/src/bin/termio.h
index 331d5e0a..31261027 100644
--- a/src/bin/termio.h
+++ b/src/bin/termio.h
@@ -16,6 +16,11 @@
 Evas_Object *termio_add(Evas_Object *parent, Config *config, const char *cmd,
                         Eina_Bool login_shell, const char *cd, int w, int h,
                         Term *term, const char *title, const char *tymux_name);
+/* Whether obj's pty is a tymux shadow pty currently hijacked by another
+ * client. Always EINA_FALSE for a normal terminal or when built without
+ * HAVE_TYMUX. */
+Eina_Bool termio_tymux_paused_get(const Evas_Object *obj);
+
 Termio *termio_get_from_obj(Evas_Object *obj);
 void         termio_win_set(Evas_Object *obj, Evas_Object *win);
 void         termio_theme_set(Evas_Object *obj, Evas_Object *theme);
diff --git a/src/bin/termtymux.c b/src/bin/termtymux.c
index c908fcc1..36745108 100644
--- a/src/bin/termtymux.c
+++ b/src/bin/termtymux.c
@@ -223,8 +223,9 @@ _write_hook(void *data, Termpty *ty EINA_UNUSED, const char *input, int len)
    TermTymux *ts = data;
 
    /* Another client hijacked the session: drop input instead of queueing
-    * it, as tymux.c does while paused; the frames the daemon still sends
-    * keep being shown. */
+    * it, as tymux.c does while paused. termio shows the pause overlay
+    * (cb_pause, wired in termio.c), the frames the daemon still sends
+    * keep being shown underneath it. */
    if (ts->paused) return EINA_TRUE;
 
    termtymux_input_chunks_send(input, len, _write_chunk_send, ts);
@@ -288,9 +289,11 @@ _msg_handle(TermTymux *ts, int type, void *payload, uint32_t size)
         return EINA_TRUE;
       case TSRV_MSG_PAUSE:
         ts->paused = EINA_TRUE;
+        if (ts->cb_pause.func) ts->cb_pause.func(ts->cb_pause.data, EINA_TRUE);
         break;
       case TSRV_MSG_RESUME:
         ts->paused = EINA_FALSE;
+        if (ts->cb_pause.func) ts->cb_pause.func(ts->cb_pause.data, EINA_FALSE);
         break;
       default:
         break;
@@ -487,6 +490,13 @@ termtymux_shell_pid_get(const TermTymux *ts)
    return ts->shell_pid;
 }
 
+Eina_Bool
+termtymux_paused_get(const TermTymux *ts)
+{
+   if (!ts) return EINA_FALSE;
+   return ts->paused;
+}
+
 /* arg is everything after "at" in ty->cur_cmd, which is also where the
  * pre-existing 'at[on/true/yes/off/false/no]' temporary-alpha command
  * (win.c _cb_command(), values "on"/"true"/"yes"/"off"/"false"/"no")
diff --git a/src/bin/termtymux.h b/src/bin/termtymux.h
index a8c9e73b..de41f764 100644
--- a/src/bin/termtymux.h
+++ b/src/bin/termtymux.h
@@ -28,6 +28,11 @@ struct _TermTymux
    size_t            frame_cells_cap; /* cells frame_cells holds */
    pid_t             shell_pid;   /* daemon-side shell pid, -1 if unknown */
    Eina_Bool         paused;      /* another client hijacked the session */
+   struct
+     {
+        void (*func) (void *data, Eina_Bool paused);
+        void *data;
+     } cb_pause;                  /* fires whenever ->paused changes */
 };
 
 /* Resize ty's screen buffers to frame->cols x frame->rows if they differ,
@@ -84,6 +89,10 @@ void termtymux_resize(TermTymux *ts, int cols, int rows);
  * The shadow pty's own ty->pid is always -1: it has no local process. */
 pid_t termtymux_shell_pid_get(const TermTymux *ts);
 
+/* Whether another client currently holds the session (TSRV_MSG_PAUSE was
+ * received and no TSRV_MSG_RESUME followed yet). EINA_FALSE for ts == NULL. */
+Eina_Bool termtymux_paused_get(const TermTymux *ts);
+
 /* Parses the argument of Terminology's private native hand-off escape,
  * "\033}at<variant>;NAME\0", where arg points right after "at":
  *   ";NAME"   -> TSRV_ATTACH_HIJACK
diff --git a/src/bin/win.c b/src/bin/win.c
index 7560e4c3..0af90a94 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -7578,6 +7578,24 @@ _cb_tab_next(void *data,
 }
 
 
+/* Shows or clears the "pause,on"/"pause,off" overlay on termio's
+ * terminology/core edje object (data/themes/default/core.edc) to match
+ * whether its tymux session is currently hijacked by another client.
+ * Called from termio.c's pause/resume callback and from _term_bg_config()
+ * so the overlay survives a theme or config reload, which replaces
+ * term->core's edje object and so loses any signal state it held. */
+void
+term_tymux_pause_apply(Evas_Object *termio)
+{
+   Term *term = evas_object_data_get(termio, "term");
+
+   if (!term || !term->core) return;
+   if (termio_tymux_paused_get(termio))
+     elm_layout_signal_emit(term->core, "pause,on", "terminology");
+   else
+     elm_layout_signal_emit(term->core, "pause,off", "terminology");
+}
+
 static void
 _term_bg_config(Term *term)
 {
@@ -7656,6 +7674,7 @@ _term_bg_config(Term *term)
              break;
           }
      }
+   term_tymux_pause_apply(term->termio);
 
    DBG("is focused? tc:%p", term->container);
    if (term_is_focused(term) && (_win_is_focused(term->wn)))
diff --git a/src/bin/win.h b/src/bin/win.h
index 0754e6e3..b4e90a73 100644
--- a/src/bin/win.h
+++ b/src/bin/win.h
@@ -19,6 +19,10 @@ Eina_Bool term_selection_read_ask(Term *term);
 void term_miniview_hide(Term *term);
 Eina_Bool term_tab_go(Term *term, int tnum);
 
+/* Shows or clears the tymux pause overlay on termio's terminal core edje
+ * object according to termio_tymux_paused_get(termio); see win.c. */
+void term_tymux_pause_apply(Evas_Object *termio);
+
 void split_horizontally(Evas_Object *term, const char *cmd);
 void split_vertically(Evas_Object *term, const char *cmd);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to