From b931b06941ab223d9252215b0296fabe0def2d02 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 11 Feb 2022 15:09:43 +0530 Subject: [PATCH] Add mouse co-ords to debug output for move events --- kitty/mouse.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/mouse.c b/kitty/mouse.c index 9952ddddb..9b4ce683a 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -722,7 +722,10 @@ mouse_event(const int button, int modifiers, int action) { bool in_tab_bar; unsigned int window_idx = 0; Window *w = NULL; - debug("%s mouse_button: %d %s", action == GLFW_RELEASE ? "\x1b[32mRelease\x1b[m" : (button < 0 ? "\x1b[36mMove\x1b[m" : "\x1b[31mPress\x1b[m"), button, format_mods(modifiers)); + if (OPT(debug_keyboard)) { + if (button < 0) { debug("%s x: %.1f y: %.1f ", "\x1b[36mMove\x1b[m", global_state.callback_os_window->mouse_x, global_state.callback_os_window->mouse_y); } + else { debug("%s mouse_button: %d %s", action == GLFW_RELEASE ? "\x1b[32mRelease\x1b[m" : "\x1b[31mPress\x1b[m", button, format_mods(modifiers)); } + } if (global_state.redirect_mouse_handling) { w = window_for_event(&window_idx, &in_tab_bar); call_boss(mouse_event, "OK iiii dd",