From c43b49dab6a22dc557cd6dd791bfb2e092130604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 11 Jul 2019 11:09:34 +0200 Subject: [PATCH] input: ignore mouse motion outside our window --- input.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/input.c b/input.c index e075bf4b..c18e24c8 100644 --- a/input.c +++ b/input.c @@ -307,6 +307,9 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer, int col = x / term->cell_width; int row = y / term->cell_height; + if (col < 0 || row < 0 || col >= term->cols || row >= term->rows) + return; + bool update_selection = term->mouse.button == BTN_LEFT; bool update_selection_early = term->selection.end.row == -1;