input: ignore mouse motion outside our window

This commit is contained in:
Daniel Eklöf 2019-07-11 11:09:34 +02:00
parent 18070cf286
commit c43b49dab6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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;