mirror of
https://github.com/tmux/tmux.git
synced 2025-12-21 06:46:08 +00:00
Fix y offset of mouse if status at top. GitHub issue 4738 from Michael
Grant.
This commit is contained in:
@@ -1024,6 +1024,11 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
|
|||||||
int sx = ctx->sx, sy = ctx->sy, xoff = wp->xoff;
|
int sx = ctx->sx, sy = ctx->sy, xoff = wp->xoff;
|
||||||
int yoff = wp->yoff;
|
int yoff = wp->yoff;
|
||||||
|
|
||||||
|
if (ctx->statustop) {
|
||||||
|
sb_y += ctx->statuslines;
|
||||||
|
sy += ctx->statuslines;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set up style for slider. */
|
/* Set up style for slider. */
|
||||||
gc = sb_style->gc;
|
gc = sb_style->gc;
|
||||||
memcpy(&slgc, &gc, sizeof slgc);
|
memcpy(&slgc, &gc, sizeof slgc);
|
||||||
|
|||||||
@@ -1275,7 +1275,11 @@ have_event:
|
|||||||
if (c->tty.mouse_scrolling_flag == 0 &&
|
if (c->tty.mouse_scrolling_flag == 0 &&
|
||||||
where == SCROLLBAR_SLIDER) {
|
where == SCROLLBAR_SLIDER) {
|
||||||
c->tty.mouse_scrolling_flag = 1;
|
c->tty.mouse_scrolling_flag = 1;
|
||||||
c->tty.mouse_slider_mpos = sl_mpos;
|
if (m->statusat == 0) {
|
||||||
|
c->tty.mouse_slider_mpos = sl_mpos +
|
||||||
|
m->statuslines;
|
||||||
|
} else
|
||||||
|
c->tty.mouse_slider_mpos = sl_mpos;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WHEEL:
|
case WHEEL:
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ window_copy_scroll1(struct window_mode_entry *wme, struct window_pane *wp,
|
|||||||
new_slider_y = sb_top - wp->yoff + (sb_height - slider_height);
|
new_slider_y = sb_top - wp->yoff + (sb_height - slider_height);
|
||||||
} else {
|
} else {
|
||||||
/* Slider is somewhere in the middle. */
|
/* Slider is somewhere in the middle. */
|
||||||
new_slider_y = my - wp->yoff - sl_mpos + 1;
|
new_slider_y = my - wp->yoff - sl_mpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TAILQ_FIRST(&wp->modes) == NULL ||
|
if (TAILQ_FIRST(&wp->modes) == NULL ||
|
||||||
|
|||||||
Reference in New Issue
Block a user