udev: Disable the mouse when the window has lost focus. (#7851)

Fixes https://github.com/libretro/RetroArch/issues/5520

v2: Move check to udev_handle_mouse().
v3: Change check to udev_get_mouse to fix issue reported by RobLoach.
This commit is contained in:
orbea 2019-01-05 16:56:41 -08:00 committed by bparker06
parent 85b560e76b
commit 2b0838ac02

View File

@ -225,7 +225,7 @@ static udev_input_mouse_t *udev_get_mouse(struct udev_input *udev, unsigned port
settings_t *settings = config_get_ptr();
udev_input_mouse_t *mouse = NULL;
if (port >= MAX_USERS)
if (port >= MAX_USERS || !video_driver_cb_has_focus())
return NULL;
for (i = 0; i < udev->num_devices; ++i)