mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Merge branch 'master' into floating_panes
This commit is contained in:
@@ -289,7 +289,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);
|
||||
@@ -305,7 +305,6 @@ layout_parse(struct window *w, const char *layout, char **cause)
|
||||
layout_print_cell(tiled_lc, __func__, 0);
|
||||
|
||||
/* Free the floating layout cell, no longer needed. */
|
||||
if (floating_lc != NULL)
|
||||
layout_free_cell(floating_lc);
|
||||
|
||||
notify_window("window-layout-changed", w);
|
||||
|
||||
5
layout.c
5
layout.c
@@ -79,6 +79,9 @@ layout_free_cell(struct layout_cell *lc)
|
||||
{
|
||||
struct layout_cell *lcchild;
|
||||
|
||||
if (lc == NULL)
|
||||
return;
|
||||
|
||||
switch (lc->type) {
|
||||
case LAYOUT_LEFTRIGHT:
|
||||
case LAYOUT_TOPBOTTOM:
|
||||
@@ -234,7 +237,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)
|
||||
{
|
||||
|
||||
@@ -713,10 +713,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)
|
||||
@@ -1267,7 +1265,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)
|
||||
@@ -1278,7 +1275,7 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
|
||||
struct screen *s = wp->screen;
|
||||
struct colour_palette *palette = &wp->palette;
|
||||
struct grid_cell defaults;
|
||||
u_int i, j, woy, wx, wy, px, py, width;
|
||||
u_int i, j, woy, wx, wy, py, width;
|
||||
struct visible_ranges *r;
|
||||
struct visible_range *ri;
|
||||
|
||||
@@ -1291,25 +1288,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. */
|
||||
@@ -1338,16 +1330,13 @@ 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++) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1442,8 +1431,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;
|
||||
@@ -1451,8 +1440,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;
|
||||
@@ -1460,17 +1449,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;
|
||||
@@ -1485,34 +1477,37 @@ 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 ||
|
||||
py >= sy || py < 0 ||
|
||||
! screen_redraw_is_visible(r, wx))
|
||||
!screen_redraw_is_visible(r, wx))
|
||||
continue;
|
||||
tty_cursor(tty, px, py);
|
||||
if ((sb_pos == PANE_SCROLLBARS_LEFT &&
|
||||
|
||||
2
tmux.1
2
tmux.1
@@ -8343,7 +8343,7 @@ was created but is not linked to the current session.
|
||||
The window with ID
|
||||
.Ar window\-id ,
|
||||
which is not linked to the current session, was closed.
|
||||
.It Ic %unlinked\-window\-renamed Ar window\-id
|
||||
.It Ic %unlinked\-window\-renamed Ar window\-id Ar new\-name
|
||||
The window with ID
|
||||
.Ar window\-id ,
|
||||
which is not linked to the current session, was renamed.
|
||||
|
||||
Reference in New Issue
Block a user