aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-05 13:28:39 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-05 13:28:39 +0000
commita959c89b7f10a8f57fb4c3f1f31be9d54179ba25 (patch)
treea1e0ca86d315b2ffa2e53f9206ef66256641e9df /input.c
parentvt: add support for mouse motion reports (diff)
input: bug: row is calculated from the cell *height*, not width
Diffstat (limited to 'input.c')
-rw-r--r--input.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/input.c b/input.c
index 4027d801..30353661 100644
--- a/input.c
+++ b/input.c
@@ -325,13 +325,13 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,
int y = wl_fixed_to_int(surface_y) * 1;//backend->monitor->scale;
int col = x / term->cell_width;
- int row = y / term->cell_width;
+ int row = y / term->cell_height;
if (col == term->mouse.col && row == term->mouse.row)
return;
- term->mouse.col = x / term->cell_width;
- term->mouse.row = y / term->cell_height;
+ term->mouse.col = col;
+ term->mouse.row = row;
term_mouse_motion(
term, term->mouse.button, term->mouse.row, term->mouse.col,