From 84e46525136481ba5bd60e73ae2fffdf74c0417c Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 3 May 2019 18:00:19 +0000 Subject: [PATCH 1/3] Use the right index for user-keys. --- tty-keys.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tty-keys.c b/tty-keys.c index 1aecbcb2..90f34877 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -429,6 +429,7 @@ tty_keys_build(struct tty *tty) if (o != NULL) { a = options_array_first(o); while (a != NULL) { + i = options_array_item_index(a); ov = options_array_item_value(a); tty_keys_add(tty, ov->string, KEYC_USER + i); a = options_array_next(a); From 4097257beffc100d1eb0948d1390cea952e5fe4a Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 3 May 2019 18:42:40 +0000 Subject: [PATCH 2/3] Do not store the mouse position we calculate as the start of a drag back into the mouse event that later code uses, it has been adjusted and they should use the original position. GitHub issue 1710. --- cmd-resize-pane.c | 2 +- cmd.c | 4 ++-- server-client.c | 4 ++-- window-copy.c | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c index 410a6257..c978edfb 100644 --- a/cmd-resize-pane.c +++ b/cmd-resize-pane.c @@ -143,7 +143,7 @@ cmd_resize_pane_mouse_update(struct client *c, struct mouse_event *m) } w = wl->window; - y = m->y; x = m->x; + y = m->y + m->oy; x = m->x + m->ox; if (m->statusat == 0 && y > 0) y--; else if (m->statusat > 0 && y >= (u_int)m->statusat) diff --git a/cmd.c b/cmd.c index 57b3350c..a0ec6aa6 100644 --- a/cmd.c +++ b/cmd.c @@ -484,8 +484,8 @@ cmd_mouse_at(struct window_pane *wp, struct mouse_event *m, u_int *xp, x = m->lx + m->ox; y = m->ly + m->oy; } else { - x = m->x; - y = m->y; + x = m->x + m->ox; + y = m->y + m->oy; } log_debug("%s: x=%u, y=%u%s", __func__, x, y, last ? " (last)" : ""); diff --git a/server-client.c b/server-client.c index f25e372e..78e12b19 100644 --- a/server-client.c +++ b/server-client.c @@ -448,6 +448,8 @@ server_client_check_mouse(struct client *c, struct key_event *event) type = DRAG; if (c->tty.mouse_drag_flag) { x = m->x, y = m->y, b = m->b; + if (x == m->lx && y == m->ly) + return (KEYC_UNKNOWN); log_debug("drag update at %u,%u", x, y); } else { x = m->lx, y = m->ly, b = m->lb; @@ -555,8 +557,6 @@ have_event: return (KEYC_UNKNOWN); px = px + m->ox; py = py + m->oy; - m->x = x + m->ox; - m->y = y + m->oy; /* Try the pane borders if not zoomed. */ if (~s->curw->window->flags & WINDOW_ZOOMED) { diff --git a/window-copy.c b/window-copy.c index f8569d79..4ff6b9dd 100644 --- a/window-copy.c +++ b/window-copy.c @@ -3505,6 +3505,8 @@ window_copy_start_drag(struct client *c, struct mouse_event *m) window_copy_update_cursor(wme, x, y); window_copy_start_selection(wme); window_copy_redraw_screen(wme); + + window_copy_drag_update(c, m); } static void From e8e4f4ec3e4de0bd0e4eb2a7ee995fb6f5f7f937 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 3 May 2019 18:59:58 +0000 Subject: [PATCH 3/3] Insert after the right element on queue. --- cmd-queue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd-queue.c b/cmd-queue.c index 14d6a824..fb2c7fac 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -94,6 +94,7 @@ cmdq_insert_after(struct cmdq_item *after, struct cmdq_item *item) log_debug("%s %s: %s after %s", __func__, cmdq_name(c), item->name, after->name); + after = item; item = next; } while (item != NULL); }