Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-05-01 12:01:08 +01:00
7 changed files with 437 additions and 34 deletions

View File

@@ -36,6 +36,8 @@ struct screen_sel {
u_int ex;
u_int ey;
u_int clipx;
struct grid_cell cell;
};
@@ -465,7 +467,8 @@ screen_resize_y(struct screen *s, u_int sy, int eat_empty, u_int *cy)
/* Set selection. */
void
screen_set_selection(struct screen *s, u_int sx, u_int sy,
u_int ex, u_int ey, u_int rectangle, int modekeys, struct grid_cell *gc)
u_int ex, u_int ey, u_int rectangle, u_int clipx, int modekeys,
struct grid_cell *gc)
{
if (s->sel == NULL)
s->sel = xcalloc(1, sizeof *s->sel);
@@ -479,6 +482,7 @@ screen_set_selection(struct screen *s, u_int sx, u_int sy,
s->sel->sy = sy;
s->sel->ex = ex;
s->sel->ey = ey;
s->sel->clipx = clipx;
}
/* Clear selection. */
@@ -506,6 +510,8 @@ screen_check_selection(struct screen *s, u_int px, u_int py)
if (sel == NULL || sel->hidden)
return (0);
if (px < sel->clipx)
return (0);
if (sel->rectangle) {
if (sel->sy < sel->ey) {