Skip to content

Commit

Permalink
fix math that calculates cursor position on screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutel committed Mar 15, 2022
1 parent 9a8269e commit 4eb5987
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/linux/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ int LInputClient(int verbose)
SUCCESSLN("Got input at \x1b[0;37m%d\x1b[1;32mx\x1b[0;37m%d \x1b[1;37mwith \x1b[0;37m%d \x1b[1;37mpressure.\n", x, y, pressure);
}

int cx = (x - x_min) / ((x_max - x_min) / window_attributes.width);
int cy = (y - y_min) / ((y_max - y_min) / window_attributes.height);
int cx = window_attributes.width * (x - x_min) / (x_max - x_min);
int cy = window_attributes.height * (y - y_min) / (y_max - y_min);
XWarpPointer(display, None, root_window, 0, 0, 0, 0, cx, cy);
XFlush(display);
if (!gdaemon && gverbose) {
Expand Down

0 comments on commit 4eb5987

Please sign in to comment.