From a2efdb21a84947fc8a84ea886d664bf428a0230a Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 7 Apr 2020 13:33:00 +0000 Subject: [PATCH 1/3] Limit size to 1x1 (total size 3x3). --- popup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/popup.c b/popup.c index 299d4e76..d23c2001 100644 --- a/popup.c +++ b/popup.c @@ -200,9 +200,9 @@ popup_handle_drag(struct client *c, struct popup_data *pd, pd->dy = m->y - pd->py; server_redraw_client(c); } else if (pd->dragging == SIZE) { - if (m->x < pd->px + 2) + if (m->x < pd->px + 3) return; - if (m->y < pd->py + 2) + if (m->y < pd->py + 3) return; pd->sx = m->x - pd->px; pd->sy = m->y - pd->py; From eff881b15aba52841c7b41ff6b5dca3cf6984077 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 7 Apr 2020 13:38:30 +0000 Subject: [PATCH 2/3] Do not send mouse events if the program has not requested them. --- input-keys.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/input-keys.c b/input-keys.c index 5e54d121..e9c595b4 100644 --- a/input-keys.c +++ b/input-keys.c @@ -271,6 +271,8 @@ input_key_get_mouse(struct screen *s, struct mouse_event *m, u_int x, u_int y, /* If this pane is not in button or all mode, discard motion events. */ if (MOUSE_DRAG(m->b) && (s->mode & MOTION_MOUSE_MODES) == 0) return (0); + if ((s->mode & ALL_MOUSE_MODES) == 0) + return (0); /* * If this event is a release event and not in all mode, discard it. From 1c8f7c1f7afcc7d2a9fcef8d38e6c0e4451da659 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 7 Apr 2020 13:55:24 +0000 Subject: [PATCH 3/3] Do not restore history flag if it was never set. --- screen.c | 4 +++- tmux.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/screen.c b/screen.c index c3e5da70..898cc860 100644 --- a/screen.c +++ b/screen.c @@ -536,6 +536,7 @@ screen_alternate_on(struct screen *s, struct grid_cell *gc, int cursor) grid_view_clear(s->grid, 0, 0, sx, sy, 8); + s->saved_flags = s->grid->flags; s->grid->flags &= ~GRID_HISTORY; } @@ -579,7 +580,8 @@ screen_alternate_off(struct screen *s, struct grid_cell *gc, int cursor) * Turn history back on (so resize can use it) and then resize back to * the current size. */ - s->grid->flags |= GRID_HISTORY; + if (s->saved_flags & GRID_HISTORY) + s->grid->flags |= GRID_HISTORY; if (sy > s->saved_grid->sy || sx != s->saved_grid->sx) screen_resize(s, sx, sy, 1); diff --git a/tmux.h b/tmux.h index 3cc46df1..fbf10cf4 100644 --- a/tmux.h +++ b/tmux.h @@ -761,6 +761,7 @@ struct screen { u_int saved_cy; struct grid *saved_grid; struct grid_cell saved_cell; + int saved_flags; bitstr_t *tabs; struct screen_sel *sel;