From 55b21b741ebc45453f089c962ec46feff394c0e4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 21 Apr 2022 07:53:37 +0530 Subject: [PATCH] Fix a regression in the previous release that caused mouse move events to be incorrectly reported as drag events even when a button is not pressed Fixes #4992 Will need to investigate a different fix for #4925. xterm does report the button press that caused the drag to start with move events, so we will have to track that to match its behavior as glfw does not track it for us. --- docs/changelog.rst | 2 ++ kitty/mouse.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a4ff42511..ca82a7deb 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -47,6 +47,8 @@ Detailed list of changes - Bash integration: Fix the value of :opt:`shell_integration` not taking effect if the integration script is sourced in bashrc (:pull:`4964`) +- Fix a regression in the previous release that caused mouse move events to be incorrectly reported as drag events even when a button is not pressed (:iss:`4992`) + 0.25.0 [2022-04-11] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/mouse.c b/kitty/mouse.c index 84355f9f9..0190c49f1 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -360,7 +360,7 @@ HANDLER(handle_move_event) { handle_mouse_movement_in_kitty(w, button, mouse_cell_changed | cell_half_changed); } else { if (!mouse_cell_changed && screen->modes.mouse_tracking_protocol != SGR_PIXEL_PROTOCOL) return; - int sz = encode_mouse_button(w, MAX(0, button), button >=0 ? DRAG : MOVE, modifiers); + int sz = encode_mouse_button(w, button, button >=0 ? DRAG : MOVE, modifiers); if (sz > 0) { mouse_event_buf[sz] = 0; write_escape_code_to_child(screen, CSI, mouse_event_buf); } } }