summaryrefslogtreecommitdiffstats
path: root/src/server.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-02 15:09:36 +0200
committeruser <user@clank>2026-09-02 15:09:36 +0200
commitcafa48e0a7e1eb48a783bfde6862c5fd82c7aede (patch)
tree8e7874fc9a26a0354154906fd9e6fd30e10fe197 /src/server.c
parentweb: chore (diff)
downloadslosh-cafa48e0a7e1eb48a783bfde6862c5fd82c7aede.tar.gz
slosh-cafa48e0a7e1eb48a783bfde6862c5fd82c7aede.tar.xz
slosh-cafa48e0a7e1eb48a783bfde6862c5fd82c7aede.zip
attach tag: just the count, in theme colours
The +x+y offset goes -- 'N clients' says the thing that matters. The inverse-video chip goes with it: the tag now draws in attach_fg / attach_bg from the theme, defaulting to gray ink on the terminal's own background. Standing information, not an announcement.
Diffstat (limited to 'src/server.c')
-rw-r--r--src/server.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/server.c b/src/server.c
index 472fcdd..387fa7d 100644
--- a/src/server.c
+++ b/src/server.c
@@ -320,20 +320,15 @@ static void stamp_indicator(server_t *s, conn_t *c) {
if (!app_cfg_attach_indicator()) return;
size_t viewers = display_count(s);
if (viewers < 2) return;
- char tag[48];
- if (c->view_x || c->view_y)
- /* The crop's origin in the shared screen: "you are at +col+row of
- * something bigger", which is the disorienting case the tag exists for. */
- snprintf(tag, sizeof tag, " %zu clients +%u+%u ", viewers,
- (unsigned)c->view_x, (unsigned)c->view_y);
- else
- snprintf(tag, sizeof tag, " %zu clients ", viewers);
+ char tag[32];
+ snprintf(tag, sizeof tag, " %zu clients ", viewers);
size_t len = strlen(tag);
if (len >= c->view.cols) return; /* a view too narrow to say it in */
+ color_t fg, bg;
+ app_cfg_attach_colors(&fg, &bg);
uint16_t x0 = (uint16_t)(c->view.cols - len);
for (size_t i = 0; i < len; i++)
- screen_put_utf8(&c->view, (uint16_t)(x0 + i), 0, &tag[i], 1, (color_t){0},
- (color_t){0}, ATTR_DIM | ATTR_INVERSE);
+ screen_put_utf8(&c->view, (uint16_t)(x0 + i), 0, &tag[i], 1, fg, bg, 0);
}
static bool push_frame(server_t *s, conn_t *c) {