From a3d56262564955b803995ddb58f7c64d056b9984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 8 Aug 2020 10:07:25 +0200 Subject: [PATCH] input: pointer-enter: add comment describing what we're doing --- input.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/input.c b/input.c index 38e8e8dd..eb4e394b 100644 --- a/input.c +++ b/input.c @@ -1048,6 +1048,12 @@ wl_pointer_enter(void *data, struct wl_pointer *wl_pointer, switch ((term->active_surface = term_surface_kind(term, surface))) { case TERM_SURF_GRID: { + /* + * Translate x,y pixel coordinate to a cell coordinate, or -1 + * if the cursor is outside the grid. I.e. if it is inside the + * margins. + */ + if (x < term->margins.left || x >= term->width - term->margins.right) seat->mouse.col = -1; else