From ce1e59615a5fef7df1ed16011edddf744f975dca Mon Sep 17 00:00:00 2001 From: sonninnos <45124675+sonninnos@users.noreply.github.com> Date: Tue, 22 Nov 2022 17:50:17 +0200 Subject: [PATCH] (WinRaw) Fix mouse position when using input overlay with mouse cursor (#14659) --- input/drivers/winraw_input.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/input/drivers/winraw_input.c b/input/drivers/winraw_input.c index 86ae8edd37..c1cce3edf8 100644 --- a/input/drivers/winraw_input.c +++ b/input/drivers/winraw_input.c @@ -413,9 +413,20 @@ static void winraw_update_mouse_state(winraw_input_t *wr, if (menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE) getcursorpos = true; #endif + /* Input overlay with mouse cursor must also use GetCursorPos() */ + if (!getcursorpos) + { + settings_t *settings = config_get_ptr(); + if ( settings->bools.input_overlay_enable + && settings->bools.input_overlay_show_mouse_cursor) + getcursorpos = true; + } if (getcursorpos) { + InterlockedExchangeAdd(&mouse->dlt_x, state->lLastX); + InterlockedExchangeAdd(&mouse->dlt_y, state->lLastY); + if (!GetCursorPos(&crs_pos)) RARCH_DBG("[WinRaw]: GetCursorPos failed with error %lu.\n", GetLastError()); else if (!ScreenToClient((HWND)video_driver_window_get(), &crs_pos))