SDL: Move mouse in SDL2 only when window has focus.

This commit is contained in:
Eugene Sandulenko 2016-09-04 16:48:50 +02:00
parent 1dc0411ff9
commit 23e2a61d4e

View file

@ -150,7 +150,7 @@ bool SdlWindow::hasMouseFocus() const {
void SdlWindow::warpMouseInWindow(uint x, uint y) { void SdlWindow::warpMouseInWindow(uint x, uint y) {
#if SDL_VERSION_ATLEAST(2, 0, 0) #if SDL_VERSION_ATLEAST(2, 0, 0)
if (_window) { if (_window && hasMouseFocus()) {
SDL_WarpMouseInWindow(_window, x, y); SDL_WarpMouseInWindow(_window, x, y);
} }
#else #else