Move monitor stuff out of control.c into its own file for reuse.

This commit is contained in:
nicm
2026-07-03 22:58:23 +00:00
parent d512a65d4c
commit 8e03310afe
5 changed files with 590 additions and 436 deletions

View File

@@ -47,7 +47,7 @@ static void
cmd_refresh_client_update_subscription(struct client *tc, const char *value)
{
char *copy, *split, *name, *what;
enum control_sub_type subtype;
enum monitor_type subtype;
int subid = -1;
copy = name = xstrdup(value);
@@ -63,15 +63,15 @@ cmd_refresh_client_update_subscription(struct client *tc, const char *value)
*split++ = '\0';
if (strcmp(what, "%*") == 0)
subtype = CONTROL_SUB_ALL_PANES;
subtype = MONITOR_ALL_PANES;
else if (sscanf(what, "%%%d", &subid) == 1 && subid >= 0)
subtype = CONTROL_SUB_PANE;
subtype = MONITOR_PANE;
else if (strcmp(what, "@*") == 0)
subtype = CONTROL_SUB_ALL_WINDOWS;
subtype = MONITOR_ALL_WINDOWS;
else if (sscanf(what, "@%d", &subid) == 1 && subid >= 0)
subtype = CONTROL_SUB_WINDOW;
subtype = MONITOR_WINDOW;
else
subtype = CONTROL_SUB_SESSION;
subtype = MONITOR_SESSION;
control_add_sub(tc, name, subtype, subid, split);
out: