mirror of
https://github.com/tmux/tmux.git
synced 2026-06-21 17:55:21 +00:00
Use entire client area if window is smaller.
This commit is contained in:
@@ -38,8 +38,8 @@
|
|||||||
* A scene is made from spans. A span is a horizontal run of cells on one
|
* A scene is made from spans. A span is a horizontal run of cells on one
|
||||||
* visible line that can be drawn in the same way. Each span has a type, for
|
* visible line that can be drawn in the same way. Each span has a type, for
|
||||||
* example: pane content or pane border cells or pane status line. A span also
|
* example: pane content or pane border cells or pane status line. A span also
|
||||||
* includes enough additional data to draw it, but does not include the style -
|
* includes enough additional data to draw it, but does not include items such
|
||||||
* that is determined when it is drawn.
|
* as the style and content - those are determined when it is drawn.
|
||||||
*
|
*
|
||||||
* Scenes are built in two stages:
|
* Scenes are built in two stages:
|
||||||
*
|
*
|
||||||
@@ -112,7 +112,7 @@ struct redraw_span_data {
|
|||||||
/* Position of span inside the pane. */
|
/* Position of span inside the pane. */
|
||||||
u_int px;
|
u_int px;
|
||||||
u_int py;
|
u_int py;
|
||||||
} p;
|
} p; /* pane */
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
/* Adjacent panes on each side. */
|
/* Adjacent panes on each side. */
|
||||||
@@ -140,14 +140,14 @@ struct redraw_span_data {
|
|||||||
|
|
||||||
/* Flags for this span. */
|
/* Flags for this span. */
|
||||||
int flags;
|
int flags;
|
||||||
} b;
|
} b; /* pane border */
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
/* The pane and the offset into the status line. */
|
/* The pane and the offset into the status line. */
|
||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
u_int offset;
|
u_int offset;
|
||||||
int cell_type;
|
int cell_type;
|
||||||
} st;
|
} st; /* pane status line */
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
/* Pane this span belongs to. */
|
/* Pane this span belongs to. */
|
||||||
@@ -161,7 +161,7 @@ struct redraw_span_data {
|
|||||||
|
|
||||||
/* Flags for this span. */
|
/* Flags for this span. */
|
||||||
int flags;
|
int flags;
|
||||||
} sb;
|
} sb; /* pane scrollbar */
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -260,6 +260,20 @@ redraw_flags_string(int flags)
|
|||||||
return (s);
|
return (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Expand size to cover any part of the client outside the window. */
|
||||||
|
static void
|
||||||
|
redraw_expand_size(struct client *c, u_int *sx, u_int *sy)
|
||||||
|
{
|
||||||
|
u_int tty_sx, tty_sy;
|
||||||
|
|
||||||
|
tty_sx = c->tty.sx;
|
||||||
|
tty_sy = c->tty.sy - status_line_size(c);
|
||||||
|
if (*sx < tty_sx)
|
||||||
|
*sx = tty_sx;
|
||||||
|
if (*sy < tty_sy)
|
||||||
|
*sy = tty_sy;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize the context for building scene. */
|
/* Initialize the context for building scene. */
|
||||||
static void
|
static void
|
||||||
redraw_set_context(struct client *c, struct redraw_build_ctx *bctx)
|
redraw_set_context(struct client *c, struct redraw_build_ctx *bctx)
|
||||||
@@ -272,6 +286,7 @@ redraw_set_context(struct client *c, struct redraw_build_ctx *bctx)
|
|||||||
bctx->c = c;
|
bctx->c = c;
|
||||||
bctx->w = w;
|
bctx->w = w;
|
||||||
tty_window_offset(&c->tty, &bctx->ox, &bctx->oy, &bctx->sx, &bctx->sy);
|
tty_window_offset(&c->tty, &bctx->ox, &bctx->oy, &bctx->sx, &bctx->sy);
|
||||||
|
redraw_expand_size(c, &bctx->sx, &bctx->sy);
|
||||||
|
|
||||||
bctx->sb = options_get_number(oo, "pane-scrollbars");
|
bctx->sb = options_get_number(oo, "pane-scrollbars");
|
||||||
bctx->sbp = options_get_number(oo, "pane-scrollbars-position");
|
bctx->sbp = options_get_number(oo, "pane-scrollbars-position");
|
||||||
@@ -936,6 +951,7 @@ redraw_get_scene(struct client *c)
|
|||||||
u_int ox, oy, sx, sy;
|
u_int ox, oy, sx, sy;
|
||||||
|
|
||||||
tty_window_offset(&c->tty, &ox, &oy, &sx, &sy);
|
tty_window_offset(&c->tty, &ox, &oy, &sx, &sy);
|
||||||
|
redraw_expand_size(c, &sx, &sy);
|
||||||
if (scene == NULL)
|
if (scene == NULL)
|
||||||
reason = "missing";
|
reason = "missing";
|
||||||
else if (scene->w != w)
|
else if (scene->w != w)
|
||||||
|
|||||||
Reference in New Issue
Block a user