Merge branch 'floating_panes' into floating_panes_staging

This commit is contained in:
Nicholas Marriott
2026-06-01 21:30:31 +01:00
3 changed files with 26 additions and 29 deletions

View File

@@ -1480,6 +1480,7 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
int px, py, wx, wy, ox, oy, sx, sy, sb_tty_y; int px, py, wx, wy, ox, oy, sx, sy, sb_tty_y;
int xoff = wp->xoff; int xoff = wp->xoff;
int yoff = wp->yoff; int yoff = wp->yoff;
int sb_wy = sb_y; /* window coordinates */
struct visible_ranges *r; struct visible_ranges *r;
/* /*
@@ -1491,9 +1492,8 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
ox = ctx->ox; ox = ctx->ox;
oy = ctx->oy; oy = ctx->oy;
if (ctx->statustop) { if (ctx->statustop) {
sb_y += ctx->statuslines; sb_y += ctx->statuslines; /* tty coordinates */
sy += ctx->statuslines; /* height of window */ sy += ctx->statuslines;
oy += ctx->statuslines; /* top of window */
} }
gc = sb_style->gc; gc = sb_style->gc;
@@ -1525,8 +1525,8 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
} }
/* /*
* sb_y is a window coordinate; convert to tty coordinate by * sb_y is in tty coordinate (window coord + statuslines when
* subtracting the pan offset oy. * statustop). Subtract the pan offset oy to get the tty row.
*/ */
sb_tty_y = sb_y - oy; /* scrollbar top in tty coordinates */ sb_tty_y = sb_y - oy; /* scrollbar top in tty coordinates */
if (sb_tty_y > (int)sy) { if (sb_tty_y > (int)sy) {
@@ -1548,7 +1548,7 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
} }
for (j = jmin; j < jmax; j++) { for (j = jmin; j < jmax; j++) {
wy = sb_y + j; /* window y coordinate */ wy = sb_wy + j; /* window y coordinate */
py = sb_tty_y + j; /* tty y coordinate */ py = sb_tty_y + j; /* tty y coordinate */
r = tty_check_overlay_range(tty, sb_x, wy, imax); r = tty_check_overlay_range(tty, sb_x, wy, imax);
r = screen_redraw_get_visible_ranges(wp, sb_x, wy, imax, r); r = screen_redraw_get_visible_ranges(wp, sb_x, wy, imax, r);

32
spawn.c
View File

@@ -269,23 +269,25 @@ spawn_pane(struct spawn_context *sc, char **cause)
sc->wp0->ictx = NULL; sc->wp0->ictx = NULL;
new_wp = sc->wp0; new_wp = sc->wp0;
new_wp->flags &= ~(PANE_STATUSREADY|PANE_STATUSDRAWN); new_wp->flags &= ~(PANE_STATUSREADY|PANE_STATUSDRAWN);
} else if (sc->lc == NULL) {
new_wp = window_add_pane(w, NULL, hlimit, sc->flags);
layout_init(w, new_wp);
} else { } else {
new_wp = window_add_pane(w, sc->wp0, hlimit, sc->flags); if (sc->lc == NULL) {
if (sc->flags & SPAWN_ZOOM) new_wp = window_add_pane(w, NULL, hlimit, sc->flags);
layout_assign_pane(sc->lc, new_wp, 1); layout_init(w, new_wp);
else } else {
layout_assign_pane(sc->lc, new_wp, 0); new_wp = window_add_pane(w, sc->wp0, hlimit, sc->flags);
} if (sc->flags & SPAWN_ZOOM)
layout_assign_pane(sc->lc, new_wp, 1);
else
layout_assign_pane(sc->lc, new_wp, 0);
}
/* /*
* If window currently zoomed, window_set_active_pane calls * If window currently zoomed, window_set_active_pane calls
* window_unzoom which it copies back the saved_layout_cell. * window_unzoom which it copies back the saved_layout_cell.
*/ */
if (w->flags & WINDOW_ZOOMED) if (w->flags & WINDOW_ZOOMED)
new_wp->saved_layout_cell = new_wp->layout_cell; new_wp->saved_layout_cell = new_wp->layout_cell;
}
/* /*
* Now we have a pane with nothing running in it ready for the new * Now we have a pane with nothing running in it ready for the new

View File

@@ -644,16 +644,11 @@ window_get_active_at(struct window *w, u_int x, u_int y)
continue; continue;
} }
} else { } else {
/* Floating - include top or or left border. */ /* Floating - include all borders. */
if ((int)x < xoff - 1 || x > xoff + sx) if ((int)x < xoff - 1 || x > xoff + sx)
continue; continue;
if (pane_status == PANE_STATUS_TOP) { if ((int)y < yoff - 1 || y > yoff + sy)
if ((int)y <= yoff - 2 || y > yoff + sy - 1) continue;
continue;
} else {
if ((int)y < yoff - 1 || y > yoff + sy)
continue;
}
} }
return (wp); return (wp);
} }