From 838a85ee8b4087d32c93655c0a26e14c09826984 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 7 Apr 2022 16:22:26 +0530 Subject: [PATCH] Fix drag event reporting not specifying the current button. xterm does this, so in the absence of a spec we copy xterm. Fixes #4925 --- kitty/mouse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kitty/mouse.c b/kitty/mouse.c index d8889126f..f63171529 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -69,7 +69,9 @@ static int encode_mouse_event_impl(const MousePosition *mpos, int mouse_tracking_protocol, int button, MouseAction action, int mods) { unsigned int cb = 0; if (action == MOVE) { - cb = 3; + cb = encode_button(button); + if (cb == UINT_MAX) cb = 3; + cb += 32; } else { cb = encode_button(button); if (cb == UINT_MAX) return 0;