mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 13:43:32 +00:00
Don't warp pointer unless needed.
This commit is contained in:
parent
7f25a608f4
commit
d59d72fe49
@ -237,11 +237,15 @@ static void x_input_poll_mouse(x11_input_t *x11)
|
|||||||
{
|
{
|
||||||
struct rarch_viewport vp = {0};
|
struct rarch_viewport vp = {0};
|
||||||
video_viewport_info_func(&vp);
|
video_viewport_info_func(&vp);
|
||||||
unsigned mid_w = vp.full_width >> 1;
|
int mid_w = vp.full_width >> 1;
|
||||||
unsigned mid_h = vp.full_height >> 1;
|
int mid_h = vp.full_height >> 1;
|
||||||
XWarpPointer(x11->display, None,
|
|
||||||
x11->win, 0, 0, 0, 0,
|
if (x11->mouse_x != mid_w || x11->mouse_y != mid_h)
|
||||||
mid_w, mid_h);
|
{
|
||||||
|
XWarpPointer(x11->display, None,
|
||||||
|
x11->win, 0, 0, 0, 0,
|
||||||
|
mid_w, mid_h);
|
||||||
|
}
|
||||||
x11->mouse_last_x = mid_w;
|
x11->mouse_last_x = mid_w;
|
||||||
x11->mouse_last_y = mid_h;
|
x11->mouse_last_y = mid_h;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user