From 4e427d05b7913c2cf3bbc6342d5f7b9eb7bcbc64 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 19 Jul 2019 19:02:09 +0530 Subject: [PATCH] Fix mouse move events not having modifiers The lack of modifiers meant that detect of whether the event should be tracked in kitty was not working --- kitty/glfw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/glfw.c b/kitty/glfw.c index 436701649..f87fb82b1 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -241,10 +241,13 @@ cursor_enter_callback(GLFWwindow *w, int entered) { global_state.callback_os_window = NULL; } +static int mods_at_last_button_event = 0; + static void mouse_button_callback(GLFWwindow *w, int button, int action, int mods) { if (!set_callback_window(w)) return; show_mouse_cursor(w); + mods_at_last_button_event = mods; double now = monotonic(); global_state.callback_os_window->last_mouse_activity_at = now; if (button >= 0 && (unsigned int)button < arraysz(global_state.callback_os_window->mouse_button_pressed)) { @@ -264,7 +267,7 @@ cursor_pos_callback(GLFWwindow *w, double x, double y) { global_state.callback_os_window->cursor_blink_zero_time = now; global_state.callback_os_window->mouse_x = x * global_state.callback_os_window->viewport_x_ratio; global_state.callback_os_window->mouse_y = y * global_state.callback_os_window->viewport_y_ratio; - if (is_window_ready_for_callbacks()) mouse_event(-1, 0, -1); + if (is_window_ready_for_callbacks()) mouse_event(-1, mods_at_last_button_event, -1); request_tick_callback(); global_state.callback_os_window = NULL; }