From d785f2b32257215467aa28dba91a754fce8995a8 Mon Sep 17 00:00:00 2001 From: mierenhoop <46939409+mierenhoop@users.noreply.github.com> Date: Tue, 12 May 2026 12:12:08 +0200 Subject: [PATCH] vte: map mouse wheel up/down buttons correctly Button codes 64/65 for wheel up/down apply to all mouse modes. --- src/tsm/tsm-vte.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tsm/tsm-vte.c b/src/tsm/tsm-vte.c index 120ca65..6ae907e 100644 --- a/src/tsm/tsm-vte.c +++ b/src/tsm/tsm-vte.c @@ -3372,18 +3372,18 @@ bool tsm_vte_handle_mouse(struct tsm_vte *vte, unsigned int cell_x, return false; } + if (button == TSM_MOUSE_BUTTON_WHEEL_UP) { + button = 64; + } else if (button == TSM_MOUSE_BUTTON_WHEEL_DOWN) { + button = 65; + } + if (vte->mouse_mode == TSM_VTE_MOUSE_MODE_SGR || vte->mouse_mode == TSM_VTE_MOUSE_MODE_PIXEL) { /* internally we use zero indexing but the xterm spec requires the * top left cell to have the coordinates 1,1 */ cell_x++; cell_y++; - if (button == TSM_MOUSE_BUTTON_WHEEL_UP) { - button = 64; - } else if (button == TSM_MOUSE_BUTTON_WHEEL_DOWN) { - button = 65; - } - reply_flags = button | modifiers; }