mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Merge branch 'obsd-master'
This commit is contained in:
@@ -70,10 +70,10 @@ cmd_display_panes_draw_pane(struct screen_redraw_ctx *ctx,
|
|||||||
char buf[16], lbuf[16], rbuf[16], *ptr;
|
char buf[16], lbuf[16], rbuf[16], *ptr;
|
||||||
size_t len, llen, rlen;
|
size_t len, llen, rlen;
|
||||||
|
|
||||||
if (wp->xoff + wp->sx <= ctx->ox ||
|
if (wp->xoff + (int)wp->sx <= ctx->ox ||
|
||||||
wp->xoff >= ctx->ox + ctx->sx ||
|
wp->xoff >= ctx->ox + (int)ctx->sx ||
|
||||||
wp->yoff + wp->sy <= ctx->oy ||
|
wp->yoff + (int)wp->sy <= ctx->oy ||
|
||||||
wp->yoff >= ctx->oy + ctx->sy)
|
wp->yoff >= ctx->oy + (int)ctx->sy)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (wp->xoff >= ctx->ox && wp->xoff + wp->sx <= ctx->ox + ctx->sx) {
|
if (wp->xoff >= ctx->ox && wp->xoff + wp->sx <= ctx->ox + ctx->sx) {
|
||||||
|
|||||||
4
cmd.c
4
cmd.c
@@ -774,9 +774,9 @@ cmd_mouse_at(struct window_pane *wp, struct mouse_event *m, u_int *xp,
|
|||||||
if (m->statusat == 0 && y >= m->statuslines)
|
if (m->statusat == 0 && y >= m->statuslines)
|
||||||
y -= m->statuslines;
|
y -= m->statuslines;
|
||||||
|
|
||||||
if (x < wp->xoff || x >= wp->xoff + wp->sx)
|
if ((int)x < wp->xoff || (int)x >= wp->xoff + (int)wp->sx)
|
||||||
return (-1);
|
return (-1);
|
||||||
if (y < wp->yoff || y >= wp->yoff + wp->sy)
|
if ((int)y < wp->yoff || (int)y >= wp->yoff + (int)wp->sy)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
if (xp != NULL)
|
if (xp != NULL)
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
|
|||||||
u_int px, u_int py)
|
u_int px, u_int py)
|
||||||
{
|
{
|
||||||
struct options *oo = wp->window->options;
|
struct options *oo = wp->window->options;
|
||||||
u_int ex = wp->xoff + wp->sx, ey = wp->yoff + wp->sy;
|
int ex = wp->xoff + wp->sx, ey = wp->yoff + wp->sy;
|
||||||
int hsplit = 0, vsplit = 0, pane_status = ctx->pane_status;
|
int hsplit = 0, vsplit = 0, pane_status = ctx->pane_status;
|
||||||
int pane_scrollbars = ctx->pane_scrollbars, sb_w = 0;
|
int pane_scrollbars = ctx->pane_scrollbars, sb_w = 0;
|
||||||
int sb_pos;
|
int sb_pos;
|
||||||
@@ -133,7 +133,8 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
|
|||||||
sb_pos = 0;
|
sb_pos = 0;
|
||||||
|
|
||||||
/* Inside pane. */
|
/* Inside pane. */
|
||||||
if (px >= wp->xoff && px < ex && py >= wp->yoff && py < ey)
|
if ((int)px >= wp->xoff && (int)px < ex &&
|
||||||
|
(int)py >= wp->yoff && (int)py < ey)
|
||||||
return (SCREEN_REDRAW_INSIDE);
|
return (SCREEN_REDRAW_INSIDE);
|
||||||
|
|
||||||
/* Get pane indicator. */
|
/* Get pane indicator. */
|
||||||
@@ -153,16 +154,17 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
|
|||||||
* Left/right borders. The wp->sy / 2 test is to colour only half the
|
* Left/right borders. The wp->sy / 2 test is to colour only half the
|
||||||
* active window's border when there are two panes.
|
* active window's border when there are two panes.
|
||||||
*/
|
*/
|
||||||
if ((wp->yoff == 0 || py >= wp->yoff - 1) && py <= ey) {
|
if ((wp->yoff == 0 || (int)py >= wp->yoff - 1) && (int)py <= ey) {
|
||||||
if (sb_pos == PANE_SCROLLBARS_LEFT) {
|
if (sb_pos == PANE_SCROLLBARS_LEFT) {
|
||||||
if (wp->xoff - sb_w == 0 && px == wp->sx + sb_w)
|
if (wp->xoff - sb_w == 0 && px == wp->sx + sb_w)
|
||||||
if (!hsplit || (hsplit && py <= wp->sy / 2))
|
if (!hsplit || (hsplit && py <= wp->sy / 2))
|
||||||
return (SCREEN_REDRAW_BORDER_RIGHT);
|
return (SCREEN_REDRAW_BORDER_RIGHT);
|
||||||
if (wp->xoff - sb_w != 0) {
|
if (wp->xoff - sb_w != 0) {
|
||||||
if (px == wp->xoff - sb_w - 1 &&
|
if ((int)px == wp->xoff - sb_w - 1 &&
|
||||||
(!hsplit || (hsplit && py > wp->sy / 2)))
|
(!hsplit || (hsplit && py > wp->sy / 2)))
|
||||||
return (SCREEN_REDRAW_BORDER_LEFT);
|
return (SCREEN_REDRAW_BORDER_LEFT);
|
||||||
if (px == wp->xoff + wp->sx + sb_w - 1)
|
if ((int)px == wp->xoff +
|
||||||
|
(int)wp->sx + sb_w - 1)
|
||||||
return (SCREEN_REDRAW_BORDER_RIGHT);
|
return (SCREEN_REDRAW_BORDER_RIGHT);
|
||||||
}
|
}
|
||||||
} else { /* sb_pos == PANE_SCROLLBARS_RIGHT or disabled */
|
} else { /* sb_pos == PANE_SCROLLBARS_RIGHT or disabled */
|
||||||
@@ -170,7 +172,7 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
|
|||||||
if (!hsplit || (hsplit && py <= wp->sy / 2))
|
if (!hsplit || (hsplit && py <= wp->sy / 2))
|
||||||
return (SCREEN_REDRAW_BORDER_RIGHT);
|
return (SCREEN_REDRAW_BORDER_RIGHT);
|
||||||
if (wp->xoff != 0) {
|
if (wp->xoff != 0) {
|
||||||
if (px == wp->xoff - 1 &&
|
if ((int)px == wp->xoff - 1 &&
|
||||||
(!hsplit || (hsplit && py > wp->sy / 2)))
|
(!hsplit || (hsplit && py > wp->sy / 2)))
|
||||||
return (SCREEN_REDRAW_BORDER_LEFT);
|
return (SCREEN_REDRAW_BORDER_LEFT);
|
||||||
if (px == wp->xoff + wp->sx + sb_w)
|
if (px == wp->xoff + wp->sx + sb_w)
|
||||||
@@ -183,25 +185,29 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
|
|||||||
if (vsplit && pane_status == PANE_STATUS_OFF && sb_w == 0) {
|
if (vsplit && pane_status == PANE_STATUS_OFF && sb_w == 0) {
|
||||||
if (wp->yoff == 0 && py == wp->sy && px <= wp->sx / 2)
|
if (wp->yoff == 0 && py == wp->sy && px <= wp->sx / 2)
|
||||||
return (SCREEN_REDRAW_BORDER_BOTTOM);
|
return (SCREEN_REDRAW_BORDER_BOTTOM);
|
||||||
if (wp->yoff != 0 && py == wp->yoff - 1 && px > wp->sx / 2)
|
if (wp->yoff != 0 && (int)py == wp->yoff - 1 && px > wp->sx / 2)
|
||||||
return (SCREEN_REDRAW_BORDER_TOP);
|
return (SCREEN_REDRAW_BORDER_TOP);
|
||||||
} else {
|
} else {
|
||||||
if (sb_pos == PANE_SCROLLBARS_LEFT) {
|
if (sb_pos == PANE_SCROLLBARS_LEFT) {
|
||||||
if ((wp->xoff - sb_w == 0 || px >= wp->xoff - sb_w) &&
|
if ((wp->xoff - sb_w == 0 ||
|
||||||
(px <= ex || (sb_w != 0 && px < ex + sb_w))) {
|
(int)px >= wp->xoff - sb_w) &&
|
||||||
if (wp->yoff != 0 && py == wp->yoff - 1)
|
((int)px <= ex || (sb_w != 0 &&
|
||||||
|
(int)px < ex + sb_w))) {
|
||||||
|
if (wp->yoff != 0 && (int)py == wp->yoff - 1)
|
||||||
return (SCREEN_REDRAW_BORDER_TOP);
|
return (SCREEN_REDRAW_BORDER_TOP);
|
||||||
if (py == ey)
|
if ((int)py == ey)
|
||||||
return (SCREEN_REDRAW_BORDER_BOTTOM);
|
return (SCREEN_REDRAW_BORDER_BOTTOM);
|
||||||
}
|
}
|
||||||
} else { /* sb_pos == PANE_SCROLLBARS_RIGHT */
|
} else { /* sb_pos == PANE_SCROLLBARS_RIGHT */
|
||||||
if ((wp->xoff == 0 || px >= wp->xoff) &&
|
if ((wp->xoff == 0 || (int)px >= wp->xoff) &&
|
||||||
(px <= ex || (sb_w != 0 && px < ex + sb_w))) {
|
((int)px <= ex ||
|
||||||
|
(sb_w != 0 && (int)px < ex + sb_w))) {
|
||||||
if (pane_status != PANE_STATUS_BOTTOM &&
|
if (pane_status != PANE_STATUS_BOTTOM &&
|
||||||
wp->yoff != 0 &&
|
wp->yoff != 0 &&
|
||||||
py == wp->yoff - 1)
|
(int)py == wp->yoff - 1)
|
||||||
return (SCREEN_REDRAW_BORDER_TOP);
|
return (SCREEN_REDRAW_BORDER_TOP);
|
||||||
if (pane_status != PANE_STATUS_TOP && py == ey)
|
if (pane_status != PANE_STATUS_TOP &&
|
||||||
|
(int)py == ey)
|
||||||
return (SCREEN_REDRAW_BORDER_BOTTOM);
|
return (SCREEN_REDRAW_BORDER_BOTTOM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -364,7 +370,9 @@ screen_redraw_check_cell(struct screen_redraw_ctx *ctx, u_int px, u_int py,
|
|||||||
line = wp->yoff + sy;
|
line = wp->yoff + sy;
|
||||||
right = wp->xoff + 2 + wp->status_size - 1;
|
right = wp->xoff + 2 + wp->status_size - 1;
|
||||||
|
|
||||||
if (py == line && px >= wp->xoff + 2 && px <= right)
|
if (py == line &&
|
||||||
|
(int)px >= wp->xoff + 2 &&
|
||||||
|
px <= right)
|
||||||
return (CELL_INSIDE);
|
return (CELL_INSIDE);
|
||||||
|
|
||||||
next1:
|
next1:
|
||||||
@@ -396,14 +404,14 @@ screen_redraw_check_cell(struct screen_redraw_ctx *ctx, u_int px, u_int py,
|
|||||||
wp->scrollbar_style.pad;
|
wp->scrollbar_style.pad;
|
||||||
if ((pane_status && py != line) ||
|
if ((pane_status && py != line) ||
|
||||||
(wp->yoff == 0 && py < wp->sy) ||
|
(wp->yoff == 0 && py < wp->sy) ||
|
||||||
(py >= wp->yoff && py < wp->yoff + wp->sy)) {
|
((int)py >= wp->yoff && py < wp->yoff + wp->sy)) {
|
||||||
/* Check if px lies within a scrollbar. */
|
/* Check if px lies within a scrollbar. */
|
||||||
if ((sb_pos == PANE_SCROLLBARS_RIGHT &&
|
if ((sb_pos == PANE_SCROLLBARS_RIGHT &&
|
||||||
(px >= wp->xoff + wp->sx &&
|
(px >= wp->xoff + wp->sx &&
|
||||||
px < wp->xoff + wp->sx + sb_w)) ||
|
px < wp->xoff + wp->sx + sb_w)) ||
|
||||||
(sb_pos == PANE_SCROLLBARS_LEFT &&
|
(sb_pos == PANE_SCROLLBARS_LEFT &&
|
||||||
(px >= wp->xoff - sb_w &&
|
((int)px >= wp->xoff - sb_w &&
|
||||||
px < wp->xoff)))
|
(int)px < wp->xoff)))
|
||||||
return (CELL_SCROLLBAR);
|
return (CELL_SCROLLBAR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -521,7 +529,8 @@ screen_redraw_draw_pane_status(struct screen_redraw_ctx *ctx)
|
|||||||
struct tty *tty = &c->tty;
|
struct tty *tty = &c->tty;
|
||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
struct screen *s;
|
struct screen *s;
|
||||||
u_int i, x, width, xoff, yoff, size;
|
u_int i, x, width, size;
|
||||||
|
int xoff, yoff;
|
||||||
|
|
||||||
log_debug("%s: %s @%u", __func__, c->name, w->id);
|
log_debug("%s: %s @%u", __func__, c->name, w->id);
|
||||||
|
|
||||||
@@ -537,10 +546,10 @@ screen_redraw_draw_pane_status(struct screen_redraw_ctx *ctx)
|
|||||||
yoff = wp->yoff + wp->sy;
|
yoff = wp->yoff + wp->sy;
|
||||||
xoff = wp->xoff + 2;
|
xoff = wp->xoff + 2;
|
||||||
|
|
||||||
if (xoff + size <= ctx->ox ||
|
if (xoff + (int)size <= ctx->ox ||
|
||||||
xoff >= ctx->ox + ctx->sx ||
|
xoff >= ctx->ox + (int)ctx->sx ||
|
||||||
yoff < ctx->oy ||
|
yoff < ctx->oy ||
|
||||||
yoff >= ctx->oy + ctx->sy)
|
yoff >= ctx->oy + (int)ctx->sy)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (xoff >= ctx->ox && xoff + size <= ctx->ox + ctx->sx) {
|
if (xoff >= ctx->ox && xoff + size <= ctx->ox + ctx->sx) {
|
||||||
@@ -738,8 +747,8 @@ screen_redraw_draw_borders_style(struct screen_redraw_ctx *ctx, u_int x,
|
|||||||
|
|
||||||
/* Draw arrow indicator if enabled. */
|
/* Draw arrow indicator if enabled. */
|
||||||
static void
|
static void
|
||||||
screen_redraw_draw_border_arrows(struct screen_redraw_ctx *ctx, u_int i,
|
screen_redraw_draw_border_arrows(struct screen_redraw_ctx *ctx, int i,
|
||||||
u_int j, u_int cell_type, struct window_pane *wp,
|
int j, u_int cell_type, struct window_pane *wp,
|
||||||
struct window_pane *active, struct grid_cell *gc)
|
struct window_pane *active, struct grid_cell *gc)
|
||||||
{
|
{
|
||||||
struct client *c = ctx->c;
|
struct client *c = ctx->c;
|
||||||
@@ -957,14 +966,16 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
|
|||||||
|
|
||||||
log_debug("%s: %s @%u %%%u", __func__, c->name, w->id, wp->id);
|
log_debug("%s: %s @%u %%%u", __func__, c->name, w->id, wp->id);
|
||||||
|
|
||||||
if (wp->xoff + wp->sx <= ctx->ox || wp->xoff >= ctx->ox + ctx->sx)
|
if (wp->xoff + (int)wp->sx <= ctx->ox ||
|
||||||
|
wp->xoff >= (int)ctx->ox + (int)ctx->sx)
|
||||||
return;
|
return;
|
||||||
if (ctx->statustop)
|
if (ctx->statustop)
|
||||||
top = ctx->statuslines;
|
top = ctx->statuslines;
|
||||||
else
|
else
|
||||||
top = 0;
|
top = 0;
|
||||||
for (j = 0; j < wp->sy; j++) {
|
for (j = 0; j < wp->sy; j++) {
|
||||||
if (wp->yoff + j < ctx->oy || wp->yoff + j >= ctx->oy + ctx->sy)
|
if (wp->yoff + (int)j < ctx->oy ||
|
||||||
|
wp->yoff + j >= ctx->oy + ctx->sy)
|
||||||
continue;
|
continue;
|
||||||
y = top + wp->yoff + j - ctx->oy;
|
y = top + wp->yoff + j - ctx->oy;
|
||||||
|
|
||||||
|
|||||||
@@ -632,7 +632,7 @@ server_client_check_mouse_in_pane(struct window_pane *wp, u_int px, u_int py,
|
|||||||
if (((pane_status != PANE_STATUS_OFF &&
|
if (((pane_status != PANE_STATUS_OFF &&
|
||||||
(int)py != pane_status_line && py != wp->yoff + wp->sy) ||
|
(int)py != pane_status_line && py != wp->yoff + wp->sy) ||
|
||||||
(wp->yoff == 0 && py < wp->sy) ||
|
(wp->yoff == 0 && py < wp->sy) ||
|
||||||
(py >= wp->yoff && py < wp->yoff + wp->sy)) &&
|
((int)py >= wp->yoff && py < wp->yoff + wp->sy)) &&
|
||||||
((sb_pos == PANE_SCROLLBARS_RIGHT &&
|
((sb_pos == PANE_SCROLLBARS_RIGHT &&
|
||||||
(int)px < (int)wp->xoff + (int)wp->sx + sb_pad + sb_w) ||
|
(int)px < (int)wp->xoff + (int)wp->sx + sb_pad + sb_w) ||
|
||||||
(sb_pos == PANE_SCROLLBARS_LEFT &&
|
(sb_pos == PANE_SCROLLBARS_LEFT &&
|
||||||
@@ -1058,6 +1058,8 @@ server_client_is_assume_paste(struct client *c)
|
|||||||
return (0);
|
return (0);
|
||||||
if ((t = options_get_number(s->options, "assume-paste-time")) == 0)
|
if ((t = options_get_number(s->options, "assume-paste-time")) == 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
if (tty_term_has(c->tty.term, TTYC_ENBP))
|
||||||
|
return (0);
|
||||||
|
|
||||||
timersub(&c->activity_time, &c->last_activity_time, &tv);
|
timersub(&c->activity_time, &c->last_activity_time, &tv);
|
||||||
if (tv.tv_sec == 0 && tv.tv_usec < t * 1000) {
|
if (tv.tv_sec == 0 && tv.tv_usec < t * 1000) {
|
||||||
|
|||||||
34
tmux.h
34
tmux.h
@@ -1115,8 +1115,8 @@ struct screen_redraw_ctx {
|
|||||||
|
|
||||||
u_int sx;
|
u_int sx;
|
||||||
u_int sy;
|
u_int sy;
|
||||||
u_int ox;
|
int ox;
|
||||||
u_int oy;
|
int oy;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Screen size. */
|
/* Screen size. */
|
||||||
@@ -1231,6 +1231,19 @@ enum client_theme {
|
|||||||
THEME_DARK
|
THEME_DARK
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Visible range array element. */
|
||||||
|
struct visible_range {
|
||||||
|
u_int px; /* start */
|
||||||
|
u_int nx; /* length */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Visible areas not obstructed. */
|
||||||
|
struct visible_ranges {
|
||||||
|
struct visible_range *ranges; /* dynamically allocated array */
|
||||||
|
u_int used; /* number of entries in ranges */
|
||||||
|
u_int size; /* allocated capacity of ranges */
|
||||||
|
};
|
||||||
|
|
||||||
/* Child window structure. */
|
/* Child window structure. */
|
||||||
struct window_pane {
|
struct window_pane {
|
||||||
u_int id;
|
u_int id;
|
||||||
@@ -1245,8 +1258,8 @@ struct window_pane {
|
|||||||
u_int sx;
|
u_int sx;
|
||||||
u_int sy;
|
u_int sy;
|
||||||
|
|
||||||
u_int xoff;
|
int xoff;
|
||||||
u_int yoff;
|
int yoff;
|
||||||
|
|
||||||
int flags;
|
int flags;
|
||||||
#define PANE_REDRAW 0x1
|
#define PANE_REDRAW 0x1
|
||||||
@@ -1589,19 +1602,6 @@ struct key_event {
|
|||||||
size_t len;
|
size_t len;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Visible range array element. */
|
|
||||||
struct visible_range {
|
|
||||||
u_int px; /* start */
|
|
||||||
u_int nx; /* length */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Visible areas not obstructed. */
|
|
||||||
struct visible_ranges {
|
|
||||||
struct visible_range *ranges; /* dynamically allocated array */
|
|
||||||
u_int used; /* number of entries in ranges */
|
|
||||||
u_int size; /* allocated capacity of ranges */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Terminal definition. */
|
/* Terminal definition. */
|
||||||
struct tty_term {
|
struct tty_term {
|
||||||
char *name;
|
char *name;
|
||||||
|
|||||||
Reference in New Issue
Block a user