From 8d9f772dce97b4652b9c4295a8f0193488c486e3 Mon Sep 17 00:00:00 2001 From: sonninnos Date: Thu, 16 Jun 2022 11:34:54 +0300 Subject: [PATCH] (WINRAW) Fix pointer device position --- input/drivers/winraw_input.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/input/drivers/winraw_input.c b/input/drivers/winraw_input.c index 4d33d0f69d..cd89a81a52 100644 --- a/input/drivers/winraw_input.c +++ b/input/drivers/winraw_input.c @@ -407,11 +407,16 @@ static void winraw_update_mouse_state(winraw_input_t *wr, } else if (state->lLastX || state->lLastY) { - /* Menu requires GetCursorPos() for accurate + /* Menu and pointer require GetCursorPos() for * positioning, but using that always will * break multiple mice positions */ + bool getcursorpos = (mouse->device == RETRO_DEVICE_POINTER) ? true : false; #ifdef HAVE_MENU if (menu_state_get_ptr()->alive) + getcursorpos = true; +#endif + + if (getcursorpos) { if (!GetCursorPos(&crs_pos)) RARCH_DBG("[WinRaw]: GetCursorPos failed with error %lu.\n", GetLastError()); @@ -419,7 +424,6 @@ static void winraw_update_mouse_state(winraw_input_t *wr, RARCH_DBG("[WinRaw]: ScreenToClient failed with error %lu.\n", GetLastError()); } else -#endif { /* Handle different sensitivity for lightguns */ if (mouse->device == RETRO_DEVICE_LIGHTGUN)