mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 22:26:18 +00:00
Merge branch 'floating_panes' into floating_panes_staging
This commit is contained in:
43
tty.c
43
tty.c
@@ -1004,10 +1004,7 @@ tty_window_offset1(struct tty *tty, u_int *ox, u_int *oy, u_int *sx, u_int *sy)
|
|||||||
else if (cy > w->sy - *sy)
|
else if (cy > w->sy - *sy)
|
||||||
*oy = w->sy - *sy;
|
*oy = w->sy - *sy;
|
||||||
else
|
else
|
||||||
/* cy-sy/2 was causing panned panes to scroll
|
*oy = cy - *sy + 1;
|
||||||
* when the cursor was half way down the pane.
|
|
||||||
*/
|
|
||||||
*oy = cy - *sy + 1; /* cy - *sy / 2; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
c->pan_window = NULL;
|
c->pan_window = NULL;
|
||||||
@@ -1096,17 +1093,14 @@ tty_redraw_region(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
* If region is large, schedule a redraw. In most cases this is likely
|
* If region is large, schedule a redraw. In most cases this is likely
|
||||||
* to be followed by some more scrolling.
|
* to be followed by some more scrolling.
|
||||||
*/
|
*/
|
||||||
log_debug("%s: %s orlower=%u orupper=%u sy=%u large=%d", __func__,
|
|
||||||
c->name, ctx->orlower, ctx->orupper, ctx->sy,
|
|
||||||
tty_large_region(tty, ctx));
|
|
||||||
if (tty_large_region(tty, ctx) && ~ctx->flags & TTY_CTX_PANE_OBSCURED) {
|
if (tty_large_region(tty, ctx) && ~ctx->flags & TTY_CTX_PANE_OBSCURED) {
|
||||||
log_debug("%s: %s large region redraw", __func__, c->name);
|
log_debug("%s: %s large region redraw", __func__, c->name);
|
||||||
ctx->redraw_cb(ctx);
|
ctx->redraw_cb(ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_debug("%s: %s small redraw, drawing rows %u-%u", __func__,
|
log_debug("%s: %s small region redraw (%u-%u)", __func__, c->name,
|
||||||
c->name, ctx->orupper, ctx->orlower);
|
ctx->orupper, ctx->orlower);
|
||||||
for (i = ctx->orupper; i <= ctx->orlower; i++)
|
for (i = ctx->orupper; i <= ctx->orlower; i++)
|
||||||
tty_draw_pane(tty, ctx, i);
|
tty_draw_pane(tty, ctx, i);
|
||||||
}
|
}
|
||||||
@@ -1233,7 +1227,7 @@ tty_clear_pane_line(struct tty *tty, const struct tty_ctx *ctx, u_int py,
|
|||||||
|
|
||||||
if (tty_clamp_line(tty, ctx, px, py, nx, &l, &x, &rx, &ry)) {
|
if (tty_clamp_line(tty, ctx, px, py, nx, &l, &x, &rx, &ry)) {
|
||||||
r = tty_check_overlay_range(tty, x, ry, rx);
|
r = tty_check_overlay_range(tty, x, ry, rx);
|
||||||
for (i=0; i < r->used; i++) {
|
for (i = 0; i < r->used; i++) {
|
||||||
ri = &r->ranges[i];
|
ri = &r->ranges[i];
|
||||||
if (ri->nx == 0)
|
if (ri->nx == 0)
|
||||||
continue;
|
continue;
|
||||||
@@ -1316,7 +1310,7 @@ tty_clear_area(struct tty *tty, const struct tty_ctx *ctx, u_int py,
|
|||||||
struct window_pane *wpl, *wp = ctx->arg;
|
struct window_pane *wpl, *wp = ctx->arg;
|
||||||
struct visible_ranges *r;
|
struct visible_ranges *r;
|
||||||
struct visible_range *ri;
|
struct visible_range *ri;
|
||||||
u_int i, yy, overlap = 0, oy = 0;
|
u_int i, yy, region = 1, oy = 0;
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
|
|
||||||
log_debug("%s: %s, %u,%u at %u,%u", __func__, c->name, nx, ny, px, py);
|
log_debug("%s: %s, %u,%u at %u,%u", __func__, c->name, nx, ny, px, py);
|
||||||
@@ -1325,7 +1319,14 @@ tty_clear_area(struct tty *tty, const struct tty_ctx *ctx, u_int py,
|
|||||||
if (nx == 0 || ny == 0)
|
if (nx == 0 || ny == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Verify there's nothing overlapping in z-index before using BCE. */
|
/*
|
||||||
|
* If there is an overlay or BCE is not available, cannot clear as a
|
||||||
|
* region.
|
||||||
|
*/
|
||||||
|
if (c->overlay_check != NULL || tty_fake_bce(tty, defaults, bg))
|
||||||
|
region = 0;
|
||||||
|
else {
|
||||||
|
/* Any overlapping pane also means no region. */
|
||||||
TAILQ_FOREACH(wpl, &w->z_index, zentry) {
|
TAILQ_FOREACH(wpl, &w->z_index, zentry) {
|
||||||
if (wpl == wp || ~wpl->flags & PANE_FLOATING)
|
if (wpl == wp || ~wpl->flags & PANE_FLOATING)
|
||||||
continue;
|
continue;
|
||||||
@@ -1335,13 +1336,13 @@ tty_clear_area(struct tty *tty, const struct tty_ctx *ctx, u_int py,
|
|||||||
if ((int)wpl->yoff - 1 > (int)(py + ny) ||
|
if ((int)wpl->yoff - 1 > (int)(py + ny) ||
|
||||||
wpl->yoff + (int)wpl->sy + 1 < (int)py)
|
wpl->yoff + (int)wpl->sy + 1 < (int)py)
|
||||||
continue;
|
continue;
|
||||||
overlap++;
|
region = 0;
|
||||||
if (overlap > 0) break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If genuine BCE is available, can try escape sequences. */
|
/* Clear as a region if possible. */
|
||||||
if (!overlap && c->overlay_check == NULL &&
|
if (region) {
|
||||||
!tty_fake_bce(tty, defaults, bg)) {
|
|
||||||
/* Use ED if clearing off the bottom of the terminal. */
|
/* Use ED if clearing off the bottom of the terminal. */
|
||||||
if (px == 0 &&
|
if (px == 0 &&
|
||||||
px + nx >= tty->sx &&
|
px + nx >= tty->sx &&
|
||||||
@@ -1392,15 +1393,15 @@ tty_clear_area(struct tty *tty, const struct tty_ctx *ctx, u_int py,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Couldn't use an escape sequence, loop over the lines. */
|
||||||
if (c->session->statusat == 0)
|
if (c->session->statusat == 0)
|
||||||
oy = c->session->statuslines;
|
oy = c->session->statuslines;
|
||||||
|
|
||||||
/* Couldn't use an escape sequence, loop over the lines. */
|
|
||||||
for (yy = py; yy < py + ny; yy++) {
|
for (yy = py; yy < py + ny; yy++) {
|
||||||
r = tty_check_overlay_range(tty, px, yy - oy, nx);
|
r = tty_check_overlay_range(tty, px, yy - oy, nx);
|
||||||
for (i=0; i < r->used; i++) {
|
for (i = 0; i < r->used; i++) {
|
||||||
ri = &r->ranges[i];
|
ri = &r->ranges[i];
|
||||||
if (ri->nx == 0) continue;
|
if (ri->nx == 0)
|
||||||
|
continue;
|
||||||
tty_clear_line(tty, defaults, yy, ri->px, ri->nx, bg);
|
tty_clear_line(tty, defaults, yy, ri->px, ri->nx, bg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user