mirror of
https://github.com/tmux/tmux.git
synced 2024-11-05 02:18:47 +00:00
Clamping to area needs to use the offset without the status line, since that is
where the window offsets are based.
This commit is contained in:
parent
cb1131a294
commit
af69289e0e
4
popup.c
4
popup.c
@ -79,8 +79,8 @@ popup_set_client_cb(struct tty_ctx *ttyctx, struct client *c)
|
|||||||
ttyctx->wsx = c->tty.sx;
|
ttyctx->wsx = c->tty.sx;
|
||||||
ttyctx->wsy = c->tty.sy;
|
ttyctx->wsy = c->tty.sy;
|
||||||
|
|
||||||
ttyctx->xoff = pd->px + 1;
|
ttyctx->xoff = ttyctx->rxoff = pd->px + 1;
|
||||||
ttyctx->yoff = pd->py + 1;
|
ttyctx->yoff = ttyctx->ryoff = pd->py + 1;
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
@ -136,8 +136,9 @@ screen_write_set_client_cb(struct tty_ctx *ttyctx, struct client *c)
|
|||||||
ttyctx->bigger = tty_window_offset(&c->tty, &ttyctx->wox, &ttyctx->woy,
|
ttyctx->bigger = tty_window_offset(&c->tty, &ttyctx->wox, &ttyctx->woy,
|
||||||
&ttyctx->wsx, &ttyctx->wsy);
|
&ttyctx->wsx, &ttyctx->wsy);
|
||||||
|
|
||||||
ttyctx->xoff = wp->xoff;
|
ttyctx->xoff = ttyctx->rxoff = wp->xoff;
|
||||||
ttyctx->yoff = wp->yoff;
|
ttyctx->yoff = ttyctx->ryoff = wp->yoff;
|
||||||
|
|
||||||
if (status_at_line(c) == 0)
|
if (status_at_line(c) == 0)
|
||||||
ttyctx->yoff += status_line_size(c);
|
ttyctx->yoff += status_line_size(c);
|
||||||
|
|
||||||
|
2
tmux.h
2
tmux.h
@ -1321,6 +1321,8 @@ struct tty_ctx {
|
|||||||
/* Target region (usually pane) offset and size. */
|
/* Target region (usually pane) offset and size. */
|
||||||
u_int xoff;
|
u_int xoff;
|
||||||
u_int yoff;
|
u_int yoff;
|
||||||
|
u_int rxoff;
|
||||||
|
u_int ryoff;
|
||||||
u_int sx;
|
u_int sx;
|
||||||
u_int sy;
|
u_int sy;
|
||||||
|
|
||||||
|
4
tty.c
4
tty.c
@ -987,7 +987,7 @@ static int
|
|||||||
tty_clamp_line(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py,
|
tty_clamp_line(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py,
|
||||||
u_int nx, u_int *i, u_int *x, u_int *rx, u_int *ry)
|
u_int nx, u_int *i, u_int *x, u_int *rx, u_int *ry)
|
||||||
{
|
{
|
||||||
u_int xoff = ctx->xoff + px;
|
u_int xoff = ctx->rxoff + px;
|
||||||
|
|
||||||
if (!tty_is_visible(tty, ctx, px, py, nx, 1))
|
if (!tty_is_visible(tty, ctx, px, py, nx, 1))
|
||||||
return (0);
|
return (0);
|
||||||
@ -1082,7 +1082,7 @@ tty_clamp_area(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py,
|
|||||||
u_int nx, u_int ny, u_int *i, u_int *j, u_int *x, u_int *y, u_int *rx,
|
u_int nx, u_int ny, u_int *i, u_int *j, u_int *x, u_int *y, u_int *rx,
|
||||||
u_int *ry)
|
u_int *ry)
|
||||||
{
|
{
|
||||||
u_int xoff = ctx->xoff + px, yoff = ctx->yoff + py;
|
u_int xoff = ctx->rxoff + px, yoff = ctx->ryoff + py;
|
||||||
|
|
||||||
if (!tty_is_visible(tty, ctx, px, py, nx, ny))
|
if (!tty_is_visible(tty, ctx, px, py, nx, ny))
|
||||||
return (0);
|
return (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user