aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-11 09:09:34 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-11 15:38:02 +0000
commitc43b49dab6a22dc557cd6dd791bfb2e092130604 (patch)
tree26c8d208259b3022302d00c710590dcea71307ab /input.c
parentselection: disable debug logging (diff)
input: ignore mouse motion outside our window
Diffstat (limited to 'input.c')
-rw-r--r--input.c3
1 files changed, 3 insertions, 0 deletions
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;