mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Merge branch 'obsd-master'
This commit is contained in:
@@ -288,7 +288,7 @@ layout_parse(struct window *w, const char *layout, char **cause)
|
||||
if (floating_lc != NULL)
|
||||
layout_assign(&wp, floating_lc, PANE_FLOATING);
|
||||
|
||||
/* Fix pane Z indexes. */
|
||||
/* Fix pane z-indexes. */
|
||||
while (!TAILQ_EMPTY(&w->z_index)) {
|
||||
wp = TAILQ_FIRST(&w->z_index);
|
||||
TAILQ_REMOVE(&w->z_index, wp, zentry);
|
||||
|
||||
2
layout.c
2
layout.c
@@ -233,7 +233,7 @@ layout_make_node(struct layout_cell *lc, enum layout_type type)
|
||||
lc->wp = NULL;
|
||||
}
|
||||
|
||||
/* Fix Z indexes. */
|
||||
/* Fix z-indexes. */
|
||||
void
|
||||
layout_fix_zindexes(struct window *w, struct layout_cell *lc)
|
||||
{
|
||||
|
||||
@@ -711,10 +711,8 @@ screen_redraw_draw_pane_status(struct screen_redraw_ctx *ctx)
|
||||
}
|
||||
|
||||
r = screen_redraw_get_visible_ranges(wp, x, yoff, width, NULL);
|
||||
|
||||
if (ctx->statustop)
|
||||
yoff += ctx->statuslines;
|
||||
|
||||
for (i = 0; i < r->used; i++) {
|
||||
ri = &r->ranges[i];
|
||||
if (ri->nx == 0)
|
||||
@@ -1265,7 +1263,6 @@ screen_redraw_get_visible_ranges(struct window_pane *base_wp, u_int px,
|
||||
return (r);
|
||||
}
|
||||
|
||||
|
||||
/* Draw one pane. */
|
||||
static void
|
||||
screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
|
||||
@@ -1289,25 +1286,20 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
|
||||
wp->xoff >= (int)ctx->ox + (int)ctx->sx)
|
||||
return;
|
||||
|
||||
/* woy is window y offset in tty. */
|
||||
if (ctx->statustop)
|
||||
woy = ctx->statuslines;
|
||||
else
|
||||
woy = 0;
|
||||
|
||||
for (j = 0; j < wp->sy; j++) {
|
||||
if (wp->yoff + (int)j < (int)ctx->oy ||
|
||||
wp->yoff + (int)j >= (int)ctx->oy + (int)ctx->sy)
|
||||
continue;
|
||||
wy = wp->yoff + j; /* y line within window w. */
|
||||
py = woy + wy - ctx->oy; /* y line within tty. */
|
||||
if (py > tty->sy)
|
||||
wy = wp->yoff + j; /* y line within window w */
|
||||
py = woy + wy - ctx->oy; /* y line within tty */
|
||||
if (py > tty->sy) {
|
||||
/* Continue if this line is off of tty. */
|
||||
continue;
|
||||
|
||||
/* Note: i is apparenty not used now that the vr array
|
||||
* returns where in s to read from.
|
||||
*/
|
||||
}
|
||||
if (wp->xoff >= (int)ctx->ox &&
|
||||
wp->xoff + (int)wp->sx <= (int)ctx->ox + (int)ctx->sx) {
|
||||
/* All visible. */
|
||||
@@ -1336,22 +1328,15 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
|
||||
|
||||
/* Get visible ranges of line before we draw it. */
|
||||
r = screen_redraw_get_visible_ranges(wp, wx, wy, width, NULL);
|
||||
|
||||
tty_default_colours(&defaults, wp);
|
||||
|
||||
for (i = 0; i < r->used; i++) {
|
||||
ri = &r->ranges[i];
|
||||
if (ri->nx == 0)
|
||||
continue;
|
||||
px = ri->px;
|
||||
tty_draw_line(tty, s, ri->px - wp->xoff, j,
|
||||
ri->nx, px, py, &defaults, palette);
|
||||
tty_draw_line(tty, s, ri->px - wp->xoff, j, ri->nx,
|
||||
ri->px, py, &defaults, palette);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_SIXEL
|
||||
tty_draw_images(c, wp, s);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Draw the panes scrollbars */
|
||||
@@ -1440,8 +1425,8 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
|
||||
struct visible_ranges *r;
|
||||
|
||||
/*
|
||||
* Size and offset of window relative to tty.
|
||||
* Status at top offsets window downward.
|
||||
* Size and offset of window relative to tty. Status at top offsets
|
||||
* window downward.
|
||||
*/
|
||||
sx = ctx->sx;
|
||||
sy = tty->sy - ctx->statuslines;
|
||||
@@ -1449,8 +1434,8 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
|
||||
oy = ctx->oy;
|
||||
if (ctx->statustop) {
|
||||
sb_y += ctx->statuslines;
|
||||
sy += ctx->statuslines; /* Height of window in tty. */
|
||||
oy += ctx->statuslines; /* Top of window in tty. */
|
||||
sy += ctx->statuslines; /* height of window */
|
||||
oy += ctx->statuslines; /* top of window */
|
||||
}
|
||||
|
||||
gc = sb_style->gc;
|
||||
@@ -1458,17 +1443,20 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
|
||||
slgc.fg = gc.bg;
|
||||
slgc.bg = gc.fg;
|
||||
|
||||
if (sb_x + (int)sb_w < 0 || sb_x >= sx || sb_y >= sy)
|
||||
/* Whole sb off screen. */
|
||||
if (sb_x + (int)sb_w < 0 || sb_x >= sx || sb_y >= sy) {
|
||||
/* Whole scrollbar is off screen. */
|
||||
return;
|
||||
if (sb_x < 0)
|
||||
/* Part of sb on screen. */
|
||||
}
|
||||
if (sb_x < 0) {
|
||||
/* Part of scrollbar on screen. */
|
||||
imin = - sb_x;
|
||||
}
|
||||
imax = sb_w + sb_pad;
|
||||
if ((int)imax + sb_x > sx) {
|
||||
if (sb_x > sx)
|
||||
/* Whole sb off screen. */
|
||||
if (sb_x > sx) {
|
||||
/* Whole scrollbar off screen. */
|
||||
return;
|
||||
}
|
||||
imax = sx - sb_x;
|
||||
}
|
||||
jmax = sb_h;
|
||||
@@ -1483,29 +1471,32 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
|
||||
* subtracting the pan offset oy.
|
||||
*/
|
||||
sb_tty_y = sb_y - oy; /* scrollbar top in tty coordinates */
|
||||
|
||||
if (sb_tty_y > (int)sy)
|
||||
/* Whole sb off screen. */
|
||||
if (sb_tty_y > (int)sy) {
|
||||
/* Whole scrollbar is off screen. */
|
||||
return;
|
||||
if (sb_tty_y < 0)
|
||||
}
|
||||
if (sb_tty_y < 0) {
|
||||
/* Scrollbar starts above visible area; skip those rows. */
|
||||
jmin = -sb_tty_y;
|
||||
if (sb_tty_y + (int)sb_h <= 0)
|
||||
/* Whole sb above visible area. */
|
||||
}
|
||||
if (sb_tty_y + (int)sb_h <= 0) {
|
||||
/* Whole scrollbar above visible area. */
|
||||
return;
|
||||
}
|
||||
jmax = sb_h;
|
||||
if (sb_tty_y + (int)jmax > (int)sy)
|
||||
if (sb_tty_y + (int)jmax > (int)sy) {
|
||||
/* Clip to height of tty. */
|
||||
jmax = sy - sb_tty_y;
|
||||
}
|
||||
|
||||
for (j = jmin; j < jmax; j++) {
|
||||
wy = sb_y + j; /* window y coordinate. */
|
||||
py = sb_tty_y + j; /* tty y coordinate. */
|
||||
wy = sb_y + j; /* window y coordinate */
|
||||
py = sb_tty_y + j;/* tty y coordinate */
|
||||
r = tty_check_overlay_range(tty, sb_x, wy, imax);
|
||||
r = screen_redraw_get_visible_ranges(wp, sb_x, wy, imax, r);
|
||||
for (i = imin; i < imax; i++) {
|
||||
px = sb_x + ox + i; /* tty x coordinate. */
|
||||
wx = sb_x + i; /* window x coordinate. */
|
||||
px = sb_x + ox + i; /* tty x coordinate */
|
||||
wx = sb_x + i; /* window x coordinate */
|
||||
if (wx < xoff - (int)sb_w - (int)sb_pad ||
|
||||
px >= sx || px < 0 ||
|
||||
wy < yoff - 1 ||
|
||||
|
||||
Reference in New Issue
Block a user