From fbeb1e96103681b6a3fac49443e64ed13ae28737 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 30 Nov 2019 17:11:00 +0100 Subject: term: mouse reporting functions no longer take modifier state The mouse reporting functions are called from input when we receive Wayland mouse events. We used to pass the current keyboard modifier (shift, alt, ctrl, etc) to the terminal functions. This however is wrong, since we may receive Wayland mouse events without having keyboard focus. When we don't have keyboard focus, the modifier state doesn't apply to us. Remove the modifier arguments from the terminal mouse reporting functions. These functions now read this state directly instead, but only when the terminal instance in question has keyboard focus. --- terminal.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index eefc2065..bec33790 100644 --- a/terminal.h +++ b/terminal.h @@ -360,12 +360,9 @@ void term_restore_cursor(struct terminal *term); void term_focus_in(struct terminal *term); void term_focus_out(struct terminal *term); -void term_mouse_down(struct terminal *term, int button, int row, int col, - bool shift, bool alt, bool ctrl); -void term_mouse_up(struct terminal *term, int button, int row, int col, - bool shift, bool alt, bool ctrl); -void term_mouse_motion(struct terminal *term, int button, int row, int col, - bool shift, bool alt, bool ctrl); +void term_mouse_down(struct terminal *term, int button, int row, int col); +void term_mouse_up(struct terminal *term, int button, int row, int col); +void term_mouse_motion(struct terminal *term, int button, int row, int col); bool term_mouse_grabbed(const struct terminal *term); void term_xcursor_update(struct terminal *term); -- cgit v1.3