diff options
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/sdl-window.cpp | 6 | ||||
-rw-r--r-- | backends/platform/sdl/sdl-window.h | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/backends/platform/sdl/sdl-window.cpp b/backends/platform/sdl/sdl-window.cpp index a550fbbd40..fe27d84de2 100644 --- a/backends/platform/sdl/sdl-window.cpp +++ b/backends/platform/sdl/sdl-window.cpp @@ -155,16 +155,20 @@ bool SdlWindow::hasMouseFocus() const { #endif } -void SdlWindow::warpMouseInWindow(int x, int y) { +bool SdlWindow::warpMouseInWindow(int x, int y) { if (hasMouseFocus()) { #if SDL_VERSION_ATLEAST(2, 0, 0) if (_window) { SDL_WarpMouseInWindow(_window, x, y); + return true; } #else SDL_WarpMouse(x, y); + return true; #endif } + + return false; } void SdlWindow::iconifyWindow() { 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. |