From 78b9096c3828ebd66caa4eded32c035d3d43b5a6 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 28 Oct 2024 08:48:55 +0000 Subject: [PATCH] Remove mouse and tidy. --- cmd-copy-mode.c | 11 +- key-bindings.c | 3 - layout.c | 44 ++-- options.c | 9 +- screen-redraw.c | 8 +- server-client.c | 522 +++++------------------------------------------- tmux.1 | 39 +--- tmux.h | 29 +-- window-copy.c | 141 +------------ window.c | 19 +- 10 files changed, 109 insertions(+), 716 deletions(-) diff --git a/cmd-copy-mode.c b/cmd-copy-mode.c index 7655d541..5e9b444e 100644 --- a/cmd-copy-mode.c +++ b/cmd-copy-mode.c @@ -30,8 +30,8 @@ const struct cmd_entry cmd_copy_mode_entry = { .name = "copy-mode", .alias = NULL, - .args = { "deHMs:t:uqS", 0, 0, NULL }, - .usage = "[-deHMuqS] [-s src-pane] " CMD_TARGET_PANE_USAGE, + .args = { "deHMs:t:uq", 0, 0, NULL }, + .usage = "[-deHMuq] [-s src-pane] " CMD_TARGET_PANE_USAGE, .source = { 's', CMD_FIND_PANE, 0 }, .target = { 't', CMD_FIND_PANE, 0 }, @@ -92,12 +92,7 @@ cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item) if (args_has(args, 'u')) window_copy_pageup(wp, 0); if (args_has(args, 'd')) - window_copy_pagedown(wp, 0, args_has(args, 'e')); - if (args_has(args, 'S')) { - window_copy_scroll(wp, c->tty.mouse_slider_mpos, - event->m.y, args_has(args, 'e')); - return (CMD_RETURN_NORMAL); - } + window_copy_pagedown(wp, 0, args_has(args, 'e')); return (CMD_RETURN_NORMAL); } diff --git a/key-bindings.c b/key-bindings.c index 4dec1543..6d2a0109 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -640,9 +640,6 @@ key_bindings_init(void) "bind -Tcopy-mode-vi M-x { send -X jump-to-mark }", "bind -Tcopy-mode-vi C-Up { send -X scroll-up }", "bind -Tcopy-mode-vi C-Down { send -X scroll-down }", - "bind -n MouseDown1ScrollbarUp { copy-mode -u }", - "bind -n MouseDown1ScrollbarDown { copy-mode -d }", - "bind -n MouseDrag1ScrollbarSlider { copy-mode -S }" }; u_int i; struct cmd_parse_result *pr; diff --git a/layout.c b/layout.c index cfafc8ca..c1840c5d 100644 --- a/layout.c +++ b/layout.c @@ -119,7 +119,7 @@ layout_print_cell(struct layout_cell *lc, const char *hdr, u_int n) case LAYOUT_LEFTRIGHT: case LAYOUT_TOPBOTTOM: TAILQ_FOREACH(lcchild, &lc->cells, entry) - layout_print_cell(lcchild, hdr, n + 1); + layout_print_cell(lcchild, hdr, n + 1); break; case LAYOUT_WINDOWPANE: break; @@ -230,7 +230,7 @@ layout_fix_offsets1(struct layout_cell *lc) void layout_fix_offsets(struct window *w) { - struct layout_cell *lc = w->layout_root; + struct layout_cell *lc = w->layout_root; lc->xoff = 0; lc->yoff = 0; @@ -291,14 +291,12 @@ layout_fix_panes(struct window *w, struct window_pane *skip) { struct window_pane *wp; struct layout_cell *lc; - int status, scrollbars, sb_pos, sb_w; - u_int sx, sy; - u_int mode; + int status, scrollbars, sb_pos; + u_int sx, sy, mode; status = options_get_number(w->options, "pane-border-status"); scrollbars = options_get_number(w->options, "pane-scrollbars"); sb_pos = options_get_number(w->options, "pane-scrollbars-position"); - sb_w = PANE_SCROLLBARS_WIDTH; TAILQ_FOREACH(wp, &w->panes, entry) { if ((lc = wp->layout_cell) == NULL || wp == skip) @@ -312,21 +310,18 @@ layout_fix_panes(struct window *w, struct window_pane *skip) if (layout_add_horizontal_border(w, lc, status)) { if (status == PANE_STATUS_TOP) wp->yoff++; - sy = sy - 1; + sy--; } mode = window_pane_mode(wp); - - if ((scrollbars == PANE_SCROLLBARS_ALWAYS) || + if (scrollbars == PANE_SCROLLBARS_ALWAYS || (scrollbars == PANE_SCROLLBARS_MODAL && - mode != WINDOW_PANE_NO_MODE)) { + mode != WINDOW_PANE_NO_MODE)) { if (sb_pos == PANE_SCROLLBARS_LEFT) { - sx = sx - sb_w; - wp->xoff = wp->xoff + sb_w; - } else { - /* sb_pos == PANE_SCROLLBARS_RIGHT */ - sx = sx - sb_w; - } + sx = sx - PANE_SCROLLBARS_WIDTH; + wp->xoff = wp->xoff + PANE_SCROLLBARS_WIDTH; + } else /* sb_pos == PANE_SCROLLBARS_RIGHT */ + sx = sx - PANE_SCROLLBARS_WIDTH; wp->flags |= PANE_REDRAWSCROLLBAR; } @@ -362,18 +357,17 @@ layout_resize_check(struct window *w, struct layout_cell *lc, { struct layout_cell *lcchild; u_int available, minimum; - int status, scrollbars, sb_w; + int status, scrollbars; status = options_get_number(w->options, "pane-border-status"); scrollbars = options_get_number(w->options, "pane-scrollbars"); - sb_w = PANE_SCROLLBARS_WIDTH; if (lc->type == LAYOUT_WINDOWPANE) { /* Space available in this cell only. */ if (type == LAYOUT_LEFTRIGHT) { available = lc->sx; if (scrollbars) - minimum = PANE_MINIMUM + sb_w; + minimum = PANE_MINIMUM + PANE_SCROLLBARS_WIDTH; else minimum = PANE_MINIMUM; } else { @@ -903,8 +897,8 @@ layout_split_pane(struct window_pane *wp, enum layout_type type, int size, struct layout_cell *lc, *lcparent, *lcnew, *lc1, *lc2; u_int sx, sy, xoff, yoff, size1, size2, minimum; u_int new_size, saved_size, resize_first = 0; - int full_size = (flags & SPAWN_FULLSIZE); - int status, scrollbars, sb_w; + int full_size = (flags & SPAWN_FULLSIZE), status; + int scrollbars; /* * If full_size is specified, add a new cell at the top of the window @@ -916,7 +910,6 @@ layout_split_pane(struct window_pane *wp, enum layout_type type, int size, lc = wp->layout_cell; status = options_get_number(wp->window->options, "pane-border-status"); scrollbars = options_get_number(wp->window->options, "pane-scrollbars"); - sb_w = PANE_SCROLLBARS_WIDTH; /* Copy the old cell size. */ sx = lc->sx; @@ -928,7 +921,7 @@ layout_split_pane(struct window_pane *wp, enum layout_type type, int size, switch (type) { case LAYOUT_LEFTRIGHT: if (scrollbars) - minimum = PANE_MINIMUM * 2 + sb_w; + minimum = PANE_MINIMUM * 2 + PANE_SCROLLBARS_WIDTH; else minimum = PANE_MINIMUM * 2 + 1; if (sx < minimum) @@ -1092,7 +1085,7 @@ layout_spread_cell(struct window *w, struct layout_cell *parent) { struct layout_cell *lc; u_int number, each, size, this; - int change, changed, status, scrollbars, sb_w; + int change, changed, status, scrollbars; number = 0; TAILQ_FOREACH (lc, &parent->cells, entry) @@ -1101,11 +1094,10 @@ layout_spread_cell(struct window *w, struct layout_cell *parent) return (0); status = options_get_number(w->options, "pane-border-status"); scrollbars = options_get_number(w->options, "pane-scrollbars"); - sb_w = PANE_SCROLLBARS_WIDTH; if (parent->type == LAYOUT_LEFTRIGHT) { if (scrollbars) - size = parent->sx - sb_w; + size = parent->sx - PANE_SCROLLBARS_WIDTH; else size = parent->sx; } diff --git a/options.c b/options.c index 6576064a..854d4f45 100644 --- a/options.c +++ b/options.c @@ -425,7 +425,7 @@ options_array_set(struct options_entry *o, u_int idx, const char *value, struct options_array_item *a; char *new; struct cmd_parse_result *pr; - long long number; + long long number; if (!OPTIONS_IS_ARRAY(o)) { if (cause != NULL) @@ -1171,11 +1171,8 @@ options_push_changes(const char *name) RB_FOREACH(wp, window_pane_tree, &all_window_panes) colour_palette_from_option(&wp->palette, wp->options); } - if (strcmp(name, "pane-border-status") == 0) { - RB_FOREACH(w, windows, &windows) - layout_fix_panes(w, NULL); - } - if (strcmp(name, "pane-scrollbars") == 0 || + if (strcmp(name, "pane-border-status") == 0 || + strcmp(name, "pane-scrollbars") == 0 || strcmp(name, "pane-scrollbars-position") == 0) { RB_FOREACH(w, windows, &windows) layout_fix_panes(w, NULL); diff --git a/screen-redraw.c b/screen-redraw.c index a8a3ff83..266ce1ee 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -1128,12 +1128,8 @@ screen_redraw_draw_pane_scrollbar(struct screen_redraw_ctx *ctx, if (slider_y >= sb_h) slider_y = sb_h - 1; - screen_redraw_draw_scrollbar(c, wp, sb_pos, sb_x, sb_y, sb_h, - slider_h, slider_y); - - /* Store current position and height of the slider */ - wp->sb_slider_y = slider_y; /* top of slider y pos in scrollbar */ - wp->sb_slider_h = slider_h; /* height of slider */ + screen_redraw_draw_scrollbar(c, wp, sb_pos, sb_x, sb_y, sb_h, slider_h, + slider_y); } static void diff --git a/server-client.c b/server-client.c index 2ce9a816..145143db 100644 --- a/server-client.c +++ b/server-client.c @@ -66,7 +66,7 @@ RB_GENERATE(client_windows, client_window, entry, server_client_window_cmp); u_int server_client_how_many(void) { - struct client *c; + struct client *c; u_int n; n = 0; @@ -572,7 +572,6 @@ server_client_check_mouse(struct client *c, struct key_event *event) { struct mouse_event *m = &event->m; struct session *s = c->session, *fs; - struct options *wo = s->curw->window->options; struct winlink *fwl; struct window_pane *wp, *fwp; u_int x, y, b, sx, sy, px, py; @@ -580,9 +579,6 @@ server_client_check_mouse(struct client *c, struct key_event *event) key_code key; struct timeval tv; struct style_range *sr; - int pane_scrollbars, sb_w, pane_status; - u_int line = 0, sb_pos; - u_int slider_top, slider_bottom, where_in_slider = 0; enum { NOTYPE, MOVE, DOWN, @@ -598,11 +594,7 @@ server_client_check_mouse(struct client *c, struct key_event *event) STATUS_LEFT, STATUS_RIGHT, STATUS_DEFAULT, - BORDER, - SCROLLBAR_UP, - SCROLLBAR_SLIDER, - SCROLLBAR_DOWN, - } where = NOWHERE; + BORDER } where = NOWHERE; log_debug("%s mouse %02x at %u,%u (last %u,%u) (%d)", c->name, m->b, m->x, m->y, m->lx, m->ly, c->tty.mouse_drag_flag); @@ -751,117 +743,54 @@ have_event: } } - /* - * Not on status line. Adjust position and check for - * border, pane, or scrollbar. - */ + /* Not on status line. Adjust position and check for border or pane. */ if (where == NOWHERE) { - if (c->tty.mouse_scrolling_flag) { - where = SCROLLBAR_SLIDER; - } else { - px = x; - if (m->statusat == 0 && y >= m->statuslines) - py = y - m->statuslines; - else if (m->statusat > 0 && y >= (u_int)m->statusat) - py = m->statusat - 1; - else - py = y; + px = x; + if (m->statusat == 0 && y >= m->statuslines) + py = y - m->statuslines; + else if (m->statusat > 0 && y >= (u_int)m->statusat) + py = m->statusat - 1; + else + py = y; - tty_window_offset(&c->tty, &m->ox, &m->oy, &sx, &sy); - log_debug("mouse window @%u at %u,%u (%ux%u)", - s->curw->window->id, m->ox, m->oy, sx, sy); - if (px > sx || py > sy) - return (KEYC_UNKNOWN); - px = px + m->ox; - py = py + m->oy; + tty_window_offset(&c->tty, &m->ox, &m->oy, &sx, &sy); + log_debug("mouse window @%u at %u,%u (%ux%u)", + s->curw->window->id, m->ox, m->oy, sx, sy); + if (px > sx || py > sy) + return (KEYC_UNKNOWN); + px = px + m->ox; + py = py + m->oy; - /* try inside the pane. */ - wp = window_get_active_at(s->curw->window, px, py); - - if (wp == NULL) - return (KEYC_UNKNOWN); - - /* Try the scrollbar which is actually next to a pane */ - pane_scrollbars = options_get_number(wo, "pane-scrollbars"); - sb_pos = options_get_number(wo, "pane-scrollbars-position"); - if (pane_scrollbars == PANE_SCROLLBARS_ALWAYS || - (pane_scrollbars == PANE_SCROLLBARS_MODAL && - window_pane_mode(wp) != WINDOW_PANE_NO_MODE)) - sb_w = PANE_SCROLLBARS_WIDTH; - else - sb_w = 0; - - pane_status = options_get_number(wo, "pane-border-status"); - - if (pane_status == PANE_STATUS_TOP) - line = wp->yoff - 1; - else if (pane_status == PANE_STATUS_BOTTOM) - line = wp->yoff + wp->sy; - - /* check if py could lie within a scroller - * if pane at the top then py==0 included - * if pane not at the top, then yoff to yoff+sy - */ - if ((pane_status && py != line) || - (wp->yoff == 0 && py < wp->sy) || - (py >= wp->yoff && py < wp->yoff + wp->sy)) { - - /* check if px lies within a scroller - log_debug("wps @%u at %u,%u (%ux%u)", wp->id, - m->ox, m->oy, px, py); - */ - if ((sb_pos == PANE_SCROLLBARS_RIGHT && - (px >= wp->xoff + wp->sx && - px < wp->xoff + wp->sx + sb_w)) || - (sb_pos == PANE_SCROLLBARS_LEFT && - (px >= wp->xoff - sb_w && - px < wp->xoff))) { - - /* definitely in the scrollbar */ - slider_top = wp->yoff + wp->sb_slider_y; - slider_bottom = wp->yoff + wp->sb_slider_y + wp->sb_slider_h - 1; - if (py < slider_top) - where = SCROLLBAR_UP; - else if (py >= slider_top && - py <= slider_bottom) { - where = SCROLLBAR_SLIDER; - where_in_slider = py - wp->sb_slider_y - wp->yoff; - } else - /* py > slider_bottom */ - where = SCROLLBAR_DOWN; - } else { - where = PANE; - } - } else { - /* Try the pane borders if not zoomed. */ - if (~s->curw->window->flags & WINDOW_ZOOMED) { - TAILQ_FOREACH(wp, &s->curw->window->panes, entry) { - if ((wp->xoff + wp->sx == px && - wp->yoff <= 1 + py && - wp->yoff + wp->sy >= py) || - (wp->yoff + wp->sy == py && - wp->xoff <= 1 + px && - wp->xoff + wp->sx >= px)) - break; - } - if (wp != NULL) - where = BORDER; - } + /* Try the pane borders if not zoomed. */ + if (~s->curw->window->flags & WINDOW_ZOOMED) { + TAILQ_FOREACH(wp, &s->curw->window->panes, entry) { + if ((wp->xoff + wp->sx == px && + wp->yoff <= 1 + py && + wp->yoff + wp->sy >= py) || + (wp->yoff + wp->sy == py && + wp->xoff <= 1 + px && + wp->xoff + wp->sx >= px)) + break; } - - if (where == PANE) - log_debug("mouse %u,%u on pane %%%u", x, y, wp->id); - else if (where == BORDER) - log_debug("mouse on pane %%%u border", wp->id); - else if (where == SCROLLBAR_UP || - where == SCROLLBAR_SLIDER || - where == SCROLLBAR_DOWN) - log_debug("mouse on pane %%%u scrollbar", wp->id); - m->wp = wp->id; - m->w = wp->window->id; + if (wp != NULL) + where = BORDER; } - } else - m->wp = -1; + + /* Otherwise try inside the pane. */ + if (where == NOWHERE) { + wp = window_get_active_at(s->curw->window, px, py); + if (wp != NULL) + where = PANE; + else + return (KEYC_UNKNOWN); + } + if (where == PANE) + log_debug("mouse %u,%u on pane %%%u", x, y, wp->id); + else if (where == BORDER) + log_debug("mouse on pane %%%u border", wp->id); + m->wp = wp->id; + m->w = wp->window->id; + } /* Stop dragging if needed. */ if (type != DRAG && type != WHEEL && c->tty.mouse_drag_flag != 0) { @@ -870,7 +799,6 @@ have_event: c->tty.mouse_drag_update = NULL; c->tty.mouse_drag_release = NULL; - c->tty.mouse_scrolling_flag = 0; /* * End a mouse drag by passing a MouseDragEnd key corresponding @@ -888,8 +816,6 @@ have_event: key = KEYC_MOUSEDRAGEND1_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAGEND1_STATUS_DEFAULT; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAGEND1_SCROLLBAR_SLIDER; if (where == BORDER) key = KEYC_MOUSEDRAGEND1_BORDER; break; @@ -904,8 +830,6 @@ have_event: key = KEYC_MOUSEDRAGEND2_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAGEND2_STATUS_DEFAULT; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAGEND2_SCROLLBAR_SLIDER; if (where == BORDER) key = KEYC_MOUSEDRAGEND2_BORDER; break; @@ -920,8 +844,6 @@ have_event: key = KEYC_MOUSEDRAGEND3_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAGEND3_STATUS_DEFAULT; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAGEND3_SCROLLBAR_SLIDER; if (where == BORDER) key = KEYC_MOUSEDRAGEND3_BORDER; break; @@ -936,8 +858,6 @@ have_event: key = KEYC_MOUSEDRAGEND6_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAGEND6_STATUS_DEFAULT; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAGEND6_SCROLLBAR_SLIDER; if (where == BORDER) key = KEYC_MOUSEDRAGEND6_BORDER; break; @@ -952,8 +872,6 @@ have_event: key = KEYC_MOUSEDRAGEND7_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAGEND7_STATUS_DEFAULT; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAGEND7_SCROLLBAR_SLIDER; if (where == BORDER) key = KEYC_MOUSEDRAGEND7_BORDER; break; @@ -968,8 +886,6 @@ have_event: key = KEYC_MOUSEDRAGEND8_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAGEND8_STATUS_DEFAULT; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAGEND8_SCROLLBAR_SLIDER; if (where == BORDER) key = KEYC_MOUSEDRAGEND8_BORDER; break; @@ -984,8 +900,6 @@ have_event: key = KEYC_MOUSEDRAGEND9_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAGEND9_STATUS_DEFAULT; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAGEND9_SCROLLBAR_SLIDER; if (where == BORDER) key = KEYC_MOUSEDRAGEND9_BORDER; break; @@ -1000,8 +914,6 @@ have_event: key = KEYC_MOUSEDRAGEND10_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAGEND10_STATUS_DEFAULT; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAGEND10_SCROLLBAR_SLIDER; if (where == BORDER) key = KEYC_MOUSEDRAGEND10_BORDER; break; @@ -1016,8 +928,6 @@ have_event: key = KEYC_MOUSEDRAGEND11_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAGEND11_STATUS_DEFAULT; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAGEND11_SCROLLBAR_SLIDER; if (where == BORDER) key = KEYC_MOUSEDRAGEND11_BORDER; break; @@ -1026,7 +936,6 @@ have_event: break; } c->tty.mouse_drag_flag = 0; - c->tty.mouse_slider_mpos = -1; goto out; } @@ -1065,12 +974,6 @@ have_event: key = KEYC_MOUSEDRAG1_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAG1_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDRAG1_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAG1_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDRAG1_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDRAG1_BORDER; break; @@ -1085,12 +988,6 @@ have_event: key = KEYC_MOUSEDRAG2_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAG2_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDRAG2_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAG2_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDRAG2_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDRAG2_BORDER; break; @@ -1105,12 +1002,6 @@ have_event: key = KEYC_MOUSEDRAG3_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAG3_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDRAG3_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAG3_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDRAG3_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDRAG3_BORDER; break; @@ -1125,12 +1016,6 @@ have_event: key = KEYC_MOUSEDRAG6_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAG6_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDRAG6_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAG6_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDRAG6_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDRAG6_BORDER; break; @@ -1145,12 +1030,6 @@ have_event: key = KEYC_MOUSEDRAG7_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAG7_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDRAG7_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAG7_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDRAG7_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDRAG7_BORDER; break; @@ -1165,12 +1044,6 @@ have_event: key = KEYC_MOUSEDRAG8_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAG8_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDRAG8_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAG8_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDRAG8_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDRAG8_BORDER; break; @@ -1185,12 +1058,6 @@ have_event: key = KEYC_MOUSEDRAG9_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAG9_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDRAG9_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAG9_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDRAG9_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDRAG9_BORDER; break; @@ -1205,12 +1072,6 @@ have_event: key = KEYC_MOUSEDRAG10_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAG10_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDRAG10_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAG10_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDRAG10_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDRAG10_BORDER; break; @@ -1225,12 +1086,6 @@ have_event: key = KEYC_MOUSEDRAG11_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDRAG11_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDRAG11_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDRAG11_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDRAG11_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDRAG11_BORDER; break; @@ -1239,16 +1094,9 @@ have_event: /* * Begin a drag by setting the flag to a non-zero value that - * corresponds to the mouse button in use. If starting to - * drag the scrollbar, store the relative position in the - * slider where the user grabed. + * corresponds to the mouse button in use. */ c->tty.mouse_drag_flag = MOUSE_BUTTONS(b) + 1; - if (c->tty.mouse_scrolling_flag == 0 && - where == SCROLLBAR_SLIDER) { - c->tty.mouse_scrolling_flag = 1; - c->tty.mouse_slider_mpos = where_in_slider; - } break; case WHEEL: if (MOUSE_BUTTONS(b) == MOUSE_WHEEL_UP) { @@ -1292,12 +1140,6 @@ have_event: key = KEYC_MOUSEUP1_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEUP1_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEUP1_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEUP1_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEUP1_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEUP1_BORDER; break; @@ -1312,12 +1154,6 @@ have_event: key = KEYC_MOUSEUP2_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEUP2_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEUP2_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEUP2_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEUP2_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEUP2_BORDER; break; @@ -1332,12 +1168,6 @@ have_event: key = KEYC_MOUSEUP3_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEUP3_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEUP3_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEUP3_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEUP3_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEUP3_BORDER; break; @@ -1352,12 +1182,6 @@ have_event: key = KEYC_MOUSEUP6_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEUP6_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEUP6_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEUP6_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEUP6_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEUP6_BORDER; break; @@ -1372,12 +1196,6 @@ have_event: key = KEYC_MOUSEUP7_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEUP7_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEUP7_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEUP7_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEUP7_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEUP7_BORDER; break; @@ -1392,12 +1210,6 @@ have_event: key = KEYC_MOUSEUP8_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEUP8_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEUP8_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEUP8_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEUP8_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEUP8_BORDER; break; @@ -1412,12 +1224,6 @@ have_event: key = KEYC_MOUSEUP9_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEUP9_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEUP9_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEUP9_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEUP9_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEUP9_BORDER; break; @@ -1431,13 +1237,7 @@ have_event: if (where == STATUS_RIGHT) key = KEYC_MOUSEUP1_STATUS_RIGHT; if (where == STATUS_DEFAULT) - key = KEYC_MOUSEUP10_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEUP10_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEUP10_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEUP1_SCROLLBAR_DOWN; + key = KEYC_MOUSEUP1_STATUS_DEFAULT; if (where == BORDER) key = KEYC_MOUSEUP1_BORDER; break; @@ -1452,12 +1252,6 @@ have_event: key = KEYC_MOUSEUP11_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEUP11_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEUP11_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEUP11_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEUP11_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEUP11_BORDER; break; @@ -1476,12 +1270,6 @@ have_event: key = KEYC_MOUSEDOWN1_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDOWN1_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDOWN1_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDOWN1_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDOWN1_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDOWN1_BORDER; break; @@ -1496,12 +1284,6 @@ have_event: key = KEYC_MOUSEDOWN2_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDOWN2_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDOWN2_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDOWN2_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDOWN2_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDOWN2_BORDER; break; @@ -1516,12 +1298,6 @@ have_event: key = KEYC_MOUSEDOWN3_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDOWN3_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDOWN3_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDOWN3_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDOWN3_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDOWN3_BORDER; break; @@ -1536,12 +1312,6 @@ have_event: key = KEYC_MOUSEDOWN6_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDOWN6_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDOWN6_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDOWN6_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDOWN6_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDOWN6_BORDER; break; @@ -1556,12 +1326,6 @@ have_event: key = KEYC_MOUSEDOWN7_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDOWN7_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDOWN7_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDOWN7_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDOWN7_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDOWN7_BORDER; break; @@ -1576,12 +1340,6 @@ have_event: key = KEYC_MOUSEDOWN8_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDOWN8_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDOWN8_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDOWN8_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDOWN8_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDOWN8_BORDER; break; @@ -1596,12 +1354,6 @@ have_event: key = KEYC_MOUSEDOWN9_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDOWN9_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDOWN9_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDOWN9_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDOWN9_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDOWN9_BORDER; break; @@ -1616,12 +1368,6 @@ have_event: key = KEYC_MOUSEDOWN10_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDOWN10_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDOWN10_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDOWN10_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDOWN10_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDOWN10_BORDER; break; @@ -1636,12 +1382,6 @@ have_event: key = KEYC_MOUSEDOWN11_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_MOUSEDOWN11_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_MOUSEDOWN11_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_MOUSEDOWN11_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_MOUSEDOWN11_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_MOUSEDOWN11_BORDER; break; @@ -1660,12 +1400,6 @@ have_event: key = KEYC_SECONDCLICK1_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_SECONDCLICK1_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_SECONDCLICK1_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_SECONDCLICK1_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_SECONDCLICK1_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_SECONDCLICK1_BORDER; break; @@ -1680,12 +1414,6 @@ have_event: key = KEYC_SECONDCLICK2_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_SECONDCLICK2_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_SECONDCLICK2_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_SECONDCLICK2_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_SECONDCLICK2_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_SECONDCLICK2_BORDER; break; @@ -1700,12 +1428,6 @@ have_event: key = KEYC_SECONDCLICK3_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_SECONDCLICK3_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_SECONDCLICK3_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_SECONDCLICK3_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_SECONDCLICK3_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_SECONDCLICK3_BORDER; break; @@ -1720,12 +1442,6 @@ have_event: key = KEYC_SECONDCLICK6_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_SECONDCLICK6_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_SECONDCLICK6_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_SECONDCLICK6_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_SECONDCLICK6_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_SECONDCLICK6_BORDER; break; @@ -1740,12 +1456,6 @@ have_event: key = KEYC_SECONDCLICK7_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_SECONDCLICK7_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_SECONDCLICK7_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_SECONDCLICK7_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_SECONDCLICK7_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_SECONDCLICK7_BORDER; break; @@ -1760,12 +1470,6 @@ have_event: key = KEYC_SECONDCLICK8_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_SECONDCLICK8_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_SECONDCLICK8_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_SECONDCLICK8_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_SECONDCLICK8_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_SECONDCLICK8_BORDER; break; @@ -1780,12 +1484,6 @@ have_event: key = KEYC_SECONDCLICK9_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_SECONDCLICK9_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_SECONDCLICK9_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_SECONDCLICK9_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_SECONDCLICK9_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_SECONDCLICK9_BORDER; break; @@ -1800,12 +1498,6 @@ have_event: key = KEYC_SECONDCLICK10_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_SECONDCLICK10_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_SECONDCLICK10_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_SECONDCLICK10_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_SECONDCLICK10_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_SECONDCLICK10_BORDER; break; @@ -1820,12 +1512,6 @@ have_event: key = KEYC_SECONDCLICK11_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_SECONDCLICK11_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_SECONDCLICK11_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_SECONDCLICK11_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_SECONDCLICK11_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_SECONDCLICK11_BORDER; break; @@ -1844,12 +1530,6 @@ have_event: key = KEYC_DOUBLECLICK1_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_DOUBLECLICK1_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_DOUBLECLICK1_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_DOUBLECLICK1_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_DOUBLECLICK1_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_DOUBLECLICK1_BORDER; break; @@ -1864,12 +1544,6 @@ have_event: key = KEYC_DOUBLECLICK2_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_DOUBLECLICK2_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_DOUBLECLICK2_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_DOUBLECLICK2_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_DOUBLECLICK2_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_DOUBLECLICK2_BORDER; break; @@ -1884,12 +1558,6 @@ have_event: key = KEYC_DOUBLECLICK3_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_DOUBLECLICK3_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_DOUBLECLICK3_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_DOUBLECLICK3_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_DOUBLECLICK3_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_DOUBLECLICK3_BORDER; break; @@ -1904,12 +1572,6 @@ have_event: key = KEYC_DOUBLECLICK6_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_DOUBLECLICK6_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_DOUBLECLICK6_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_DOUBLECLICK6_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_DOUBLECLICK6_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_DOUBLECLICK6_BORDER; break; @@ -1924,12 +1586,6 @@ have_event: key = KEYC_DOUBLECLICK7_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_DOUBLECLICK7_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_DOUBLECLICK7_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_DOUBLECLICK7_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_DOUBLECLICK7_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_DOUBLECLICK7_BORDER; break; @@ -1944,12 +1600,6 @@ have_event: key = KEYC_DOUBLECLICK8_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_DOUBLECLICK8_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_DOUBLECLICK8_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_DOUBLECLICK8_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_DOUBLECLICK8_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_DOUBLECLICK8_BORDER; break; @@ -1964,12 +1614,6 @@ have_event: key = KEYC_DOUBLECLICK9_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_DOUBLECLICK9_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_DOUBLECLICK9_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_DOUBLECLICK9_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_DOUBLECLICK9_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_DOUBLECLICK9_BORDER; break; @@ -1984,12 +1628,6 @@ have_event: key = KEYC_DOUBLECLICK10_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_DOUBLECLICK10_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_DOUBLECLICK10_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_DOUBLECLICK10_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_DOUBLECLICK10_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_DOUBLECLICK10_BORDER; break; @@ -2004,12 +1642,6 @@ have_event: key = KEYC_DOUBLECLICK11_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_DOUBLECLICK11_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_DOUBLECLICK11_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_DOUBLECLICK11_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_DOUBLECLICK11_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_DOUBLECLICK11_BORDER; break; @@ -2028,12 +1660,6 @@ have_event: key = KEYC_TRIPLECLICK1_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_TRIPLECLICK1_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_TRIPLECLICK1_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_TRIPLECLICK1_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_TRIPLECLICK1_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_TRIPLECLICK1_BORDER; break; @@ -2048,12 +1674,6 @@ have_event: key = KEYC_TRIPLECLICK2_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_TRIPLECLICK2_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_TRIPLECLICK2_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_TRIPLECLICK2_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_TRIPLECLICK2_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_TRIPLECLICK2_BORDER; break; @@ -2068,12 +1688,6 @@ have_event: key = KEYC_TRIPLECLICK3_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_TRIPLECLICK3_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_TRIPLECLICK3_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_TRIPLECLICK3_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_TRIPLECLICK3_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_TRIPLECLICK3_BORDER; break; @@ -2088,12 +1702,6 @@ have_event: key = KEYC_TRIPLECLICK6_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_TRIPLECLICK6_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_TRIPLECLICK6_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_TRIPLECLICK6_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_TRIPLECLICK6_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_TRIPLECLICK6_BORDER; break; @@ -2108,12 +1716,6 @@ have_event: key = KEYC_TRIPLECLICK7_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_TRIPLECLICK7_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_TRIPLECLICK7_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_TRIPLECLICK7_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_TRIPLECLICK7_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_TRIPLECLICK7_BORDER; break; @@ -2128,12 +1730,6 @@ have_event: key = KEYC_TRIPLECLICK8_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_TRIPLECLICK8_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_TRIPLECLICK8_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_TRIPLECLICK8_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_TRIPLECLICK8_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_TRIPLECLICK8_BORDER; break; @@ -2148,12 +1744,6 @@ have_event: key = KEYC_TRIPLECLICK9_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_TRIPLECLICK9_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_TRIPLECLICK9_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_TRIPLECLICK9_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_TRIPLECLICK9_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_TRIPLECLICK9_BORDER; break; @@ -2168,12 +1758,6 @@ have_event: key = KEYC_TRIPLECLICK10_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_TRIPLECLICK10_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_TRIPLECLICK10_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_TRIPLECLICK10_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_TRIPLECLICK10_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_TRIPLECLICK10_BORDER; break; @@ -2188,12 +1772,6 @@ have_event: key = KEYC_TRIPLECLICK11_STATUS_RIGHT; if (where == STATUS_DEFAULT) key = KEYC_TRIPLECLICK11_STATUS_DEFAULT; - if (where == SCROLLBAR_UP) - key = KEYC_TRIPLECLICK11_SCROLLBAR_UP; - if (where == SCROLLBAR_SLIDER) - key = KEYC_TRIPLECLICK11_SCROLLBAR_SLIDER; - if (where == SCROLLBAR_DOWN) - key = KEYC_TRIPLECLICK11_SCROLLBAR_DOWN; if (where == BORDER) key = KEYC_TRIPLECLICK11_BORDER; break; @@ -2228,7 +1806,7 @@ server_client_is_bracket_paste(struct client *c, key_code key) } if (key == KEYC_PASTE_END) { - c->flags &= ~CLIENT_BRACKETPASTING; + c->flags &= ~CLIENT_BRACKETPASTING; log_debug("%s: bracket paste off", c->name); return (0); } @@ -3159,7 +2737,7 @@ server_client_check_redraw(struct client *c) */ TAILQ_FOREACH(wp, &w->panes, entry) { redraw = 0; - if (wp->flags & (PANE_REDRAW)) + if (wp->flags & PANE_REDRAW) redraw = 1; else if (c->flags & CLIENT_REDRAWPANES) redraw = !!(c->redraw_panes & (1 << bit)); @@ -3683,7 +3261,7 @@ const char * server_client_get_flags(struct client *c) { static char s[256]; - char tmp[32]; + char tmp[32]; *s = '\0'; if (c->flags & CLIENT_ATTACHED) diff --git a/tmux.1 b/tmux.1 index 51f351e7..82efeeb6 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2402,31 +2402,22 @@ The synopsis for the command is: .Bl -tag -width Ds .It Xo Ic copy-mode -.Op Fl deHMquS +.Op Fl deHMqu .Op Fl s Ar src-pane .Op Fl t Ar target-pane .Xc Enter copy mode. -.Pp .Fl u -enters copy mode and scrolls one page up and +also scrolls one page up after entering and .Fl d -one page down. +one page down if already in copy mode. +.Fl M +begins a mouse drag (only valid if bound to a mouse key binding, see +.Sx MOUSE SUPPORT ) . .Fl H hides the position indicator in the top right. .Fl q cancels copy mode and any other modes. -.Pp -.Fl M -begins a mouse drag (only valid if bound to a mouse key binding, see -.Sx MOUSE SUPPORT ) . -.Fl S -scrolls when bound to a mouse drag event; for example, -.Ic copy-mode -Se -is bound to -.Ar MouseDrag1ScrollbarSlider -by default. -.Pp .Fl s copies from .Ar src-pane @@ -5045,8 +5036,6 @@ of each pane. A filled section of the scrollbar, known as the .Ql slider , represents the position and size of the visible part of the pane content. -By default dragging the scrollbar slider up will enter copy mode; in copy -mode dragging the slider will scroll the pane. .Pp If set to .Ic on @@ -5060,16 +5049,8 @@ If set to .Ic modal , the pane is narrowed only when the scrollbar is visible. .Pp -When the -.Ic mouse -option is on, clicking above and below the slider pages up and down and dragging -the slider scrolls the pane. -.Pp See also -.Xr pane-scrollbar-style -and the scrollbar mouse events in the -.Sx MOUSE SUPPORT -section. +.Xr pane-scrollbar-style . .Pp .It Ic pane-scrollbar-style Ar style Set the pane scrollbar style for the currently active pane. @@ -5083,8 +5064,7 @@ Attributes are ignored. .It Xo Ic pane-scrollbars-position .Op Ic left | right .Xc -Sets which side of the pane to display the pane scrollbars on. The -default is right. +Sets which side of the pane to display pane scrollbars on. .Pp .It Ic window-status-activity-style Ar style Set status line style for windows with an activity alert. @@ -5458,9 +5438,6 @@ and a location suffix, one of the following: .It Li "StatusLeft" Ta "the left part of the status line" .It Li "StatusRight" Ta "the right part of the status line" .It Li "StatusDefault" Ta "any other part of the status line" -.It Li "ScrollbarSlider" Ta "the scrollbar slider" -.It Li "ScrollbarUp" Ta "above the scrollbar slider" -.It Li "ScrollbarDown" Ta "below the scrollbar slider" .El .Pp The following mouse events are available: diff --git a/tmux.h b/tmux.h index 7130f78c..1a682262 100644 --- a/tmux.h +++ b/tmux.h @@ -184,19 +184,13 @@ struct winlink; KEYC_ ## name ## _STATUS_LEFT, \ KEYC_ ## name ## _STATUS_RIGHT, \ KEYC_ ## name ## _STATUS_DEFAULT, \ - KEYC_ ## name ## _SCROLLBAR_UP, \ - KEYC_ ## name ## _SCROLLBAR_SLIDER, \ - KEYC_ ## name ## _SCROLLBAR_DOWN, \ KEYC_ ## name ## _BORDER -#define KEYC_MOUSE_STRING(name, s) \ - { #s "Pane", KEYC_ ## name ## _PANE }, \ - { #s "Status", KEYC_ ## name ## _STATUS }, \ - { #s "StatusLeft", KEYC_ ## name ## _STATUS_LEFT }, \ - { #s "StatusRight", KEYC_ ## name ## _STATUS_RIGHT }, \ - { #s "StatusDefault", KEYC_ ## name ## _STATUS_DEFAULT }, \ - { #s "ScrollbarUp", KEYC_ ## name ## _SCROLLBAR_UP }, \ - { #s "ScrollbarSlider", KEYC_ ## name ## _SCROLLBAR_SLIDER }, \ - { #s "ScrollbarDown", KEYC_ ## name ## _SCROLLBAR_DOWN }, \ +#define KEYC_MOUSE_STRING(name, s) \ + { #s "Pane", KEYC_ ## name ## _PANE }, \ + { #s "Status", KEYC_ ## name ## _STATUS }, \ + { #s "StatusLeft", KEYC_ ## name ## _STATUS_LEFT }, \ + { #s "StatusRight", KEYC_ ## name ## _STATUS_RIGHT }, \ + { #s "StatusDefault", KEYC_ ## name ## _STATUS_DEFAULT }, \ { #s "Border", KEYC_ ## name ## _BORDER } /* @@ -1145,9 +1139,6 @@ struct window_pane { #define PANE_UNSEENCHANGES 0x2000 #define PANE_REDRAWSCROLLBAR 0x4000 - u_int sb_slider_y; - u_int sb_slider_h; - int argc; char **argv; char *shell; @@ -1289,10 +1280,12 @@ TAILQ_HEAD(winlink_stack, winlink); #define PANE_STATUS_TOP 1 #define PANE_STATUS_BOTTOM 2 -/* Pane scrollbars options. */ +/* Pane scrollbars option. */ #define PANE_SCROLLBARS_OFF 0 #define PANE_SCROLLBARS_MODAL 1 #define PANE_SCROLLBARS_ALWAYS 2 + +/* Pane scrollbars position option. */ #define PANE_SCROLLBARS_RIGHT 0 #define PANE_SCROLLBARS_LEFT 1 @@ -1549,9 +1542,6 @@ struct tty { u_int mouse_last_y; u_int mouse_last_b; int mouse_drag_flag; - int mouse_scrolling_flag; - int mouse_slider_mpos; - void (*mouse_drag_update)(struct client *, struct mouse_event *); void (*mouse_drag_release)(struct client *, @@ -3316,7 +3306,6 @@ void printflike(3, 4) window_copy_add(struct window_pane *, int, const char *, ...); void printflike(3, 0) window_copy_vadd(struct window_pane *, int, const char *, va_list); -void window_copy_scroll(struct window_pane *, int, u_int, int); void window_copy_pageup(struct window_pane *, int); void window_copy_pagedown(struct window_pane *, int, int); void window_copy_start_drag(struct client *, struct mouse_event *); diff --git a/window-copy.c b/window-copy.c index 6438f267..4470a0e5 100644 --- a/window-copy.c +++ b/window-copy.c @@ -40,8 +40,6 @@ static void window_copy_free(struct window_mode_entry *); static void window_copy_resize(struct window_mode_entry *, u_int, u_int); static void window_copy_formats(struct window_mode_entry *, struct format_tree *); -static void window_copy_scroll1(struct window_mode_entry *, - struct window_pane *wp, int, u_int, int); static void window_copy_pageup1(struct window_mode_entry *, int); static int window_copy_pagedown1(struct window_mode_entry *, int, int); static void window_copy_next_paragraph(struct window_mode_entry *); @@ -276,7 +274,7 @@ struct window_copy_mode_data { u_int cx; u_int cy; - u_int lastcx; /* position in last line w/ content */ + u_int lastcx; /* position in last line w/ content */ u_int lastsx; /* size of last line w/ content */ u_int mx; /* mark position */ @@ -548,7 +546,7 @@ window_copy_vadd(struct window_pane *wp, int parse, const char *fmt, va_list ap) struct window_copy_mode_data *data = wme->data; struct screen *backing = data->backing; struct screen *writing = data->writing; - struct screen_write_ctx writing_ctx, backing_ctx, ctx; + struct screen_write_ctx writing_ctx, backing_ctx, ctx; struct grid_cell gc; u_int old_hsize, old_cy; u_int sx = screen_size_x(backing); @@ -600,122 +598,6 @@ window_copy_vadd(struct window_pane *wp, int parse, const char *fmt, va_list ap) screen_write_stop(&ctx); } -void -window_copy_scroll(struct window_pane *wp, int sl_mpos, u_int my, - int scroll_exit) -{ - struct window_mode_entry *wme = TAILQ_FIRST(&wp->modes); - - window_set_active_pane(wp->window, wp, 0); - - if (wme != NULL) { - window_copy_scroll1(wme, wp, sl_mpos, my, scroll_exit); - } -} - -static void -window_copy_scroll1(struct window_mode_entry *wme, struct window_pane *wp, - int sl_mpos, u_int my, int scroll_exit) -{ - struct window_copy_mode_data *data = wme->data; - u_int ox, oy, px, py, n, offset, size; - u_int new_offset, slider_y = wp->sb_slider_y; - u_int slider_height = wp->sb_slider_h; - u_int sb_height = wp->sy, sb_top = wp->yoff; - u_int sy = screen_size_y(data->backing); - int new_slider_y, delta; - - log_debug("%s: slider %u mouse %u", __func__, slider_y, my); - - /* - * sl_mpos is where in the slider the user is dragging, mouse - * is dragging this y point relative to top of slider. - */ - if (my <= sb_top + sl_mpos) { - /* Slider banged into top. */ - new_slider_y = sb_top - wp->yoff; - } else if (my - sl_mpos > sb_top + sb_height - slider_height) { - /* Slider banged into bottom. */ - new_slider_y = sb_top - wp->yoff + (sb_height - slider_height); - } else { - /* Slider is somewhere in the middle. */ - new_slider_y = my - wp->yoff - sl_mpos + 1; - } - - log_debug("%s: new slider %u mouse %u", __func__, new_slider_y, my); - - if (TAILQ_FIRST(&wp->modes) == NULL || - window_copy_get_current_offset(wp, &offset, &size) == 0) - return; - - /* - * See screen_redraw_draw_pane_scrollbar(), this is the inverse of the - * formula used there. - */ - new_offset = new_slider_y * ((float)(size + sb_height) / sb_height); - delta = (int)offset - new_offset; - - log_debug("%s: delta %d mouse %u", __func__, delta, my); - - /* - * Move pane view around based on delta relative to the cursor, - * maintaining the selection. - */ - oy = screen_hsize(data->backing) + data->cy - data->oy; - ox = window_copy_find_length(wme, oy); - - if (data->cx != ox) { - data->lastcx = data->cx; - data->lastsx = ox; - } - data->cx = data->lastcx; - - if (delta >= 0) { - n = (u_int)delta; - if (data->oy + n > screen_hsize(data->backing)) { - data->oy = screen_hsize(data->backing); - if (data->cy < n) - data->cy = 0; - else - data->cy -= n; - } else - data->oy += n; - } else { - n = (u_int)-delta; - if (data->oy < n) { - data->oy = 0; - if (data->cy + (n - data->oy) >= sy) - data->cy = sy - 1; - else - data->cy += n - data->oy; - } else - data->oy -= n; - } - - /* Don't also drag tail when dragging a scrollbar, it looks weird. */ - data->cursordrag = CURSORDRAG_NONE; - - if (data->screen.sel == NULL || !data->rectflag) { - py = screen_hsize(data->backing) + data->cy - data->oy; - px = window_copy_find_length(wme, py); - if ((data->cx >= data->lastsx && data->cx != px) || - data->cx > px) - window_copy_cursor_end_of_line(wme); - } - - if (scroll_exit && data->oy == 0) { - window_pane_reset_mode(wp); - return; - } - - if (data->searchmark != NULL && !data->timeout) - window_copy_search_marks(wme, NULL, data->searchregex, 1); - window_copy_update_selection(wme, 1, 0); - window_copy_redraw_screen(wme); - - return; -} - void window_copy_pageup(struct window_pane *wp, int half_page) { @@ -3921,12 +3803,12 @@ window_copy_search(struct window_mode_entry *wme, int direction, int regex) * beginning of the mark. */ if (window_copy_search_mark_at(data, fx, fy, - &start) == 0) { + &start) == 0) { while (window_copy_search_mark_at(data, fx, fy, - &at) == 0 && + &at) == 0 && data->searchmark != NULL && data->searchmark[at] == - data->searchmark[start]) { + data->searchmark[start]) { data->cx = fx; data->cy = fy - screen_hsize(data->backing) + @@ -4195,7 +4077,7 @@ window_copy_match_at_cursor(struct window_copy_mode_data *data) /* * Cells will not be set in the marked array unless they are valid text * and wrapping will be taken care of, so we can just copy. - */ + */ for (at = start; at <= end; at++) { py = at / sx; px = at - (py * sx); @@ -4293,7 +4175,7 @@ window_copy_write_one(struct window_mode_entry *wme, struct window_copy_mode_data *data = wme->data; struct grid *gd = data->backing->grid; struct grid_cell gc; - u_int fx; + u_int fx; screen_write_cursormove(ctx, 0, py, 0); for (fx = 0; fx < nx; fx++) { @@ -4374,13 +4256,10 @@ static void window_copy_write_lines(struct window_mode_entry *wme, struct screen_write_ctx *ctx, u_int py, u_int ny) { - u_int yy; - struct window_pane *wp = wme->wp; + u_int yy; for (yy = py; yy < py + ny; yy++) window_copy_write_line(wme, ctx, py); - - wp->flags |= PANE_REDRAWSCROLLBAR; } static void @@ -4416,7 +4295,7 @@ window_copy_redraw_lines(struct window_mode_entry *wme, u_int py, u_int ny) { struct window_pane *wp = wme->wp; struct window_copy_mode_data *data = wme->data; - struct screen_write_ctx ctx; + struct screen_write_ctx ctx; u_int i; screen_write_start_pane(&ctx, wp, NULL); @@ -4568,7 +4447,7 @@ window_copy_adjust_selection(struct window_mode_entry *wme, u_int *selx, { struct window_copy_mode_data *data = wme->data; struct screen *s = &data->screen; - u_int sx, sy, ty; + u_int sx, sy, ty; int relpos; sx = *selx; diff --git a/window.c b/window.c index 98e9cff9..bd8fc15b 100644 --- a/window.c +++ b/window.c @@ -1117,7 +1117,6 @@ window_pane_set_mode(struct window_pane *wp, struct window_pane *swp, { struct window_mode_entry *wme; struct window *w = wp->window; - u_int pane_scrollbars; if (!TAILQ_EMPTY(&wp->modes) && TAILQ_FIRST(&wp->modes)->mode == mode) return (1); @@ -1138,13 +1137,10 @@ window_pane_set_mode(struct window_pane *wp, struct window_pane *swp, TAILQ_INSERT_HEAD(&wp->modes, wme, entry); wme->screen = wme->mode->init(wme, fs, args); } - wp->screen = wme->screen; - wp->flags |= (PANE_REDRAW|PANE_CHANGED); - pane_scrollbars = options_get_number(w->options, "pane-scrollbars"); - if (pane_scrollbars == PANE_SCROLLBARS_MODAL) - layout_fix_panes(w, NULL); + wp->flags |= (PANE_REDRAW|PANE_REDRAWSCROLLBAR|PANE_CHANGED); + layout_fix_panes(w, NULL); server_redraw_window_borders(wp->window); server_status_window(wp->window); @@ -1158,7 +1154,6 @@ window_pane_reset_mode(struct window_pane *wp) { struct window_mode_entry *wme, *next; struct window *w = wp->window; - u_int pane_scrollbars; if (TAILQ_EMPTY(&wp->modes)) return; @@ -1179,11 +1174,9 @@ window_pane_reset_mode(struct window_pane *wp) if (next->mode->resize != NULL) next->mode->resize(next, wp->sx, wp->sy); } - wp->flags |= (PANE_REDRAW|PANE_REDRAWSCROLLBAR|PANE_CHANGED); - pane_scrollbars = options_get_number(w->options, "pane-scrollbars"); - if (pane_scrollbars != PANE_SCROLLBARS_OFF) - layout_fix_panes(w, NULL); + wp->flags |= (PANE_REDRAW|PANE_REDRAWSCROLLBAR|PANE_CHANGED); + layout_fix_panes(w, NULL); server_redraw_window_borders(wp->window); server_status_window(wp->window); @@ -1200,7 +1193,7 @@ window_pane_reset_mode_all(struct window_pane *wp) static void window_pane_copy_paste(struct window_pane *wp, char *buf, size_t len) { - struct window_pane *loop; + struct window_pane *loop; TAILQ_FOREACH(loop, &wp->window->panes, entry) { if (loop != wp && @@ -1218,7 +1211,7 @@ window_pane_copy_paste(struct window_pane *wp, char *buf, size_t len) static void window_pane_copy_key(struct window_pane *wp, key_code key) { - struct window_pane *loop; + struct window_pane *loop; TAILQ_FOREACH(loop, &wp->window->panes, entry) { if (loop != wp &&