diff --git a/libs/video/targets/in_x11.c b/libs/video/targets/in_x11.c index 40bd1e0ef..5395ea639 100644 --- a/libs/video/targets/in_x11.c +++ b/libs/video/targets/in_x11.c @@ -801,8 +801,10 @@ event_motion (XEvent *event) } else { if (vid_fullscreen->int_val || input_grabbed) { if (!event->xmotion.send_event) { - unsigned dist_x = abs (viddef.width / 2 - event->xmotion.x); - unsigned dist_y = abs (viddef.height / 2 - event->xmotion.y); + int center_x = viddef.width / 2; + int center_y = viddef.height / 2; + unsigned dist_x = abs (center_x / 2 - event->xmotion.x); + unsigned dist_y = abs (center_y / 2 - event->xmotion.y); x11_mouse_axes[0].value = event->xmotion.x - x11_mouse.x; x11_mouse_axes[1].value = event->xmotion.y - x11_mouse.y;