From d1b77d4b68fbf1129fd84a8d411d1c12d57ba0ee Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Fri, 15 Sep 2017 22:59:18 -0500 Subject: BACKENDS: Fix missing mouse events when system cursor cannot be moved Normally with SDL, a mouse motion event will be sent after the system mouse cursor has been moved by a call to SDL_WarpMouseInWindow, but if the system cursor cannot be moved (e.g. because the window does not have mouse focus), games still need to receive these mouse events so they can successfully update the mouse position internally. Otherwise, games continue to think the mouse is still in the original position and will continue to try to perform whatever action is associated with that mouse position. Refs Trac#9689. --- backends/platform/sdl/sdl-window.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'backends/platform/sdl/sdl-window.h') diff --git a/backends/platform/sdl/sdl-window.h b/backends/platform/sdl/sdl-window.h index 4f6d924411..e1a3499d19 100644 --- a/backends/platform/sdl/sdl-window.h +++ b/backends/platform/sdl/sdl-window.h @@ -58,8 +58,10 @@ public: /** * Warp the mouse to the specified position in window coordinates. The mouse * will only be warped if the window is focused in the window manager. + * + * @returns true if the system cursor was warped. */ - void warpMouseInWindow(int x, int y); + bool warpMouseInWindow(int x, int y); /** * Iconifies the window. -- cgit v1.2.3