aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/sdl-window.h
diff options
context:
space:
mode:
authorColin Snover2017-09-15 22:59:18 -0500
committerColin Snover2017-10-15 13:24:21 -0500
commitd1b77d4b68fbf1129fd84a8d411d1c12d57ba0ee (patch)
tree68c823dc0f1d81fb66234046aaced65514acbe2d /backends/platform/sdl/sdl-window.h
parentcd538ffffab9e49443da4ee043916d8dc22c3c07 (diff)
downloadscummvm-rg350-d1b77d4b68fbf1129fd84a8d411d1c12d57ba0ee.tar.gz
scummvm-rg350-d1b77d4b68fbf1129fd84a8d411d1c12d57ba0ee.tar.bz2
scummvm-rg350-d1b77d4b68fbf1129fd84a8d411d1c12d57ba0ee.zip
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.
Diffstat (limited to 'backends/platform/sdl/sdl-window.h')
-rw-r--r--backends/platform/sdl/sdl-window.h4
1 files changed, 3 insertions, 1 deletions
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.