[x11] Don't double-divide for window center

I obviously need a better way to test legacy code because the fix for
unsigned-int behavior with clang broke mouse warping when using
XGrabPointer instead of XInput2's XIGrabEnter.
This commit is contained in:
Bill Currie 2022-12-11 16:46:58 +09:00
parent 65214fb7f8
commit b553c313fe

View file

@ -836,8 +836,8 @@ event_motion (XEvent *event)
if (!event->xmotion.send_event) { if (!event->xmotion.send_event) {
int center_x = viddef.width / 2; int center_x = viddef.width / 2;
int center_y = viddef.height / 2; int center_y = viddef.height / 2;
unsigned dist_x = abs (center_x / 2 - event->xmotion.x); unsigned dist_x = abs (center_x - event->xmotion.x);
unsigned dist_y = abs (center_y / 2 - event->xmotion.y); unsigned dist_y = abs (center_y - event->xmotion.y);
x11_mouse_axes[0].value = event->xmotion.x - x11_mouse.x; x11_mouse_axes[0].value = event->xmotion.x - x11_mouse.x;
x11_mouse_axes[1].value = event->xmotion.y - x11_mouse.y; x11_mouse_axes[1].value = event->xmotion.y - x11_mouse.y;