Fix mouse drag in copy-mode to properly select around floating panes.

This commit is contained in:
Michael Grant
2025-11-07 01:24:19 +01:00
parent 61ca158de1
commit cc671e4495
2 changed files with 10 additions and 5 deletions

10
tty.c
View File

@@ -2248,10 +2248,11 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
(gcp->data.width == 1 && !tty_check_overlay(tty, px, py))) (gcp->data.width == 1 && !tty_check_overlay(tty, px, py)))
return; return;
vr = screen_redraw_get_visible_ranges(wp, px, py,
gcp->data.width);
/* Handle partially obstructed wide characters. */ /* Handle partially obstructed wide characters. */
if (gcp->data.width > 1) { if (gcp->data.width > 1) {
vr = screen_redraw_get_visible_ranges(wp, px, py,
gcp->data.width);
for (i = 0; i < vr->used; i++) for (i = 0; i < vr->used; i++)
vis2 += vr->nx[i]; vis2 += vr->nx[i];
tty_check_overlay_range(tty, px, py, gcp->data.width, &r); tty_check_overlay_range(tty, px, py, gcp->data.width, &r);
@@ -2273,8 +2274,9 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
tty_margin_off(tty); tty_margin_off(tty);
tty_cursor_pane_unless_wrap(tty, ctx, ctx->ocx, ctx->ocy); tty_cursor_pane_unless_wrap(tty, ctx, ctx->ocx, ctx->ocy);
tty_cell(tty, ctx->cell, &ctx->defaults, ctx->palette, if (screen_redraw_is_visible(vr, px))
ctx->s->hyperlinks); tty_cell(tty, ctx->cell, &ctx->defaults, ctx->palette,
ctx->s->hyperlinks);
if (ctx->num == 1) if (ctx->num == 1)
tty_invalidate(tty); tty_invalidate(tty);

View File

@@ -5810,7 +5810,10 @@ window_copy_drag_update(struct client *c, struct mouse_event *m)
if (c == NULL) if (c == NULL)
return; return;
wp = cmd_mouse_pane(m, NULL, NULL); if (c->tty.mouse_wp != NULL)
wp = c->tty.mouse_wp;
else
wp = cmd_mouse_pane(m, NULL, NULL);
if (wp == NULL) if (wp == NULL)
return; return;
wme = TAILQ_FIRST(&wp->modes); wme = TAILQ_FIRST(&wp->modes);