Added client flag to enable the new format when in control mode. Added

back the old format which is dispatched to. Also added attributes to the
format.
This commit is contained in:
Dane Jensen
2026-07-12 22:08:24 -07:00
parent 69d9697cd5
commit 568925a757
5 changed files with 301 additions and 71 deletions

View File

@@ -855,26 +855,40 @@ format_cb_window_active_clients_list(struct format_tree *ft)
static void *
format_cb_window_layout(struct format_tree *ft)
{
struct window *w = ft->w;
struct client *c = ft->client;
struct window *w = ft->w;
struct layout_cell *lcroot;
int flags = 0;
if (w == NULL)
if (w == NULL || c == NULL)
return (NULL);
if (w->saved_layout_root != NULL)
return (layout_dump(w, w->saved_layout_root));
return (layout_dump(w, w->layout_root));
lcroot = w->saved_layout_root;
else
lcroot = w->layout_root;
if (c->flags & CLIENT_CONTROL &&
~c->flags & CLIENT_CONTROL_NEWLAYOUTS)
flags |= LAYOUT_CUSTOM_OLD_FORMAT;
return (layout_dump(w, lcroot, flags));
}
/* Callback for window_visible_layout. */
static void *
format_cb_window_visible_layout(struct format_tree *ft)
{
struct client *c = ft->c;
struct window *w = ft->w;
int flags = 0;
if (w == NULL)
if (w == NULL || c == NULL)
return (NULL);
return (layout_dump(w, w->layout_root));
if (c->flags & CLIENT_CONTROL &&
~c->flags & CLIENT_CONTROL_NEWLAYOUTS)
flags |= LAYOUT_CUSTOM_OLD_FORMAT;
return (layout_dump(w, w->layout_root, flags));
}
/* Callback for pane_start_command. */