From 765ca4070bb6f095fc58c030f2154ed03857701d Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 29 Aug 2026 19:44:29 +0200 Subject: render: re-evaluate mouse col/row coordinates after a window resize Before this, the col/row coordinates for the mouse pointer was only updated when the mouse either entered our window, or was moved inside it. However, when a window is resized without using the mouse, and the user then clicks (again, without moving the mouse), we can get a button event outside the cell grid, that we still think is on top of the grid. Example: user moves mouse over the bottom row. The window is shrunk. Enough that the mouse is now outside the cell grid, but still inside our window. This means we get a button event outside the grid. But since we haven't updated the col/row coordinates, we think it's on a row, that no longer exists. Closes #2435 --- input.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'input.h') diff --git a/input.h b/input.h index 34342bbf..347466aa 100644 --- a/input.h +++ b/input.h @@ -38,3 +38,5 @@ void get_current_modifiers(const struct seat *seat, uint32_t key, bool filter_locked); enum cursor_shape xcursor_for_csd_border(struct terminal *term, int x, int y); +void mouse_coord_pixel_to_cell(struct seat *seat, const struct terminal *term, + int x, int y); -- cgit v1.3